def test_3g_3(self):
     from phenum.grouptheory import a_group
     from phenum.phonons import how_many_arrows, how_many_arrows
     dim = 6
     col = [[1, 1], [1, 2], [1, 3], [1, 4]]
     trans = [[
         j - 1 for j in i
     ] for i in [[1, 2, 3, 4], [2, 1, 4, 3], [3, 4, 1, 2], [4, 3, 2, 1]]]
     rots = [[[j - 1 for j in i] for i in t]
             for t in [[[1, 2, 3, 4], [1, 2, 3, 4, 5, 6]],
                       [[1, 4, 3, 2], [1, 3, 2, 4, 6, 5]],
                       [[1, 2, 3, 4], [4, 2, 3, 1, 5, 6]],
                       [[1, 4, 3, 2], [4, 3, 2, 1, 6, 5]],
                       [[1, 2, 3, 4], [1, 5, 3, 4, 2, 6]],
                       [[1, 4, 3, 2], [1, 3, 5, 4, 6, 2]],
                       [[1, 2, 3, 4], [4, 5, 3, 1, 2, 6]],
                       [[1, 4, 3, 2], [4, 3, 5, 1, 6, 2]],
                       [[1, 2, 3, 4], [1, 2, 6, 4, 5, 3]],
                       [[1, 4, 3, 2], [1, 6, 2, 4, 3, 5]],
                       [[1, 2, 3, 4], [4, 2, 6, 1, 5, 3]],
                       [[1, 4, 3, 2], [4, 6, 2, 1, 3, 5]],
                       [[1, 2, 3, 4], [1, 5, 6, 4, 2, 3]],
                       [[1, 4, 3, 2], [1, 6, 5, 4, 3, 2]],
                       [[1, 2, 3, 4], [4, 5, 6, 1, 2, 3]],
                       [[1, 4, 3, 2], [4, 6, 5, 1, 3, 2]]]]
     (narrows, arrow_types, Concs) = how_many_arrows(col)
     agroup = a_group(trans, rots)
     out = 792
     self.assertEqual(polya(Concs, agroup, arrowings=arrow_types), out)
 def test_pg(self):
     from phenum.grouptheory import a_group
     from phenum.phonons import how_many_arrows, how_many_arrows
     dim = 6
     col = [[-1, 1], [-1, 1], [-1, 1], [-1, 2], [-1, 2], [-1, 2], [-1, 2],
            [1, 1], [1, 1]]
     trans = [[
         j - 1 for j in i
     ] for i in [[1, 2, 3, 4, 5, 6, 7, 8, 9], [3, 1, 2, 6, 4, 5, 9, 7, 8],
                 [2, 3, 1, 5, 6, 4, 8, 9, 7], [7, 8, 9, 1, 2, 3, 4, 5, 6],
                 [9, 7, 8, 3, 1, 2, 6, 4, 5], [8, 9, 7, 2, 3, 1, 5, 6, 4],
                 [4, 5, 6, 7, 8, 9, 1, 2, 3], [6, 4, 5, 9, 7, 8, 3, 1, 2],
                 [5, 6, 4, 8, 9, 7, 2, 3, 1]]]
     rots = [[[j - 1 for j in i] for i in t]
             for t in [[[1, 2, 3, 4, 5, 6, 7, 8, 9], [1, 2, 3, 4, 5, 6]],
                       [[3, 6, 9, 2, 5, 8, 1, 4, 7], [3, 4, 2, 1, 5, 6]],
                       [[9, 8, 7, 6, 5, 4, 3, 2, 1], [2, 1, 4, 3, 5, 6]],
                       [[7, 4, 1, 8, 5, 2, 9, 6, 3], [4, 3, 1, 2, 5, 6]],
                       [[1, 4, 7, 2, 5, 8, 3, 6, 9], [3, 4, 1, 2, 6, 5]],
                       [[9, 6, 3, 8, 5, 2, 7, 4, 1], [4, 3, 2, 1, 6, 5]],
                       [[7, 8, 9, 4, 5, 6, 1, 2, 3], [1, 2, 4, 3, 6, 5]],
                       [[3, 2, 1, 6, 5, 4, 9, 8, 7], [2, 1, 3, 4, 6, 5]]]]
     (narrows, arrow_types, Concs) = how_many_arrows(col)
     agroup = a_group(trans, rots)
     out = 663
     self.assertEqual(polya(Concs, agroup, arrowings=arrow_types), out)
 def test_o10(self):
     from phenum.grouptheory import a_group
     from phenum.phonons import how_many_arrows, how_many_arrows
     dim = 4
     col = [[-1, 1], [-1, 1], [-1, 1], [-1, 1], [-1, 1], [-1, 2], [-1, 2],
            [-1, 2], [-1, 2], [-1, 2], [3, 3], [3, 4]]
     trans = [[j - 1 for j in i]
              for i in [[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
                        [2, 1, 4, 3, 6, 5, 8, 7, 10, 9, 12, 11],
                        [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2],
                        [4, 3, 6, 5, 8, 7, 10, 9, 12, 11, 2, 1],
                        [5, 6, 7, 8, 9, 10, 11, 12, 1, 2, 3, 4],
                        [6, 5, 8, 7, 10, 9, 12, 11, 2, 1, 4, 3],
                        [7, 8, 9, 10, 11, 12, 1, 2, 3, 4, 5, 6],
                        [8, 7, 10, 9, 12, 11, 2, 1, 4, 3, 6, 5],
                        [9, 10, 11, 12, 1, 2, 3, 4, 5, 6, 7, 8],
                        [10, 9, 12, 11, 2, 1, 4, 3, 6, 5, 8, 7],
                        [11, 12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
                        [12, 11, 2, 1, 4, 3, 6, 5, 8, 7, 10, 9]]]
     rots = [[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], [0, 1, 2, 3]],
             [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], [2, 1, 0, 3]],
             [[0, 1, 10, 11, 8, 9, 6, 7, 4, 5, 2, 3], [0, 3, 2, 1]],
             [[0, 1, 10, 11, 8, 9, 6, 7, 4, 5, 2, 3], [2, 3, 0, 1]]]
     (narrows, arrow_types, Concs) = how_many_arrows(col)
     agroup = a_group(trans, rots)
     out = 13896
     self.assertEqual(polya(Concs, agroup, arrowings=arrow_types), out)
 def test_o22(self):
     from phenum.grouptheory import a_group
     from phenum.phonons import how_many_arrows, how_many_arrows
     dim = 4
     col = [[-1, 1], [-1, 1], [-1, 1], [-1, 2], [-1, 2], [-1, 2], [3, 3],
            [3, 4], [3, 4]]
     trans = [[
         j - 1 for j in i
     ] for i in [[1, 2, 3, 4, 5, 6, 7, 8, 9], [2, 3, 1, 5, 6, 4, 8, 9, 7],
                 [3, 1, 2, 6, 4, 5, 9, 7, 8], [4, 5, 6, 7, 8, 9, 1, 2, 3],
                 [5, 6, 4, 8, 9, 7, 2, 3, 1], [6, 4, 5, 9, 7, 8, 3, 1, 2],
                 [7, 8, 9, 1, 2, 3, 4, 5, 6], [8, 9, 7, 2, 3, 1, 5, 6, 4],
                 [9, 7, 8, 3, 1, 2, 6, 4, 5]]]
     rots = [[[0, 1, 2, 3, 4, 5, 6, 7, 8], [0, 1, 2, 3]],
             [[0, 1, 2, 8, 6, 7, 4, 5, 3], [2, 1, 0, 3]],
             [[0, 2, 1, 4, 3, 5, 8, 7, 6], [0, 3, 2, 1]],
             [[0, 2, 1, 6, 8, 7, 3, 5, 4], [2, 3, 0, 1]],
             [[0, 7, 5, 6, 4, 2, 3, 1, 8], [1, 0, 3, 2]],
             [[0, 7, 5, 8, 3, 1, 4, 2, 6], [3, 0, 1, 2]],
             [[0, 5, 7, 4, 6, 2, 8, 1, 3], [1, 2, 3, 0]],
             [[0, 5, 7, 3, 8, 1, 6, 2, 4], [3, 2, 1, 0]]]
     (narrows, arrow_types, Concs) = how_many_arrows(col)
     agroup = a_group(trans, rots)
     out = 4504
     self.assertEqual(polya(Concs, agroup, arrowings=arrow_types), out)
