forked from chjost/clebsch_gordan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example_cg_old
executable file
·50 lines (43 loc) · 1.15 KB
/
example_cg_old
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
#!/usr/bin/python
import numpy as np
import itertools as it
import group
def main():
p2max = 4
jmax = 3
groups = []
# initialize groups
for p2 in range(p2max):
g = group.OhGroup(p2=p2, instances=True)
groups.append(g)
# calc coefficients
print(" CMF ".center(40, "*"))
irnames = groups[0].lirreps
for p in range(p2max):
cgs = group.OhCG(0, p, p, groups)
for ir in irnames:
a, b, c = cgs.get_pion_cg(ir)
if b is not None:
print(ir)
group.display(b, c)
print(" MF1 ".center(40, "*"))
irnames = groups[1].lirreps
for i, j in it.product(range(p2max), repeat=2):
if j-i != 1:
continue
if i == 0 or j == 0:
empty = 3
else:
empty = 4
cgs = group.OhCG(1, i, j, groups)
print("%d x %d -> 1" % (i, j))
for ir in irnames:
a, b, c = cgs.get_pion_cg(ir)
if b is not None:
print(ir)
group.display(b, c, empty=empty)
if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
pass