| 1123 | Action of `S_4` (on a nonstandard domain) on tuples of sets:: |
| 1124 | |
| 1125 | sage: S4 = PermutationGroup([ [('c','d')], [('a','c')], [('a','b')] ]) |
| 1126 | sage: S4.orbit((('a','c'),('b','d')),"OnTuplesSets") |
| 1127 | [[['a', 'c'], ['b', 'd']], [['a', 'd'], ['b', 'c']], [['b', 'c'], ['a', 'd']], [['b', 'd'], ['a', 'c']], [['c', 'd'], ['a', 'b']], [['a', 'b'], ['c', 'd']]] |
| 1128 | |
| 1129 | Action of `S_4` (on a very nonstandard domain) on tuples of sets:: |
| 1130 | |
| 1131 | sage: S4 = PermutationGroup([ [((11,(12,13)),'d')], [((12,(12,11)),(11,(12,13)))], [((12,(12,11)),'b')] ]) |
| 1132 | sage: S4.orbit((( (11,(12,13)), (12,(12,11))),('b','d')),"OnTuplesSets") |
| 1133 | [[[(11, (12, 13)), (12, (12, 11))], ['b', 'd']], [['d', (12, (12, 11))], ['b', (11, (12, 13))]], [['b', (11, (12, 13))], ['d', (12, (12, 11))]], [['d', (11, (12, 13))], ['b', (12, (12, 11))]], [['b', 'd'], [(11, (12, 13)), (12, (12, 11))]], [['b', (12, (12, 11))], ['d', (11, (12, 13))]]] |
| 1134 | |
1134 | | elif action in self.supported_actions: |
1135 | | if action in ['OnTuples', 'OnSets', 'OnPairs']: |
1136 | | points = [self._domain_to_gap[x] for x in point] |
1137 | | orbits = self._gap_().Orbit(points, action).sage() |
1138 | | return [[self._domain_from_gap[x] for x in o] for o in orbits] |
1139 | | else: |
1140 | | points = [[self._domain_to_gap[x] for x in p] for p in point] |
1141 | | orbits = self._gap_().Orbit(points, action).sage() |
1142 | | return [[[self._domain_from_gap[x] for x in p] for p in o] |
1143 | | for o in orbits] |
1144 | | |
1145 | | else: |
1146 | | raise ValueError("'action' can only take values among "+ |
1147 | | self.supported_actions) |
| 1146 | def dom_to_gap(x): |
| 1147 | try: |
| 1148 | return self._domain_to_gap[x] |
| 1149 | except (TypeError, KeyError): |
| 1150 | return [dom_to_gap(y) for y in x] |
| 1151 | |
| 1152 | def dom_from_gap(x): |
| 1153 | try: |
| 1154 | return self._domain_from_gap[x] |
| 1155 | except (TypeError, KeyError): |
| 1156 | return [dom_from_gap(y) for y in x] |
| 1157 | |
| 1158 | return dom_from_gap(self._gap_().Orbit(dom_to_gap(point), action).sage()) |
| 1196 | Action of `S_4` (on a nonstandard domain) on tuples of sets:: |
| 1197 | |
| 1198 | sage: S4 = PermutationGroup([ [('c','d')], [('a','c')], [('a','b')] ]) |
| 1199 | sage: o6 = S4.orbit((('a','c'),('b','d')),"OnTuplesSets") |
| 1200 | sage: S4.action(o6, "OnTuplesSets") |
| 1201 | Permutation Group with generators [(2,5)(3,6), (1,2)(3,4), (1,3)(2,4)] |
| 1202 | |
| 1203 | Action of `S_4` (on a very nonstandard domain) on tuples of sets:: |
| 1204 | |
| 1205 | sage: S4 = PermutationGroup([ [((11,(12,13)),'d')], [((12,(12,11)),(11,(12,13)))], [((12,(12,11)),'b')] ]) |
| 1206 | sage: o6 = S4.orbit((( (11,(12,13)), (12,(12,11))),('b','d')),"OnTuplesSets") |
| 1207 | sage: S4.action(o6, "OnTuplesSets") |
| 1208 | Permutation Group with generators [(2,4)(3,6), (1,2)(3,5), (1,3)(2,5)] |
| 1209 | |