Esempio n. 5
0
 def test_3e_1(self):
     from phenum.grouptheory import a_group
     from phenum.phonons import how_many_arrows, how_many_arrows
     dim = 6
     col = [[-1, 1], [-1, 2], [1, 3], [1, 3], [1, 4], [1, 4]]
     trans = [[j-1 for j in i] for i in [[1, 2, 3, 4, 5, 6], [2, 3, 4, 5, 6, 1], [3, 4, 5, 6, 1, 2], [4, 5, 6, 1, 2, 3], [5, 6, 1, 2, 3, 4], [6, 1, 2, 3, 4, 5]]]
     rots = [[[j-1 for j in i] for i in t] for t in [[[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 5, 6]], [[1, 2, 3, 4, 5, 6], [4, 2, 3, 1, 5, 6]], [[1, 2, 3, 4, 5, 6], [1, 5, 3, 4, 2, 6]], [[1, 2, 3, 4, 5, 6], [4, 5, 3, 1, 2, 6]], [[1, 6, 5, 4, 3, 2], [1, 2, 6, 4, 5, 3]], [[1, 6, 5, 4, 3, 2], [4, 2, 6, 1, 5, 3]], [[1, 6, 5, 4, 3, 2], [1, 5, 6, 4, 2, 3]], [[1, 6, 5, 4, 3, 2], [4, 5, 6, 1, 2, 3]]]]
     (narrows,arrow_types,Concs) = how_many_arrows(col)
     agroup = a_group(trans,rots)
     out = 6876
     self.assertEqual(polya(Concs,agroup,arrowings=arrow_types),out)
