-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlink.py
More file actions
47 lines (40 loc) · 1.33 KB
/
link.py
File metadata and controls
47 lines (40 loc) · 1.33 KB
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
#!/usr/bin/python3
import numpy as np
from numpy import tile
from scipy import linalg as LA
import math,cmath
pi = math.pi
cos = math.cos
sin = math.sin
exp=np.exp
sqrt = math.sqrt
log=np.log
def link(Nk, Nth, no_of_band_filled, evec):
no_of_bonds=no_of_band_filled
U1=np.zeros((2*Nth+1,2*Nk+1),dtype=complex)
U2=np.zeros((2*Nth+1,2*Nk+1),dtype=complex)
g1=np.zeros((no_of_bonds,no_of_bonds),dtype=complex)
g2=np.zeros((no_of_bonds,no_of_bonds),dtype=complex)
for nth in range(2*Nth+1):
for nky in range(2*Nk+1):
if (nth < 2*Nth):
nthh=nth+1
else:
nthh=1
for bond1 in range(no_of_bonds):
for bond2 in range(no_of_bonds):
g1[bond1,bond2]=np.dot(evec[nth, nky,:,bond1],evec[nthh, nky,:,bond2])
S1=np.linalg.det(g1)
U1[nth,nky]=S1/abs(S1)
for nth in range(2*Nth+1):
for nky in range(2*Nk+1):
if (nky < 2*Nk):
nkyy=nky+1
else:
nkyy=1
for bond1 in range(no_of_bonds):
for bond2 in range(no_of_bonds):
g2[bond1,bond2]=np.dot(evec[nth, nky,:,bond1],evec[nth, nkyy,:,bond2])
S2=np.linalg.det(g2)
U2[nth,nky]=S2/abs(S2)
return U1, U2