# HG changeset patch
# User William Stein <wstein@gmail.com>
# Date 1227923196 28800
# Node ID b25320dac771b75966317a81295c4877223e9da8
# Parent d19e764b85ac1c10944acaaf15aa2fbd7c3c2091
trac #4383  composition_series() returns no generators for trivial subgroup) (part 3)
diff r d19e764b85ac r b25320dac771 sage/groups/perm_gps/permgroup.py
a

b


276  276  gens = [PermutationGroupElement(x, check=False).list() for x in gens] 
277  277  self._deg = max([1]+[max(g) for g in gens]) 
278  278  gens = [PermutationGroupElement(x, self, check=False) for x in gens] 
 279  if not gens: # length 0 
 280  gens = [()] 
279  281  if canonicalize: 
280  282  gens = list(set(gens)) 
281  283  gens.sort() 
… 
… 

298  300  except TypeError, s: 
299  301  raise RuntimeError, "(It might be necessary to install the database_gap optional Sage package, if you haven't already.)\n%s"%s 
300  302  gens = [PermutationGroupElement(gens[n],self, check=False) 
301   for n in range(1, int(gens.Length())+1)] 
 303  for n in range(1, int(gens.Length())+1)] 
302  304  if gens == []: 
303   gens = [self.identity()] 
304   
 305  gens = [()] 
305  306  return gens 
306  307  
307  308  
… 
… 

1684  1685  sage: G = PermutationGroup([[(1,2,3),(4,5)],[(3,4)]]) 
1685  1686  sage: G.composition_series() # random output 
1686  1687  [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 [()]] 
1687   
 1688  sage: G = PermutationGroup([[(1,2,3),(4,5)], [(1,2)]]) 
 1689  sage: CS = G.composition_series() 
 1690  sage: CS[3] 
 1691  Permutation Group with generators [()] 
1688  1692  """ 
1689  1693  current_randstate().set_seed_gap() 
1690  1694  ans = [] 