Ticket #10920: trac_10920-conjugates-permutation-groups.patch

File trac_10920-conjugates-permutation-groups.patch, 3.6 KB (added by rbeezer, 10 years ago)
  • sage/groups/perm_gps/permgroup.py

    # HG changeset patch
    # User Rob Beezer <beezer@ups.edu>
    # Date 1299903500 28800
    # Node ID 1c93228470c548dce9903f841338cf6cce449597
    # Parent  8438b7c20d79c02a2ece3e1c3f7224a772ff8f07
    10920: conjugates of permutation groups
    
    diff -r 8438b7c20d79 -r 1c93228470c5 sage/groups/perm_gps/permgroup.py
    a b  
    11631163        C = self._gap_().Center()
    11641164        return PermutationGroup(gap_group=C)
    11651165
     1166    def conjugate(self, g):
     1167        r"""
     1168        Returns the group formed by conjugating ``self`` with ``g``.
     1169
     1170        INPUT:
     1171
     1172        - ``g`` - a permutation group element, or an object that converts
     1173          to a permutation group element, such as a list of integers or
     1174          a string of cycles.
     1175
     1176        OUTPUT:
     1177
     1178        If ``self`` is the group denoted by `H`, then this method computes
     1179        the group
     1180
     1181        .. math::
     1182
     1183            g^{-1}Hg = \{g^{-1}hg\vert h\in H\}
     1184
     1185        which is the group `H` conjugated by `g`.
     1186
     1187        There are no restrictions on ``self`` and ``g`` belonging to
     1188        a common permutation group, and correspondingly, there is no
     1189        relationship (such as a common parent) between ``self`` and the
     1190        output group.
     1191
     1192        EXAMPLES::
     1193
     1194            sage: G = DihedralGroup(6)
     1195            sage: a = PermutationGroupElement("(1,2,3,4)")
     1196            sage: G.conjugate(a)
     1197            Permutation Group with generators [(1,5,6,2,3,4), (1,4)(2,6)(3,5)]
     1198
     1199        The element performing the conjugation can be specified in
     1200        several ways.  ::
     1201
     1202            sage: G = DihedralGroup(6)
     1203            sage: strng = "(1,2,3,4)"
     1204            sage: G.conjugate(strng)
     1205            Permutation Group with generators [(1,5,6,2,3,4), (1,4)(2,6)(3,5)]
     1206            sage: G = DihedralGroup(6)
     1207            sage: lst = [2,3,4,1]
     1208            sage: G.conjugate(lst)
     1209            Permutation Group with generators [(1,5,6,2,3,4), (1,4)(2,6)(3,5)]
     1210            sage: G = DihedralGroup(6)
     1211            sage: cycles = [(1,2,3,4)]
     1212            sage: G.conjugate(cycles)
     1213            Permutation Group with generators [(1,5,6,2,3,4), (1,4)(2,6)(3,5)]
     1214
     1215        Conjugation is a group automorphism, so conjugate groups
     1216        will be isomorphic. ::
     1217
     1218            sage: G = DiCyclicGroup(6)
     1219            sage: G.degree()
     1220            11
     1221            sage: cycle = [i+1 for i in range(1,11)] + [1]
     1222            sage: C = G.conjugate(cycle)
     1223            sage: G.is_isomorphic(C)
     1224            True
     1225
     1226        The conjugating element may be from a symmetric group with
     1227        larger degree than the group being conjugated.  ::
     1228
     1229            sage: G = AlternatingGroup(5)
     1230            sage: G.degree()
     1231            5
     1232            sage: g = "(1,3)(5,6,7)"
     1233            sage: H = G.conjugate(g); H
     1234            Permutation Group with generators [(1,4,6,3,2), (1,4,6)]
     1235            sage: H.degree()
     1236            6
     1237
     1238        The conjugating element is checked. ::
     1239
     1240            sage: G = SymmetricGroup(3)
     1241            sage: G.conjugate("junk")
     1242            Traceback (most recent call last):
     1243            ...
     1244            TypeError: junk does not convert to a permutation group element
     1245        """
     1246        try:
     1247            g = PermutationGroupElement(g)
     1248        except:
     1249            raise TypeError("{0} does not convert to a permutation group element".format(g))
     1250        return PermutationGroup(gap_group=gap.ConjugateGroup(self, g))
     1251
    11661252    def direct_product(self,other,maps=True):
    11671253        """
    11681254        Wraps GAP's ``DirectProduct``, ``Embedding``, and ``Projection``.