Esempio n. 6
0
 def test_p1(self):
     from phenum.grouptheory import a_group
     from phenum.phonons import how_many_arrows, how_many_arrows
     dim = 4
     col = [[-1,1],[-1,2],[0,3],[0,4]]
     trans = [[0,1,2,3],[1,0,3,2],[2,3,0,1],[3,2,1,0]]
     rots = [[[0,1,2,3],[0,1,2,3]],[[0,1,2,3],[2,1,0,3]],[[0,1,2,3],[0,3,2,1]],[[0,1,2,3],[2,3,0,1]],[[0,3,2,1],[1,0,3,2]],[[0,3,2,1],[3,0,1,2]],[[0,3,2,1],[1,2,3,0]],[[0,3,2,1],[3,2,1,0]]]
     (narrows,arrow_types,Concs) = how_many_arrows(col)
     agroup = a_group(trans,rots)
     out = 18
     self.assertEqual(polya(Concs,agroup,arrowings=arrow_types),out)
Esempio n. 7
0
 def test_p2(self):
     from phenum.grouptheory import a_group
     from phenum.phonons import how_many_arrows, how_many_arrows
     dim = 4
     col = [[-3,1],[-3,1],[-3,1],[-3,2],[3,3],[3,3],[3,3],[3,4]]
     trans = [[0,1,2,3,4,5,6,7],[1,0,3,2,5,4,7,6],[2,3,4,5,6,7,0,1],[3,2,5,4,7,6,1,0],[4,5,6,7,0,1,2,3],[5,4,7,6,1,0,3,2],[6,7,0,1,2,3,4,5],[7,6,1,0,3,2,5,4]]
     rots = [[[0,1,2,3,4,5,6,7],[0,1,2,3]],[[0,1,2,3,4,5,6,7],[2,1,0,3]],[[0,1,6,7,4,5,2,3],[0,3,2,1]],[[0,1,6,7,4,5,2,3],[2,3,0,1]]]
     (narrows,arrow_types,Concs) = how_many_arrows(col)
     agroup = a_group(trans,rots)
     out = 9568
     self.assertEqual(polya(Concs,agroup,arrowings=arrow_types),out)
