-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhamiltonian.py
158 lines (100 loc) · 4.21 KB
/
hamiltonian.py
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
import numpy as np
class T2g_SpinOrbit_Model(object):
"""
A T2g_SpinOrbit_Model produces the diagonal and off diagonal blocks of a Hamiltonian
corresponding to electrons hopping on a 3D lattice, in the dxz, dyz and dxy orbitals
with spin orbit coupling includded.
"""
def __init__(self, spin_orbit, theta, phi, mu, delta, t2):
"""
Construct a new T2g_SpinOrbit_Model instance.
Required arguments:
- spin_orbit: The strength of spin orbit coupling
- theta: the polar angle of the magnetic field
- phi: the azimuthal angle of the magnetic field
- mu: the chemical potential
- delta: the value of the broadening
- t2: the second neighbor hopping
"""
#Initialize the external parameters
self.spin_orbit = spin_orbit
self.theta = theta
self.phi = phi
self.mu = mu
self.broadening = delta
self.t2 = t2
#Initialize the bfield to 1 - the solver will update this
#passed for now
#Initialize the ky and kz values (not going to be used for now)
self.kz = 0.0
self.ky = 0.0
#The size of a block
self.dim = 6
def get_dim(self):
return self.dim
def diagonal_block(self, xpos, bfield):
"""
returns a diagonal block of the Hamiltonian, given the current position
Inputs - the x position (integer)
Outputs - a numpy array of size (self.dim x self.dim) which is a diagonal
block of the Hamiltonian
"""
#TODO: figure out logic and exact nature of this this term
block = np.zeros((self.dim, self.dim),dtype = np.complex128)
block[0,0] = 2.0*np.cos(2.0*np.pi*bfield*xpos*np.cos(self.theta) - self.ky) \
+ 2.0*np.cos(2.0*np.pi*bfield*xpos*np.sin(self.theta) - self.kz) \
+ self.mu + self.broadening*1j
block[3,3] = block[0,0]
block[1,1] = 2.0*self.t2*np.cos(2.0*np.pi*bfield*xpos*np.cos(self.theta) - self.ky) \
+2.0*np.cos(2.0*np.pi*bfield*xpos*np.sin(self.theta) - self.kz) \
+ self.mu + self.broadening*1j
block[4,4] = block[1,1]
block[2,2] = 2.0*np.cos(2.0*np.pi*bfield*xpos*np.cos(self.theta) - self.ky) \
+2.0*self.t2*np.cos(2.0*np.pi*bfield*xpos*np.sin(self.theta) - self.kz) \
+ self.mu + self.broadening*1j
block[5,5] = block[2,2]
block[0,1] = self.spin_orbit*1j
block[1,0] = -1.0*block[0,1]
block[0,5] = -1.0*self.spin_orbit
block[5,0] = block[0,5]
block[1,5] = self.spin_orbit*1j
block[5,1] = -1.0*block[1,5]
block[2,3] = self.spin_orbit
block[3,2] = block[2,3]
block[2,4] = -1.0*self.spin_orbit*1j
block[4,2] = -1.0*block[2,4]
block[3,4] = -1.0*self.spin_orbit*1j
block[4,3] = -1.0*block[3,4]
return block
def right_offdiag_block(self, xpos, bfield):
"""
returns upper off diagonal block of the Hamiltonian, given the current position
Inputs - the x position (integer)
Outputs - a numpy array of size (self.dim X self.dim)
"""
#TODO: figure out what this term looks like
block = np.zeros((self.dim, self.dim),dtype = np.complex128)
block[0,0] = self.t2
block[3,3] = self.t2
block[1,1] = 1.0
block[4,4] = 1.0
block[2,2] = 1.0
block[5,5] = 1.0
return block
def left_offdiag_block(self, xpos, bfield):
"""
returns upper off diagonal block of the Hamiltonian, given the current position
Inputs - the x position (integer)
Outputs - a numpy array of size (self.dim X self.dim)
"""
#TODO: figure out what this term looks like
block = np.zeros((self.dim, self.dim),dtype = np.complex128)
block[0,0] = 1.0 + 0.0*1j
block[1,1] = 1.0 + 0.0*1j
block[0,0] = self.t2
block[3,3] = self.t2
block[1,1] = 1.0
block[4,4] = 1.0
block[2,2] = 1.0
block[5,5] = 1.0
return block