| 1225 | def conjugate(self, g): |
| 1226 | r""" |
| 1227 | Returns the group formed by conjugating ``self`` with ``g``. |
| 1228 | |
| 1229 | INPUT: |
| 1230 | |
| 1231 | - ``g`` - a permutation group element, or an object that converts |
| 1232 | to a permutation group element, such as a list of integers or |
| 1233 | a string of cycles. |
| 1234 | |
| 1235 | OUTPUT: |
| 1236 | |
| 1237 | If ``self`` is the group denoted by `H`, then this method computes |
| 1238 | the group |
| 1239 | |
| 1240 | .. math:: |
| 1241 | |
| 1242 | g^{-1}Hg = \{g^{-1}hg\vert h\in H\} |
| 1243 | |
| 1244 | which is the group `H` conjugated by `g`. |
| 1245 | |
| 1246 | There are no restrictions on ``self`` and ``g`` belonging to |
| 1247 | a common permutation group, and correspondingly, there is no |
| 1248 | relationship (such as a common parent) between ``self`` and the |
| 1249 | output group. |
| 1250 | |
| 1251 | EXAMPLES:: |
| 1252 | |
| 1253 | sage: G = DihedralGroup(6) |
| 1254 | sage: a = PermutationGroupElement("(1,2,3,4)") |
| 1255 | sage: G.conjugate(a) |
| 1256 | Permutation Group with generators [(1,5,6,2,3,4), (1,4)(2,6)(3,5)] |
| 1257 | |
| 1258 | The element performing the conjugation can be specified in |
| 1259 | several ways. :: |
| 1260 | |
| 1261 | sage: G = DihedralGroup(6) |
| 1262 | sage: strng = "(1,2,3,4)" |
| 1263 | sage: G.conjugate(strng) |
| 1264 | Permutation Group with generators [(1,5,6,2,3,4), (1,4)(2,6)(3,5)] |
| 1265 | sage: G = DihedralGroup(6) |
| 1266 | sage: lst = [2,3,4,1] |
| 1267 | sage: G.conjugate(lst) |
| 1268 | Permutation Group with generators [(1,5,6,2,3,4), (1,4)(2,6)(3,5)] |
| 1269 | sage: G = DihedralGroup(6) |
| 1270 | sage: cycles = [(1,2,3,4)] |
| 1271 | sage: G.conjugate(cycles) |
| 1272 | Permutation Group with generators [(1,5,6,2,3,4), (1,4)(2,6)(3,5)] |
| 1273 | |
| 1274 | Conjugation is a group automorphism, so conjugate groups |
| 1275 | will be isomorphic. :: |
| 1276 | |
| 1277 | sage: G = DiCyclicGroup(6) |
| 1278 | sage: G.degree() |
| 1279 | 11 |
| 1280 | sage: cycle = [i+1 for i in range(1,11)] + [1] |
| 1281 | sage: C = G.conjugate(cycle) |
| 1282 | sage: G.is_isomorphic(C) |
| 1283 | True |
| 1284 | |
| 1285 | The conjugating element may be from a symmetric group with |
| 1286 | larger degree than the group being conjugated. :: |
| 1287 | |
| 1288 | sage: G = AlternatingGroup(5) |
| 1289 | sage: G.degree() |
| 1290 | 5 |
| 1291 | sage: g = "(1,3)(5,6,7)" |
| 1292 | sage: H = G.conjugate(g); H |
| 1293 | Permutation Group with generators [(1,4,6,3,2), (1,4,6)] |
| 1294 | sage: H.degree() |
| 1295 | 6 |
| 1296 | |
| 1297 | The conjugating element is checked. :: |
| 1298 | |
| 1299 | sage: G = SymmetricGroup(3) |
| 1300 | sage: G.conjugate("junk") |
| 1301 | Traceback (most recent call last): |
| 1302 | ... |
| 1303 | TypeError: junk does not convert to a permutation group element |
| 1304 | """ |
| 1305 | try: |
| 1306 | g = PermutationGroupElement(g) |
| 1307 | except: |
| 1308 | raise TypeError("{0} does not convert to a permutation group element".format(g)) |
| 1309 | return PermutationGroup(gap_group=gap.ConjugateGroup(self, g)) |
| 1310 | |