Esempio n. 8
0
 def test_o21(self):
     from phenum.grouptheory import a_group
     from phenum.phonons import how_many_arrows, how_many_arrows
     dim = 4
     col = [[-1,1],[-1,1],[-1,2],[-1,2],[-1,2],[3,3],[3,4],[3,4]]
     trans =[[j - 1 for j in i] for i in[[1, 2, 3, 4, 5, 6, 7, 8], [2, 1, 4, 3, 6, 5, 8, 7], [3, 4, 5, 6, 7, 8, 1, 2], [4, 3, 6, 5, 8, 7, 2, 1], [5, 6, 7, 8, 1, 2, 3, 4], [6, 5, 8, 7, 2, 1, 4, 3], [7, 8, 1, 2, 3, 4, 5, 6], [8, 7, 2, 1, 4, 3, 6, 5]]]
     rots = [[[0,1,2,3,4,5,6,7],[0,1,2,3]],[[0,1,2,3,4,5,6,7],[2,1,0,3]],[[0,1,6,7,4,5,2,3],[0,3,2,1]],[[0,1,6,7,4,5,2,3],[2,3,0,1]]]
     (narrows,arrow_types,Concs) = how_many_arrows(col)
     agroup = a_group(trans,rots)
     out = 3808
     self.assertEqual(polya(Concs,agroup,arrowings=arrow_types),out)
Esempio n. 9
0
 def test_pg(self):
     from phenum.grouptheory import a_group
     from phenum.phonons import how_many_arrows, how_many_arrows
     dim = 6
     col = [[-1,1],[-1,1],[-1,1],[-1,2],[-1,2],[-1,2],[-1,2],[1,1],[1,1]]
     trans = [[j - 1 for j in i] for i in [[1,2,3,4,5,6,7,8,9], [3,1,2,6,4,5,9,7,8], [2,3,1,5,6,4,8,9,7],[7,8,9,1,2,3,4,5,6], [9,7,8,3,1,2,6,4,5], [8,9,7,2,3,1,5,6,4], [4,5,6,7,8,9,1,2,3], [6,4,5,9,7,8,3,1,2], [5,6,4,8,9,7,2,3,1]]]
     rots = [[[j - 1 for j in i] for i in t] for t in [[[1,2,3,4,5,6,7,8,9],[1,2,3,4,5,6]], [[3,6,9,2,5,8,1,4,7],[3,4,2,1,5,6]], [[9,8,7,6,5,4,3,2,1],[2,1,4,3,5,6]], [[7,4,1,8,5,2,9,6,3],[4,3,1,2,5,6]], [[1,4,7,2,5,8,3,6,9],[3,4,1,2,6,5]], [[9,6,3,8,5,2,7,4,1],[4,3,2,1,6,5]], [[7,8,9,4,5,6,1,2,3],[1,2,4,3,6,5]], [[3,2,1,6,5,4,9,8,7],[2,1,3,4,6,5]]]]
     (narrows,arrow_types,Concs) = how_many_arrows(col)
     agroup = a_group(trans,rots)
     out = 663
     self.assertEqual(polya(Concs,agroup,arrowings=arrow_types),out)
Esempio n. 10
0
 def test_toy_3(self):
     from phenum.grouptheory import a_group
     from phenum.phonons import how_many_arrows, how_many_arrows
     col = [[-1,1],[1,2]]
     trans = [[0,1],[1,0]]
     rots = [[[0,1],[0,1,2,3,4,5]],[[1,0],[2,3,0,1,5,4]],[[1,0],[2,1,0,3,5,4]],
             [[0,1],[0,3,2,1,5,4]],[[0,1],[0,4,2,5,3,1]],[[0,1],[0,5,2,4,1,3]]]
     dim = 6
     (narrows,arrow_types,Concs) = how_many_arrows(col)
     agroup = a_group(trans,rots)
     out = 2
     self.assertEqual(polya(Concs,agroup,arrowings=arrow_types),out)
