Exemplo n.º 1
0
 def test_schreier_sims_algorithm(self):
     cf  =Permutation.read_cycle_form
     a = cf([[1, 2]],4)
     b = cf([[1,2,3,4]], 4)
     c = cf([[2, 3, 4]], 4)
     d = cf([[2, 3]], 4)
     e = cf([], 4)
     info = schreier_sims_algorithm([], e)
     self.assertEquals(info, ([],[],[],[]))
     info = schreier_sims_algorithm([e,e,e,e], e)
     self.assertEquals(info, ([],[],[],[]))
     base, gens, c_gens, graphs = schreier_sims_algorithm([a,b], e)
     self.assertEquals(len(base), 3)
Exemplo n.º 2
0
 def coset_construction_from_schreier_tree_test(self, gens):
     identity = gens[0] * gens[0]**-1
     base, strong_gens, chain_generators, schreier_graphs = schreier_sims_algorithm(gens, identity)
     no_errors = True
     for s_g in schreier_graphs[0:-1]:
         coset_inverses_1 = _coset_rep_inverses(s_g, identity)
         coset_inverses_2 = [_coset_rep_inverse(i + 1, s_g, identity) for i in range(len(identity))]
         if coset_inverses_1 != coset_inverses_2:
             no_errors = False
             print(coset_inverses_1)
             print(coset_inverses_2)
     self.assertTrue(no_errors)
Exemplo n.º 3
0
 def __init__(self, generators, schreier_sims_info = None):
     self.generators = generators        
     if len(generators) > 0:
         g = self.generators[0]
         self.identity = g**-1 * g
     else:
         self.identity = Permutation([1])
     if schreier_sims_info is None:
         b, strong_gens, chain_gens, sgs = schreier_sims_tools.schreier_sims_algorithm(self.generators, self.identity)
     else:
         b, strong_gens, chain_gens, sgs = schreier_sims_info
     self.base = b
     self.strong_generators = strong_gens
     self.chain_generators = chain_gens
     self.schreier_graphs = sgs