1072 | | Return the orbit of the given point under the group action. |
| 1072 | Return the orbit of a point (or set, or tuple) under the group action. |
| 1073 | |
| 1074 | INPUT: |
| 1075 | |
| 1076 | - ``point`` -- can be a point or a tuple of points, depending on the |
| 1077 | action to be considered. |
| 1078 | |
| 1079 | - ``action`` (string) -- when ``point`` is a tuple of points, this |
| 1080 | variable defines whether the group is to be considered as acting on |
| 1081 | tuples (``action="ontuples"``) or acting on sets |
| 1082 | (``action="onsets"``). It is set to ``"onpoints"`` by default. See |
| 1083 | below for examples. |
1086 | | """ |
1087 | | point = self._domain_to_gap[point] |
1088 | | return [self._domain_from_gap[x] for x in self._gap_().Orbit(point).sage()] |
1089 | | |
| 1096 | |
| 1097 | Action of `S_3` on sets:: |
| 1098 | |
| 1099 | sage: S3 = groups.permutation.Symmetric(3) |
| 1100 | sage: S3.orbit((1,2), action = "OnSets") |
| 1101 | [[1, 2], [2, 3], [1, 3]] |
| 1102 | |
| 1103 | On tuples:: |
| 1104 | |
| 1105 | sage: S3.orbit((1,2), action = "OnTuples") |
| 1106 | [[1, 2], [2, 3], [2, 1], [3, 1], [1, 3], [3, 2]] |
| 1107 | """ |
| 1108 | if action == "OnPoints": |
| 1109 | try: |
| 1110 | point = self._domain_to_gap[point] |
| 1111 | except KeyError: |
| 1112 | raise ValueError("The point given as argument does not seem to "+ |
| 1113 | "exist. If you want to compute an action on sets "+ |
| 1114 | "of tuples you *must* define the 'action' "+ |
| 1115 | "argument explicitly.") |
| 1116 | return [self._domain_from_gap[x] for x in self._gap_().Orbit(point).sage()] |
| 1117 | |
| 1118 | elif action in ["OnTuples", "OnSets"]: |
| 1119 | points = [self._domain_to_gap[x] for x in point] |
| 1120 | orbits = self._gap_().Orbit(points, action).sage() |
| 1121 | return [[self._domain_from_gap[x] for x in o] for o in orbits] |
| 1122 | else: |
| 1123 | raise ValueError("'action' can only take values among 'OnPoints', 'OnTuples' or 'OnSets'.") |
| 1124 | |
1092 | | If G is a permutation group acting on the set `X = \{1, 2, ...., n\}` |
1093 | | and H is the stabilizer subgroup of <integer>, a right |
1094 | | (respectively left) transversal is a set containing exactly |
1095 | | one element from each right (respectively left) coset of H. This |
1096 | | method returns a right transversal of ``self`` by the stabilizer |
| 1127 | If G is a permutation group acting on the set `X = \{1, 2, ...., n\}` |
| 1128 | and H is the stabilizer subgroup of <integer>, a right |
| 1129 | (respectively left) transversal is a set containing exactly |
| 1130 | one element from each right (respectively left) coset of H. This |
| 1131 | method returns a right transversal of ``self`` by the stabilizer |
1106 | 1141 | [(), (1,2)(3,4), (1,3,2,10,4), (1,4,2,10,3), (1,10,4,3,2)] |
1107 | 1142 | |
1108 | 1143 | sage: G = PermutationGroup([ [('c','d')], [('a','c')] ]) |
1109 | 1144 | sage: G.transversals('a') |
1128 | 1163 | sage: G = PermutationGroup([[(1,2),(3,4)], [(1,2,3,4,10)]]) |
1129 | 1164 | sage: G.stabilizer(10) |
1130 | 1165 | Subgroup of (Permutation Group with generators [(1,2)(3,4), (1,2,3,4,10)]) generated by [(2,3,4), (1,2)(3,4)] |
1132 | 1167 | Subgroup of (Permutation Group with generators [(1,2)(3,4), (1,2,3,4,10)]) generated by [(2,3)(4,10), (2,10,4)] |
1133 | 1168 | sage: G = PermutationGroup([[(2,3,4)],[(6,7)]]) |
1134 | 1169 | sage: G.stabilizer(1) |