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. |
| 1083 | - ``point`` -- can be a point or any of the list above, depending on the |
| 1084 | action to be considered. Note that sets should be "canonical", i.e. their |
| 1085 | members must be sorted w.r.t. to the default order on them. |
| 1086 | |
| 1087 | - ``action`` (string) -- if ``point`` is a tuple (of tuples) of points, this |
| 1088 | variable describes how the group is acting. The list of possibilites is |
| 1089 | is given by `self.supported_actions`. |
| 1090 | It is set to ``"OnPoints"`` by default. See below for examples. |
| 1114 | |
| 1115 | Action of `S_4` on sets of disjoint sets:: |
| 1116 | |
| 1117 | sage: S4 = groups.permutation.Symmetric(4) |
| 1118 | sage: S4.orbit(((1,2),(3,4)), action = "OnSetsDisjointSets") |
| 1119 | [[[1, 2], [3, 4]], [[1, 4], [2, 3]], [[1, 3], [2, 4]]] |
| 1120 | |
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] |
| 1132 | elif action in self.supported_actions: |
| 1133 | if action in ['OnTuples', 'OnSets', 'OnPairs']: |
| 1134 | points = [self._domain_to_gap[x] for x in point] |
| 1135 | orbits = self._gap_().Orbit(points, action).sage() |
| 1136 | return [[self._domain_from_gap[x] for x in o] for o in orbits] |
| 1137 | else: |
| 1138 | points = [[self._domain_to_gap[x] for x in p] for p in point] |
| 1139 | orbits = self._gap_().Orbit(points, action).sage() |
| 1140 | return [[[self._domain_from_gap[x] for x in p] for p in o] |
| 1141 | for o in orbits] |
| 1142 | |
1123 | | raise ValueError("'action' can only take values among 'OnPoints', 'OnTuples' or 'OnSets'.") |
| 1144 | raise ValueError("'action' can only take values among "+ |
| 1145 | self.supported_actions) |
| 1146 | |
| 1147 | def action(self, domain, action = "OnPoints"): |
| 1148 | """ |
| 1149 | Return the permutation group induced by self acting on domain. |
| 1150 | |
| 1151 | INPUT: |
| 1152 | |
| 1153 | - ``domain`` -- the list of things for which GAP knows how to compute |
| 1154 | the action of the permutation group. For instance it can be obtained by |
| 1155 | calling :meth:`orbit`. |
| 1156 | |
| 1157 | - ``action`` (string) -- the action on domain. Need not be limited to |
| 1158 | `self.supported_actions`. |
| 1159 | It is set to ``"OnPoints"`` by default. See below for examples. |
| 1160 | |
| 1161 | EXAMPLES:: |
| 1162 | |
| 1163 | Action of `S_5` on 2-subsets:: |
| 1164 | |
| 1165 | sage: S5 = groups.permutation.Symmetric(5) |
| 1166 | sage: o10 = S5.orbit((1,2), action = "OnSets") |
| 1167 | sage: S5_10 = S5.action(o10, action = "OnSets"); S5_10 |
| 1168 | Permutation Group with generators [(2,4)(6,9)(7,10), (1,2,3,5,7)(4,6,8,9,10)] |
| 1169 | |
| 1170 | Non-faithful action of `S_4` on sets of disjoint sets:: |
| 1171 | |
| 1172 | sage: S4 = groups.permutation.Symmetric(4) |
| 1173 | sage: o3 = S4.orbit(((1,2),(3,4)), action = "OnSetsDisjointSets") |
| 1174 | sage: S3 = S4.action(o3, "OnSetsDisjointSets"); S3 |
| 1175 | Permutation Group with generators [(2,3), (1,2)] |
| 1176 | sage: S3.order() |
| 1177 | 6 |
| 1178 | |
| 1179 | """ |
| 1180 | return PermutationGroup(gap_group = self._gap_().Action(domain, action)) |