-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgr_transport.py
280 lines (221 loc) · 6.73 KB
/
gr_transport.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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
# file: gr_transport.py
# to study transport in a graphene lattice. First I start
# with a dc tight-binding Hamiltonian and then I'll try to
# develop a code to study transport using Floquet
# Hamiltonian. Right now I don't have a clear idea if the
# trasport calculated using the Floquet Hamiltonian is
# related to any real physical interpretation.
# author: Amin Ahmdi
# date: March 15, 2018
############################################################
import numpy as np
import numpy.linalg as lg
########################################
### Functions ###
########################################
def make_Gr(mlat, J1=1, J2=1, J3=1):
""" Constructs the Hamiltonian and the connection
matrix of an armchair graphene strip
0--o 0--o
| | | |
o 0--o 0
| | | |
0--o 0--o
| | | |
o 0--o 0
| | | |
0--o 0--o
returns: unitcell hamiltonian h
hopping matrix tau
"""
NN = 2*mlat # # of sites in one super unitcell
tau = -np.zeros((NN, NN),dtype=complex)
h = np.zeros((NN,NN), dtype=complex)
# translational cell's Hamiltonian
for i in range(mlat-1):
if (i%2==0):
h[i,i+1] = J1
h[mlat+i,mlat+i+1] = J2
h[i,mlat+i] = J3 # horizoltal connection
elif (i%2==1):
h[i,i+1] = J2
h[mlat+i,mlat+i+1] = J1
h = h + h.conj().T # make it hermitian
# Hopping matrix
for i in range(1,mlat,2):
tau[i+mlat,i] = J3
return h, tau
##################################################
# def make_Gr(mlat):
# """ Constructs the Hamiltonian and the connection
# matrix of an armchair graphene strip. Lattice structure:
# 0--o 0--o
# | | | |
# o 0--o 0
# | | | |
# 0--o 0--o
# | | | |
# o 0--o 0
# | | | |
# 0--o 0--o
# input:
# ------
# mlat: integer, number of sites in width
# return:
# --------
# h: (Nd,Nd) complex matrix, hamiltonian
# tau: (Nd,Nd) complex matrix, hopping matrix between
# superlattice
# """
# Nd = 2*mlat # # of sites in one super unitcell
# tau = np.zeros((Nd, Nd),dtype=complex)
# h = np.zeros((Nd,Nd), dtype=complex)
# t = -1. # hopping amplitude
# # translational cell's Hamiltonian
# for i in range(mlat-1):
# h[i,i+1] = t
# h[mlat+i,mlat+i+1] = t
# if (i%2==0):
# h[i,mlat+i] = t # horizoltal connection
# h = h + h.conj().T # make it hermitian
# # Hopping matrix
# for i in range(1,mlat,2):
# tau[i+mlat,i] = t
# return h, tau
########################################
def make_sq(mlat):
""" Constructs the Hamiltonian and the connection
matrix of a square lattice. Lattice structure:
0--0--0--0
| | | |
0--0--0--0
| | | |
0--0--0--0
| | | |
0--0--0--0
| | | |
0--0--0--0
input:
------
mlat: integer, number of sites in width
return:
--------
h: (Nd,Nd) complex matrix, hamiltonian
tau: (Nd,Nd) complex matrix, hopping matrix between
superlattice
"""
Nd = mlat # # of sites in one super unitcell
tau = np.zeros((Nd, Nd),dtype=complex)
h = np.zeros((Nd,Nd), dtype=complex)
t = -1. # hopping amplitude
# translational cell's Hamiltonian
for i in range(mlat-1):
h[i,i+1] = t
h = h + h.conj().T # make it hermitian
# Hopping matrix
for i in range(0,mlat):
tau[i,i] = t
return h, tau
########################################
def g_lead_dec(Nd,E, tau, h):
""" Compute the lead's Green's function using decimation
method.
input:
------
Nd: integer, dimension of the Hamiltonian
E: float, energy
h: (Nd,Nd) complex matrix, hamiltonian
tau: (Nd,Nd) complex matrix, hopping matrix between
superlattice
return:
-------
gl: (Nd,Nd) complex matrix, lead's Green's function
"""
eta = 1.e-7j # infinitesimal imaginary for retarded G.Fs.
I = np.eye(Nd,dtype=complex)
ee = E + eta
# initialize alpha, beta, eps, eps_s
alpha = tau
beta = tau.conj().T
eps = h
eps_s = h
for i_dec in range(40):
aux = lg.inv(ee*I - eps)
aux1 = np.dot(alpha,np.dot(aux,beta))
eps_s = eps_s + aux1
eps = eps + aux1
aux1 = np.dot(beta, np.dot(aux, alpha))
eps = eps + aux1
alpha = np.dot(alpha,np.dot(aux, alpha))
beta = np.dot(beta, np.dot(aux, beta))
gl = lg.inv(ee*I - eps_s)
return gl
#######################################
########################################
### Main Program ###
########################################
NE = 200
eta = 1.e-7j
mlat = 9 # two rows to mimic spin stat
Nd = 2*mlat # number of sites in a SL
I = np.eye(Nd,dtype=complex)
h, tau = make_Gr(mlat)
tau_dg = tau.conj().T
gl = np.zeros((Nd,Nd), dtype=complex)
###########################
# calculate the conductance
con_arr = np.zeros((NE), float)
Ei = -1.5
Ef = 1.5
DE = (Ef-Ei)/NE
# loop over energy
for ie in range(NE):
ee = Ei + ie*DE
# The lead's Green's function
gl = g_lead_dec(Nd,ee, tau, h)
gr = g_lead_dec(Nd,ee, tau_dg, h)
# The self-energy due to the Left and right reservoirs
sigma_l = np.dot(tau, np.dot(gl,tau_dg))
sigma_l_dg = sigma_l.conj().T
sigma_r = np.dot(tau_dg, np.dot(gr,tau))
sigma_r_dg = sigma_r.conj().T
# Full Green's function
Gd = lg.inv(ee*I - h - sigma_r - sigma_l -eta)
Gd_dg = Gd.conj().T
gamma_r = -1j * ( sigma_r - sigma_r_dg)
gamma_l = -1j * ( sigma_l - sigma_l_dg)
# G * gamma_l * G_dg * gamma_r
auxg = np.dot(Gd,np.dot(gamma_l,np.dot(Gd_dg,gamma_r)))
gg = np.trace(auxg)
con_arr[ie] = gg.real
# Endof energy-loop
##########################
# # calculate the band structure
ki = -np.pi/2
kf = np.pi/2
Nk = 300
Dk = (kf-ki)/Nk
E_arr = np.zeros((Nk, Nd), float)
h, tau = make_Gr(mlat)
tau_dg = tau.conj().T
# loop over k
for ik in range(Nk):
ka = ki + ik*Dk
Hk = h + np.exp(1.j*ka)*tau + np.exp(-1.j*ka)*tau_dg
E_k = lg.eigvals(Hk)
E_arr[ik] = np.sort(E_k.real)
# Endof k-loop
########################################
### Plotting ###
########################################
import matplotlib.pyplot as pl
# conductance
E = np.linspace(Ei,Ef,NE)
pl.plot(E, con_arr)
###################
# bands
pl.figure()
k = np.linspace(ki,kf,Nk)
for i in range(Nd):
pl.plot(k,E_arr[:,i])
pl.show()