Ticket #14319: trac_14319-empty.patch

File trac_14319-empty.patch, 10.3 KB (added by ncohen, 8 years ago)
  • sage/coding/binary_code.pyx

    # HG changeset patch
    # User Nathann Cohen <nathann.cohen@gmail.com>
    # Date 1364857481 -7200
    # Node ID 901aa6aa4ba75bca8fcd3e73d64e574a7debe63f
    # Parent  1958c09a201dfb4cf95b46cc2dd32d1114efe84e
    Correct domain for empty automorphism groups
    
    diff --git a/sage/coding/binary_code.pyx b/sage/coding/binary_code.pyx
    a b  
    41014101                          %(str(aut_B_aug.__interface[gap]),str(H))))
    41024102#                        print 'rt_transversal:', rt_transversal
    41034103                        rt_transversal = [PermutationGroupElement(g) for g in rt_transversal if str(g) != '()']
    4104                         rt_transversal = [[a-1 for a in g.list()] for g in rt_transversal]
     4104                        rt_transversal = [[a-1 for a in g.domain()] for g in rt_transversal]
    41054105                        rt_transversal = [g + range(len(g), n) for g in rt_transversal]
    41064106                        rt_transversal.append(range(n))
    41074107#                        print 'rt_transversal:', rt_transversal
  • sage/combinat/permutation.py

    diff --git a/sage/combinat/permutation.py b/sage/combinat/permutation.py
    a b  
    352352        [2, 5, 3, 4, 1]
    353353        sage: type(p)
    354354        <class 'sage.combinat.permutation.Permutation_class'>
    355    
     355
    356356    Construction from a string in cycle notation
    357    
     357
    358358    ::
    359    
     359
    360360        sage: p = Permutation( '(4,5)' ); p
    361361        [1, 2, 3, 5, 4]
    362    
     362
    363363    The size of the permutation is the maximum integer appearing; add
    364364    a 1-cycle to increase this::
    365    
     365
    366366        sage: p2 = Permutation( '(4,5)(10)' ); p2
    367367        [1, 2, 3, 5, 4, 6, 7, 8, 9, 10]
    368368        sage: len(p); len(p2)
    369369        5
    370370        10
    371    
     371
    372372    We construct a Permutation from a PermutationGroupElement::
    373    
     373
    374374        sage: g = PermutationGroupElement([2,1,3])
    375375        sage: Permutation(g)
    376376        [2, 1, 3]
    377    
     377
    378378    From a pair of tableaux of the same shape. This uses the inverse
    379379    of Robinson Schensted algorithm::
    380380
     
    411411    if isinstance(l, Permutation_class):
    412412        return l
    413413    elif isinstance(l, PermutationGroupElement):
    414         l = l.list()
     414        l = l.domain()
    415415
    416416    #if l is a string, then assume it is in cycle notation
    417417    elif isinstance(l, str):
     
    38633863    if not isinstance(pge, PermutationGroupElement):
    38643864        raise TypeError, "pge (= %s) must be a PermutationGroupElement"%pge
    38653865
    3866     return Permutation(pge.list())
     3866    return Permutation(pge.domain())
    38673867
    38683868def from_rank(n, rank):
    38693869    r"""
  • sage/combinat/species/permutation_species.py

    diff --git a/sage/combinat/species/permutation_species.py b/sage/combinat/species/permutation_species.py
    a b  
    4545    def permutation_group_element(self):
    4646        """
    4747        Returns self as a permutation group element.
    48        
     48
    4949        EXAMPLES::
    50        
     50
    5151            sage: p = PermutationGroupElement((2,3,4))
    5252            sage: P = species.PermutationSpecies()
    5353            sage: a = P.structures(["a", "b", "c", "d"]).random_element(); a
     
    6262        """
    6363        Returns the transport of this structure along the permutation
    6464        perm.
    65        
     65
    6666        EXAMPLES::
    67        
     67
    6868            sage: p = PermutationGroupElement((2,3,4))
    6969            sage: P = species.PermutationSpecies()
    7070            sage: a = P.structures(["a", "b", "c", "d"]).random_element(); a
     
    7474        """
    7575        p = self.permutation_group_element()
    7676        p = perm*p*~perm
    77         return self.__class__(self.parent(), self._labels, p.list())
     77        return self.__class__(self.parent(), self._labels, p.domain())
    7878
    7979    def automorphism_group(self):
    8080        """
    8181        Returns the group of permutations whose action on this structure
    8282        leave it fixed.
    83        
     83
    8484        EXAMPLES::
    85        
     85
    8686            sage: p = PermutationGroupElement((2,3,4))
    8787            sage: P = species.PermutationSpecies()
    8888            sage: a = P.structures(["a", "b", "c", "d"]).random_element(); a
    8989            ['a', 'c', 'b', 'd']
    9090            sage: a.automorphism_group()
    9191            Permutation Group with generators [(2,3), (1,4)]
    92        
     92
    9393        ::
    94        
     94
    9595            sage: [a.transport(perm) for perm in a.automorphism_group()]
    9696            [['a', 'c', 'b', 'd'],
    9797             ['a', 'c', 'b', 'd'],
  • sage/combinat/tableau.py

    diff --git a/sage/combinat/tableau.py b/sage/combinat/tableau.py
    a b  
    16391639            sage: rs = Tableau([[1, 2],[3]]).row_stabilizer()
    16401640            sage: PermutationGroupElement([(1,2),(3,)]) in rs
    16411641            True
    1642             sage: rs.one().list()
     1642            sage: rs.one().domain()
    16431643            [1, 2, 3]
    16441644            sage: rs = Tableau([[1],[2],[3]]).row_stabilizer()
    16451645            sage: rs.order()
  • sage/combinat/tableau_tuple.py

    diff --git a/sage/combinat/tableau_tuple.py b/sage/combinat/tableau_tuple.py
    a b  
    939939            True
    940940            sage: PermutationGroupElement([(1,4)]) in rs
    941941            False
    942             sage: rs.one().list()
     942            sage: rs.one().domain()
    943943            [1, 2, 3, 4, 5, 6, 7, 8, 9]
    944944        """
    945945
  • sage/combinat/words/finite_word.py

    diff --git a/sage/combinat/words/finite_word.py b/sage/combinat/words/finite_word.py
    a b  
    61426142        from sage.groups.perm_gps.permgroup_element import PermutationGroupElement
    61436143        if not isinstance(permutation, Permutation_class):
    61446144            if isinstance(permutation, PermutationGroupElement):
    6145                 permutation = Permutation(permutation.list())
     6145                permutation = Permutation(permutation.domain())
    61466146            else:
    61476147                permutation = Permutation(permutation)
    61486148        return self.parent()(permutation.action(self))
     
    61706170        from sage.groups.perm_gps.permgroup_element import PermutationGroupElement
    61716171        if not isinstance(permutation, Permutation_class):
    61726172            if isinstance(permutation, PermutationGroupElement):
    6173                 permutation = Permutation(permutation.list())
     6173                permutation = Permutation(permutation.domain())
    61746174            else:
    61756175                permutation = Permutation(permutation)
    61766176        alphabet = self.parent().alphabet()
  • sage/crypto/classical.py

    diff --git a/sage/crypto/classical.py b/sage/crypto/classical.py
    a b  
    31393139            sage: d(e(A(M))) == A(M)
    31403140            True
    31413141        """
     3142        from sage.combinat.permutation import Permutations
    31423143        S = self.cipher_domain()
    31433144        n = S.ngens()
    3144         I = SymmetricGroup(n).random_element().list()
     3145        I = Permutations(n).random_element()
    31453146        return S([ i-1 for i in I ])
    31463147
    31473148    def inverse_key(self, K):
  • sage/graphs/generic_graph.py

    diff --git a/sage/graphs/generic_graph.py b/sage/graphs/generic_graph.py
    a b  
    1619416194            sage: for u,v in g.edges(labels = False):
    1619516195            ...       if len(ag.orbit((u,v),action="OnPairs")) != 30:
    1619616196            ...           print "ARggggggggggggg !!!"
     16197
     16198        Empty group, correct domain::
     16199
     16200            sage: Graph({'a':['a'], 'b':[]}).automorphism_group()
     16201            Permutation Group with generators [()]
     16202            sage: Graph({'a':['a'], 'b':[]}).automorphism_group().domain()
     16203            {'a', 'b'}
    1619716204        """
    1619816205        from sage.groups.perm_gps.partn_ref.refinement_graphs import search_tree
    1619916206        from sage.groups.perm_gps.permgroup import PermutationGroup
     
    1629216299                gens = [ [ tuple([int_to_vertex[i] for i in cycle]) for cycle in gen] for gen in gens]
    1629316300                output.append(PermutationGroup(gens = gens, domain = int_to_vertex.values()))
    1629416301            else:
    16295                 output.append(PermutationGroup([[]]))
     16302                output.append(PermutationGroup([[]], domain = self.vertices()))
    1629616303        if order:
    1629716304            output.append(c)
    1629816305        if orbits:
  • sage/homology/simplicial_complex.py

    diff --git a/sage/homology/simplicial_complex.py b/sage/homology/simplicial_complex.py
    a b  
    31423142            sage: P.automorphism_group().is_isomorphic(AlternatingGroup(5))
    31433143            True
    31443144
    3145             sage: Z = SimplicialComplex([[1,2],[2,3,'a']])
     3145            sage: Z = SimplicialComplex([['1','2'],['2','3','a']])
    31463146            sage: Z.automorphism_group().is_isomorphic(CyclicPermutationGroup(2))
    31473147            True
    31483148            sage: group = Z.automorphism_group()
    31493149            sage: group.domain()
    3150             {1, 2, 3, 'a'}
     3150            {'1', '2', '3', 'a'}
    31513151        """
    31523152        from sage.groups.perm_gps.permgroup import PermutationGroup
    31533153
  • sage/modular/arithgroup/arithgroup_perm.py

    diff --git a/sage/modular/arithgroup/arithgroup_perm.py b/sage/modular/arithgroup/arithgroup_perm.py
    a b  
    459459        if not G.is_transitive():
    460460            raise ValueError, "Permutations do not generate a transitive group"
    461461
    462     s2 = [i-1 for i in S2.list()]
    463     s3 = [i-1 for i in S3.list()]
    464     l = [i-1 for i in L.list()]
    465     r = [i-1 for i in R.list()]
     462    s2 = [i-1 for i in S2.domain()]
     463    s3 = [i-1 for i in S3.domain()]
     464    l = [i-1 for i in L.domain()]
     465    r = [i-1 for i in R.domain()]
    466466    _equalize_perms((s2,s3,l,r))
    467467
    468468    if inv.is_one(): # the group is even
  • sage/rings/number_field/galois_group.py

    diff --git a/sage/rings/number_field/galois_group.py b/sage/rings/number_field/galois_group.py
    a b  
    589589        if self.order() == 1:
    590590            return self._galois_closure # work around a silly error
    591591           
    592         vecs = [pari(g.list()).Vecsmall() for g in self._elts]
     592        vecs = [pari(g.domain()).Vecsmall() for g in self._elts]
    593593        v = self._ambient._pari_data.galoisfixedfield(vecs)
    594594        x = self._galois_closure(v[1])
    595595        return self._galois_closure.subfield(x)
     
    644644            Defn: w |--> -w
    645645        """
    646646        L = self.parent().splitting_field()
    647         a = L(self.parent()._pari_data.galoispermtopol(pari(self.list()).Vecsmall()))
     647        a = L(self.parent()._pari_data.galoispermtopol(pari(self.domain()).Vecsmall()))
    648648        return L.hom(a, L)
    649649
    650650    def __call__(self, x):