Ejemplo n.º 1
0
    def test_partition_backtrack_subgroup_two_prop_subgroup_stab(self):        
        cf = Permutation.read_cycle_form
        a = cf([[3,2,6]], 7)
        b = cf([[3,2],[6,7]], 7)
        G = PermGroup([a,b])
        fam_subgroup = SubgroupFamily(G)
        prop_subgroup = SubgroupProperty(G)
        stab = Partition([[1,3,5,7],[2,4,6]])
        fam_part_stab = PartitionStabaliserFamily(stab)        
        prop_part_stab = PartitionStabaliserProperty(stab)
        
        size = 7
        fam = Refinement([fam_part_stab, fam_subgroup])
        prop = CosetProperty([prop_part_stab, prop_subgroup])
        pbw = PBW(prop, fam, size)
        
        gens = pbw.find_partition_backtrack_subgroup()
        
        found = []
        s7 = PermGroup([cf([[1,2]],7),cf([[1,2,3,4,5,6,7]],7)])
        for ele in s7._list_elements():
            if prop.check(ele):
                found.append(ele)

        self.assertEqual(len(PermGroup(gens)), len(found))     
Ejemplo n.º 2
0
 def test_partition_backtrack_subgroup_leon_paper(self):
     cf = Permutation.read_cycle_form
     a = cf([[2,3],[4,6],[5,8],[9,11]], 13)
     b = cf([[1,2,4,7,9,3,5,6,8,10,11,12,13]], 13)
     G = PermGroup([a,b])
     fam_subgroup = SubgroupFamily(G)
     prop_subgroup = SubgroupProperty(G)
     
     stab = Partition([[1,3,5,7,9,11],[2,4,6,8,10,12,13]])
     fam_part_stab = PartitionStabaliserFamily(stab)        
     prop_part_stab = PartitionStabaliserProperty(stab)
     
     size = 13
     fam = Refinement([fam_subgroup, fam_part_stab])
     prop = CosetProperty([prop_subgroup, prop_part_stab])
     pbw = PBW(prop, fam, size)     
     
     gens = pbw.find_partition_backtrack_subgroup()
     cand_G = PermGroup(gens)
     leon_gens = []
     leon_gens.append(cf([[2,12],[4,10],[5,7],[6,8]],13))
     leon_gens.append(cf([[2,8],[3,5],[4,6],[10,12]],13))
     leon_gens.append(cf([[1,9],[2,4],[6,8],[10,12]],13))
     leon_G = PermGroup(leon_gens)
     third_source = []
     for ele in G._list_elements():
         if prop.check(ele):
             third_source.append(ele)
     self.assertEqual(cand_G.order(), leon_G.order())
     for perm in leon_gens:
         self.assertTrue(perm in G)
         self.assertTrue(perm in cand_G)
Ejemplo n.º 3
0
 def test_multi_coset_property(self):
     cf = Permutation.read_cycle_form
     a = cf([[1,2,3]],4)
     b = cf([[1,2],[3,4]],4)
     gens = [a,b]
     G= PermGroup(gens)
     prop1 = SubgroupProperty(G)
     prop2 = PartitionStabaliserProperty(Partition([[2,3],[1,4]]))
     co_prop = CosetProperty([prop1,prop2])
     pos = cf([[2,3],[1,4]])
     self.assertTrue(co_prop.check(pos))
Ejemplo n.º 4
0
 def test_subgroup_property(self):
     cf = Permutation.read_cycle_form
     a = cf([[1,2,3]],4)
     b = cf([[1,2],[3,4]],4)
     gens = [a,b]
     G= PermGroup(gens)
     prop = CosetProperty([SubgroupProperty(G)])
     pos = cf([[2,3,4]],4)        
     neg = cf([[3,4]],4)
     self.assertTrue(prop.check(pos))
     self.assertFalse(prop.check(neg))
Ejemplo n.º 5
0
    def test_partition_backtrack_subgroup_one_prop_stab(self):
        cf = Permutation.read_cycle_form
        stab = Partition([[1,3,5],[2,4,6]])
        fam_part_stab = PartitionStabaliserFamily(stab)        
        prop_part_stab = PartitionStabaliserProperty(stab)
        
        size = 6
        fam = Refinement([fam_part_stab])
        prop = CosetProperty([prop_part_stab])
        pbw = PBW(prop, fam, size)     
        
        gens = pbw.find_partition_backtrack_subgroup()
        
        found = []
        s6 = PermGroup([cf([[1,2]],6),cf([[1,2,3,4,5,6]],6)])
        for ele in s6._list_elements():
            if prop.check(ele):
                found.append(ele)

        self.assertEqual(len(PermGroup(gens)), len(found))
Ejemplo n.º 6
0
    def test_partition_backtrack_subgroup_one_prop_subgroup(self):
        cf = Permutation.read_cycle_form
        a = cf([[1,2,3]], 5)
        b = cf([[1,2],[3,4]], 5)
        G = PermGroup([a,b])
        fam_subgroup = SubgroupFamily(G)
        prop_subgroup = SubgroupProperty(G)
        
        fam = Refinement([fam_subgroup])
        prop = CosetProperty([prop_subgroup])
        pbw = PBW(prop, fam, 5)
        
        gens = pbw.find_partition_backtrack_subgroup()
        
        found = []
        s5 = PermGroup([cf([[1,2]],5),cf([[1,2,3,4,5]],5)])
        for ele in s5._list_elements():
            if prop.check(ele):
                found.append(ele)

        self.assertEqual(len(PermGroup(gens)), len(found))
Ejemplo n.º 7
0
 def test_permutation_commuter_property(self):
     prop = CosetProperty([PermutationCommuterProperty(Permutation([2,1,3,4]))])
     pos = Permutation.read_cycle_form([[3,4]],4)
     neg = Permutation.read_cycle_form([[2,3]],4)
     self.assertTrue(prop.check(pos))
     self.assertFalse(prop.check(neg))
Ejemplo n.º 8
0
 def test_partition_stabaliser_property(self):
     prop = CosetProperty([PartitionStabaliserProperty(Partition([[1,2],[3,4],[5]]))])
     pos = Permutation.read_cycle_form([[1,2]],5)
     neg = Permutation.read_cycle_form([[1,2],[4,5]],5)
     self.assertTrue(prop.check(pos))
     self.assertFalse(prop.check(neg))
Ejemplo n.º 9
0
 def test_coset_property_init(self):
     prop = CosetProperty([IdentityProperty()])
     self.assertTrue(prop.check(Permutation.read_cycle_form([[1,2,3,4]], 5)))