-
Notifications
You must be signed in to change notification settings - Fork 1
/
example_cg
executable file
·109 lines (99 loc) · 3.11 KB
/
example_cg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/usr/bin/python
import os
import numpy as np
import itertools as it
import group
def main():
prefs = [[0.,0.,0.], [0.,0.,1.], [1.,1.,0.], [1.,1.,1.], [0.,0.,2.],[0.,1.,2.],[1.,1.,2.]]
#prefs = np.asarray(prefs)
p2max = len(prefs)
groups = []
# initialize groups
S = 1./np.sqrt(2.)
#U3 = np.asarray([[S,0,S],[0,1,0],[S,0,-S]])
U3 = np.asarray([[0,0,-1.],[1.j,0,0],[0,1,0]])
U2 = np.asarray([[S,S],[1.j*S,-1.j*S]])
path = os.path.normpath(os.path.join(os.getcwd(), "groups/"))
groups = group.init_groups(prefs=prefs, p2max=p2max, U2=U2, U3=U3,
path=path)
# calc coefficients
print(" CMF ".center(40, "="))
irnames = groups[0].irrepsname
for p in range(p2max):
print(" %d x %d -> 0 ".center(40, "+") % (p, p))
try:
cgs = group.TOhCG(0, p, p, groups)
#cgs = group.TOhCG(0, p, p, groups, ir1="A2g", ir2="T2g")
#print("display")
#cgs.display()
print("operators")
cgs.print_operators()
#print("latex")
#cgs.to_latex()
#print("pandas")
#cgs.to_pandas()
except RuntimeError:
continue
print(" MF1 ".center(40, "="))
irnames = groups[1].irrepsname
for i, j in it.product(range(p2max), repeat=2):
if i == 0 or j == 0:
empty = 3
else:
empty = 4
try:
cgs = group.TOhCG(1, i, j, groups)
if cgs is None:
continue
print(" %d x %d -> 1 ".center(40, "+") % (i, j))
#print("display")
#cgs.display(emptyline=empty)
print("operators")
cgs.print_operators()
#print("latex")
#cgs.to_latex()
#print("pandas")
#cgs.to_pandas()
except RuntimeError:
continue
print(" MF2 ".center(40, "="))
irnames = groups[2].irrepsname
for i, j in it.product(range(p2max), repeat=2):
try:
cgs = group.TOhCG(2, i, j, groups)
if cgs is None:
continue
print(" %d x %d -> 2 ".center(40, "+") % (i, j))
#print("display")
#cgs.display(emptyline=empty)
print("operators")
cgs.print_operators()
#print("latex")
#cgs.to_latex()
#print("pandas")
#cgs.to_pandas()
except RuntimeError:
continue
print(" MF3 ".center(40, "="))
irnames = groups[3].irrepsname
for i, j in it.product(range(p2max), repeat=2):
try:
cgs = group.TOhCG(3, i, j, groups)
if cgs is None:
continue
print(" %d x %d -> 3 ".center(40, "+") % (i, j))
#print("display")
#cgs.display(emptyline=empty)
print("operators")
cgs.print_operators()
#print("latex")
#cgs.to_latex()
#print("pandas")
#cgs.to_pandas()
except RuntimeError:
continue
if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
pass