-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlead.py
163 lines (129 loc) · 4.85 KB
/
lead.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
152
153
154
155
156
157
158
159
160
161
162
163
from calc import *
from units import *
class wideband:
def __init__(self,contact,factor=1.0/eV):
self.contact = contact
s = contact.shape
assert(s[0] == s[1])
N = s[0]
self._Gs = matrix(eye(N))*1.0j*factor
self._Sigma_L = self.contact.H * self._Gs * self.contact
self._Sigma_R = self.contact * self._Gs * self.contact.H
def Gs_L(self,energy=None,bfield=None):
return self._Gs
def Gs_R(self,energy=None,bfield=None):
return self._Gs
def Sigma_L(self,energy=None,bfield=None):
return self._Sigma_L
def Sigma_R(self,energy=None,bfield=None):
return self._Sigma_R
def set_energy(self, energy):
pass
def set_bfield(self, bfield):
pass
class nondiag_wideband_L:
def __init__(self,contact00,contact01,contact10,SDOS=1.0/eV):
assert len(contact00) == len(contact01)+1
assert len(contact00) == len(contact10)+1
self._Gs = []
for n in range(len(contact00)):
N = contact00[n].shape[0]
self._Gs.append(matrix(eye(N))*1.0j*SDOS)
self._Sigma_L_00 = []
for n in range(len(contact00)):
self._Sigma_L_00.append(contact00[n].H*self._Gs[n]*contact00[n])
for n in range(1,len(contact00)):
self._Sigma_L_00[n] += contact01[n-1].H*self._Gs[n-1]*contact01[n-1]
for n in range(len(contact00)-1):
self._Sigma_L_00[n] += contact10[n].H*self._Gs[n+1]*contact10[n]
self._Sigma_L_01 = []
for n in range(len(contact00)-1):
self._Sigma_L_01.append(
contact00[n].H*self._Gs[n]*contact01[n]
+ contact10[n].H*self._Gs[n+1]*contact00[n+1]
)
self._Sigma_L_10 = []
for n in range(len(contact00)-1):
self._Sigma_L_10.append(
contact01[n].H*self._Gs[n]*contact00[n]
+ contact00[n+1].H*self._Gs[n+1]*contact10[n]
)
def Gs_L(self,energy=None,bfield=None):
return self._Gs
def Sigma_L_diag(self,energy=None,bfield=None):
return self._Sigma_L_00
def Sigma_L_offdiag(self,energy=None,bfield=None):
return (self._Sigma_L_01,self._Sigma_L_10)
def set_energy(self, energy):
pass
def set_bfield(self, bfield):
pass
class nondiag_wideband_R:
def __init__(self,contact00,contact01,contact10,SDOS=1.0/eV):
assert len(contact00) == len(contact01)+1
assert len(contact00) == len(contact10)+1
self._Gs = []
for n in range(len(contact00)):
N = contact00[n].shape[1]
self._Gs.append(matrix(eye(N))*1.0j*SDOS)
self._Sigma_R_00 = []
for n in range(len(contact00)):
self._Sigma_R_00.append(contact00[n]*self._Gs[n]*contact00[n].H)
for n in range(1,len(contact00)):
self._Sigma_R_00[n] += contact10[n-1]*self._Gs[n-1]*contact10[n-1].H
for n in range(len(contact00)-1):
self._Sigma_R_00[n] += contact01[n]*self._Gs[n+1]*contact01[n].H
self._Sigma_R_01 = []
for n in range(len(contact00)-1):
self._Sigma_R_01.append(
contact00[n]*self._Gs[n]*contact10[n].H
+ contact01[n]*self._Gs[n+1]*contact00[n+1].H
)
self._Sigma_R_10 = []
for n in range(len(contact00)-1):
self._Sigma_R_10.append(
contact10[n]*self._Gs[n]*contact00[n].H
+ contact00[n+1]*self._Gs[n+1]*contact01[n].H
)
def Gs_R(self,energy=None,bfield=None):
return self._Gs
def Sigma_R_diag(self,energy=None,bfield=None):
return self._Sigma_R_00
def Sigma_R_offdiag(self,energy=None,bfield=None):
return (self._Sigma_R_01,self._Sigma_R_10)
def set_energy(self, energy):
pass
def set_bfield(self, bfield):
pass
class lopez_sancho:
def __init__(self,chain,tunneling = 1.0,stoner_shift = 0.0*eV):
self.chain = chain
self.tunneling = tunneling
self.stoner_shift = stoner_shift
self.energy = None
def Gs_L(self,energy=None):
if energy is not None:
set_energy(energy)
return self.chain.Gs_L(self.energy-self.stoner_shift)
def Gs_R(self,energy=None):
if energy is not None:
set_energy(energy)
return self.chain.Gs_R(self.energy-self.stoner_shift)
def Sigma_L(self,energy=None):
return (
self.chain.H[1].H
* self.Gs_L(energy)
* self.chain.H[1]
* self.tunneling**2
)
def Sigma_R(self,energy=None):
return (
self.chain.H[1]
* self.Gs_R(energy)
* self.chain.H[1].H
* self.tunneling**2
)
def set_energy(self, energy):
self.energy = energy
def set_bfield(self, bfield):
self.chain.set_bfield(bfield)