Ticket #4383: trac_4383-order-trivial-permgp3.patch

File trac_4383-order-trivial-permgp3.patch, 1.8 KB (added by wdj, 12 years ago)
  • sage/groups/perm_gps/permgroup.py

    # HG changeset patch
    # User David Joyner <wdjoyner@gmail.com>
    # Date 1225504812 14400
    # Node ID 89d9d290ee28d3e6f60c5c934545a24b0d7c82a6
    # Parent  6c2e187f6c5ba5931c0542664b98443fcde44a18
    patch for trivial group output - wdj
    
    diff -r 6c2e187f6c5b -r 89d9d290ee28 sage/groups/perm_gps/permgroup.py
    a b  
    252252            self._gap_string = gap_group if isinstance(gap_group, str) else str(gap_group)
    253253            self._gens = self._gens_from_gap()
    254254            return
    255 
    256255        gens = [PermutationGroupElement(x, check=False).list() for x in gens]
    257256        self._deg = max([1]+[max(g) for g in gens])
    258257        gens = [PermutationGroupElement(x, self, check=False) for x in gens]
     258        if gens == []:
     259            gens = [()]
    259260        self._gens = gens
    260261        self._gap_string = 'Group(%s)'%gens
    261262
     
    277278        gens = [PermutationGroupElement(gens[n],self, check=False)
    278279                       for n in range(1, int(gens.Length())+1)]
    279280        if gens == []:
    280             gens = [self.identity()]
    281 
     281            gens = [()]
    282282        return gens
    283283
    284284
     
    16221622            sage: G = PermutationGroup([[(1,2,3),(4,5)],[(3,4)]])
    16231623            sage: G.composition_series()  # random output
    16241624            [Permutation Group with generators [(1,2,3)(4,5), (3,4)], Permutation Group with generators [(1,5)(3,4), (1,5)(2,3), (1,5,4)], Permutation Group with generators [()]]
     1625            sage: G = PermutationGroup([[(1,2,3),(4,5)], [(1,2)]])
     1626            sage: CS = G.composition_series()
     1627            sage: CS[3]
     1628            Permutation Group with generators [()]
    16251629
    16261630        """
    16271631        current_randstate().set_seed_gap()