Esempio n. 11
0
 def test_p4(self):
     from phenum.grouptheory import a_group
     from phenum.phonons import how_many_arrows, how_many_arrows
     dim = 4
     col = [[-1, 3], [-1, 2], [-1, 3], [1, 1]]
     trans = [[0, 1, 2, 3], [1, 2, 3, 0], [2, 3, 0, 1], [3, 0, 1, 2]]
     rots = [[[0, 1, 2, 3], [0, 1, 2, 3]], [[0, 1, 2, 3], [2, 1, 0, 3]],
             [[0, 3, 2, 1], [0, 3, 2, 1]], [[0, 3, 2, 1], [2, 3, 0, 1]]]
     (narrows, arrow_types, Concs) = how_many_arrows(col)
     agroup = a_group(trans, rots)
     out = 5
     self.assertEqual(polya(Concs, agroup, arrowings=arrow_types), out)
Esempio n. 12
0
 def test_toy_1(self):
     from phenum.grouptheory import a_group
     from phenum.phonons import how_many_arrows, how_many_arrows
     col = [[-1, 1], [-1, 2]]
     trans = [[0, 1], [1, 0]]
     rots = [[[0, 1], [0, 1, 2, 3, 4, 5]], [[1, 0], [2, 3, 0, 1, 5, 4]],
             [[1, 0], [2, 1, 0, 3, 5, 4]], [[0, 1], [0, 3, 2, 1, 5, 4]]]
     dim = 6
     (narrows, arrow_types, Concs) = how_many_arrows(col)
     agroup = a_group(trans, rots)
     out = 1
     self.assertEqual(polya(Concs, agroup, arrowings=arrow_types), out)
Esempio n. 13
0
 def test_r1(self):
     from phenum.grouptheory import a_group
     from phenum.phonons import how_many_arrows, how_many_arrows
     dim = 4
     col = [[-1,1],[-1,2],[0,3],[0,4]]
     trans = [[0,1,2,3],[1,0,3,2],[2,3,0,1],[3,2,1,0]]
     rots = [[[0,1,2,3],[0,1,2,3]],[[0,1,2,3],[2,1,0,3]],[[0,1,2,3],[0,3,2,1]],[[0,1,2,3],[2,3,0,1]],[[0,3,2,1],[1,0,3,2]],[[0,3,2,1],[3,0,1,2]],[[0,3,2,1],[1,2,3,0]],[[0,3,2,1],[3,2,1,0]]]
     (narrows,arrow_types,Concs) = how_many_arrows(col)
     temp_agroup = a_group(trans,rots)
     agroup = []
     print("ta",temp_agroup)
     for i in temp_agroup:
         sites = [j+1 for j in i[0]]
         ars = [j+1 for j in i[1]]
         agroup.append([sites,ars])
     print("a",agroup)
     out = 18
     self.assertEqual(polya(Concs,agroup,arrowings=arrow_types),out)
Esempio n. 14
0
 def test_p2(self):
     from phenum.grouptheory import a_group
     from phenum.phonons import how_many_arrows, how_many_arrows
     dim = 4
     col = [[-3, 1], [-3, 1], [-3, 1], [-3, 2], [3, 3], [3, 3], [3, 3],
            [3, 4]]
     trans = [[0, 1, 2, 3, 4, 5, 6, 7], [1, 0, 3, 2, 5, 4, 7, 6],
              [2, 3, 4, 5, 6, 7, 0, 1], [3, 2, 5, 4, 7, 6, 1, 0],
              [4, 5, 6, 7, 0, 1, 2, 3], [5, 4, 7, 6, 1, 0, 3, 2],
              [6, 7, 0, 1, 2, 3, 4, 5], [7, 6, 1, 0, 3, 2, 5, 4]]
     rots = [[[0, 1, 2, 3, 4, 5, 6, 7], [0, 1, 2, 3]],
             [[0, 1, 2, 3, 4, 5, 6, 7], [2, 1, 0, 3]],
             [[0, 1, 6, 7, 4, 5, 2, 3], [0, 3, 2, 1]],
             [[0, 1, 6, 7, 4, 5, 2, 3], [2, 3, 0, 1]]]
     (narrows, arrow_types, Concs) = how_many_arrows(col)
     agroup = a_group(trans, rots)
     out = 9568
     self.assertEqual(polya(Concs, agroup, arrowings=arrow_types), out)
Esempio n. 15
0
    def test_r2(self):
        from phenum.grouptheory import a_group
        from phenum.phonons import how_many_arrows, how_many_arrows
        dim = 4
        col = [[-1,1],[-1,2],[0,3],[0,4]]
        trans = [[0,1,2,3],[1,0,3,2],[2,3,0,1],[3,2,1,0]]
        rots = [[[0,1,2,3],[0,1,2,3]],[[0,1,2,3],[2,1,0,3]],[[0,1,2,3],[0,3,2,1]],[[0,1,2,3],[2,3,0,1]],[[0,3,2,1],[1,0,3,2]],[[0,3,2,1],[3,0,1,2]],[[0,3,2,1],[1,2,3,0]],[[0,3,2,1],[3,2,1,0]]]
        (narrows,arrow_types,Concs) = how_many_arrows(col)
        Concs = [1]
        temp_agroup = a_group(trans,rots)
        agroup = []
        for i in temp_agroup:
            sites = [j+1 for j in i[0]]
            ars = [j+1 for j in i[1]]
            agroup.append([sites,ars])

        out = 18
        with pytest.raises(ValueError):
            polya(Concs,agroup,arrowings=arrow_types)
Esempio n. 16
0
 def test_r1(self):
     from phenum.grouptheory import a_group
     from phenum.phonons import how_many_arrows, how_many_arrows
     dim = 4
     col = [[-1, 1], [-1, 2], [0, 3], [0, 4]]
     trans = [[0, 1, 2, 3], [1, 0, 3, 2], [2, 3, 0, 1], [3, 2, 1, 0]]
     rots = [[[0, 1, 2, 3], [0, 1, 2, 3]], [[0, 1, 2, 3], [2, 1, 0, 3]],
             [[0, 1, 2, 3], [0, 3, 2, 1]], [[0, 1, 2, 3], [2, 3, 0, 1]],
             [[0, 3, 2, 1], [1, 0, 3, 2]], [[0, 3, 2, 1], [3, 0, 1, 2]],
             [[0, 3, 2, 1], [1, 2, 3, 0]], [[0, 3, 2, 1], [3, 2, 1, 0]]]
     (narrows, arrow_types, Concs) = how_many_arrows(col)
     temp_agroup = a_group(trans, rots)
     agroup = []
     print("ta", temp_agroup)
     for i in temp_agroup:
         sites = [j + 1 for j in i[0]]
         ars = [j + 1 for j in i[1]]
         agroup.append([sites, ars])
     print("a", agroup)
     out = 18
     self.assertEqual(polya(Concs, agroup, arrowings=arrow_types), out)
Esempio n. 17
0
    def test_r2(self):
        from phenum.grouptheory import a_group
        from phenum.phonons import how_many_arrows, how_many_arrows
        dim = 4
        col = [[-1, 1], [-1, 2], [0, 3], [0, 4]]
        trans = [[0, 1, 2, 3], [1, 0, 3, 2], [2, 3, 0, 1], [3, 2, 1, 0]]
        rots = [[[0, 1, 2, 3], [0, 1, 2, 3]], [[0, 1, 2, 3], [2, 1, 0, 3]],
                [[0, 1, 2, 3], [0, 3, 2, 1]], [[0, 1, 2, 3], [2, 3, 0, 1]],
                [[0, 3, 2, 1], [1, 0, 3, 2]], [[0, 3, 2, 1], [3, 0, 1, 2]],
                [[0, 3, 2, 1], [1, 2, 3, 0]], [[0, 3, 2, 1], [3, 2, 1, 0]]]
        (narrows, arrow_types, Concs) = how_many_arrows(col)
        Concs = [1]
        temp_agroup = a_group(trans, rots)
        agroup = []
        for i in temp_agroup:
            sites = [j + 1 for j in i[0]]
            ars = [j + 1 for j in i[1]]
            agroup.append([sites, ars])

        out = 18
        with pytest.raises(ValueError):
            polya(Concs, agroup, arrowings=arrow_types)