-
Notifications
You must be signed in to change notification settings - Fork 6
/
electron_phonon.py
153 lines (152 loc) · 5.38 KB
/
electron_phonon.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
from environment import *
from gf_sparse import Lead, Coupling, System
import datetime
start_time = datetime.datetime.now()
#ele-phonon coupling
'''
N = 10
lam = 0.5
t = 1
t0 = 0.2
couplings = []
D = {'on_site': [], 'couple': []}
for i in range(N):
for j in range(2):
couplings.append(Coupling(Lead(matrix([i]), matrix([-t]), matrix([i])), i, matrix([-t0])))
D['on_site'].append(matrix([i]))
if i == 0:
continue
D['couple'].append(matrix([sqrt(i)*lam]))
T = []
E_range = linspace(-2, 2, 1000)
for E in E_range:
system = System(D, couplings, E, 1)
system.cal_diag_gf()
[system.cal_T(0, i) for i in [1, 3, 5, 7, 9, 11, 13, 15]]
T.append(sum(system.T[0, i] for i in [1, 3, 5, 7, 9, 11, 13, 15]))
plt.plot(E_range, T)
plt.show()
'''
#ele-phonon coupling, using matrix
'''
lam = 0.5
t = 1
t0 = 0.2
couplings = []
couplings.append(Coupling(Lead(matrix([0]), matrix([-t]), matrix([0])), 0, matrix([-t0])))
couplings.append(Coupling(Lead(matrix([0]), matrix([-t]), matrix([0])), 0, matrix([-t0])))
couplings.append(Coupling(Lead(matrix([[1, 0], [0, 2]]), matrix([[-t, 0], [0, -t]]), matrix([[1, 0], [0, 2]])), 1, matrix([[-t0, 0],[0,-t0]])))
couplings.append(Coupling(Lead(matrix([[1, 0], [0, 2]]), matrix([[-t, 0], [0, -t]]), matrix([[1, 0], [0, 2]])), 1, matrix([[-t0, 0],[0,-t0]])))
couplings.append(Coupling(Lead(matrix([[3, 0], [0, 4]]), matrix([[-t, 0], [0, -t]]), matrix([[3, 0], [0, 4]])), 2, matrix([[-t0, 0],[0,-t0]])))
couplings.append(Coupling(Lead(matrix([[3, 0], [0, 4]]), matrix([[-t, 0], [0, -t]]), matrix([[3, 0], [0, 4]])), 2, matrix([[-t0, 0],[0,-t0]])))
couplings.append(Coupling(Lead(matrix([[5, 0], [0, 6]]), matrix([[-t, 0], [0, -t]]), matrix([[5, 0], [0, 6]])), 3, matrix([[-t0, 0],[0,-t0]])))
couplings.append(Coupling(Lead(matrix([[5, 0], [0, 6]]), matrix([[-t, 0], [0, -t]]), matrix([[5, 0], [0, 6]])), 3, matrix([[-t0, 0],[0,-t0]])))
couplings.append(Coupling(Lead(matrix([7]), matrix([-t]), matrix([7])), 4, matrix([-t0])))
couplings.append(Coupling(Lead(matrix([7]), matrix([-t]), matrix([7])), 4, matrix([-t0])))
D = {'on_site': [matrix([0]), matrix([[1, sqrt(2)*lam], [sqrt(2)*lam, 2]]), matrix([[3, 2*lam], [2*lam, 4]]), matrix([[5, sqrt(6)*lam], [sqrt(6)*lam, 6]]), matrix([7])],
'couple': [matrix([[lam, 0]]), matrix([[0, 0], [sqrt(3)*lam, 0]]), matrix([[0, 0], [sqrt(5)*lam, 0]]), matrix([[sqrt(7)*lam], [0]])]}
T = []
E_range = linspace(-2, 2, 500)
for E in E_range:
system = System(D, couplings, E, 1)
system.cal_diag_gf()
system.cal_T(0, 1)
system.cal_T(0, 3)
system.cal_T(0, 5)
system.cal_T(0, 7)
system.cal_T(0, 9)
T.append(system.T[0, 1]+system.T[0, 3]+system.T[0, 5]+system.T[0, 7]+system.T[0, 9])
plt.plot(E_range, T, 'o-')
plt.show()
'''
#weak coupling blockade
'''
N = 1
t = 1.0
t0 = 0.5
couplings = []
D = {'on_site': [], 'couple': []}
couplings.append(Coupling(Lead(matrix([0.]), matrix([-t]), matrix([0.])), 0, matrix([-t])))
couplings.append(Coupling(Lead(matrix([0.]), matrix([-t]), matrix([0.])), 4, matrix([-t])))
D['on_site'].append(matrix([0.]))
D['on_site'].append(matrix([0.]))
D['on_site'].append(matrix([1]))
D['on_site'].append(matrix([0.]))
D['on_site'].append(matrix([0.]))
D['couple'].append(matrix([-t]))
D['couple'].append(matrix([-t0]))
D['couple'].append(matrix([-t0]))
D['couple'].append(matrix([-t]))
T = []
E_range = linspace(0.5, 1.5, 1000)
for E in E_range:
system = System(D, couplings, E, 1., 0.000000000000000001, 0.000000000000000001)
system.cal_diag_gf()
system.cal_T(0, 1)
T.append(system.T[0, 1])
plt.plot(E_range, T, 'o-')
plt.show()
'''
#weak coupling pedestrian one line
'''
t = 1
t0 = 0.2
couplings = []
D = {'on_site': [], 'couple': []}
couplings.append(Coupling(Lead(matrix([0]), matrix([-t]), matrix([0])), 0, matrix([-t])))
couplings.append(Coupling(Lead(matrix([0]), matrix([-t]), matrix([0])), 4, matrix([-t])))
D['on_site'].append(matrix([0]))
D['on_site'].append(matrix([0]))
D['on_site'].append(matrix([[0, -t0], [-t0, 0]]))
D['on_site'].append(matrix([0]))
D['on_site'].append(matrix([0]))
D['couple'].append(matrix([-t]))
D['couple'].append(matrix([[-t, 0]]))
D['couple'].append(matrix([[-t], [0]]))
D['couple'].append(matrix([-t]))
T = []
E_range = linspace(-2, 1.99, 1000)
for E in E_range:
system = System(D, couplings, E, 1)
system.cal_diag_gf()
system.cal_T(0, 1)
T.append(system.T[0, 1])
plt.plot(E_range, T, 'o-')
plt.show()
'''
# weak coupling pedestrian several dangling atoms and several line
N = 2
M = 100
t = 1
t0 = 0.2
couplings = []
D_couple_lead = matrix(zeros((N, N)))
for i in range(N-1):
D_couple_lead[i+1,i]= -t
D_couple_lead[i,i+1]= -t
D_couple = matrix(zeros((N+M, N)))
for i in range(N):
D_couple[i+M,i] = -t
D_on_site = matrix(zeros((N+M, N+M)))
for i in range(N+M-1):
if i == M-1:
D_on_site[i+1, i] = -t0
D_on_site[i, i+1] = -t0
else:
D_on_site[i+1, i] = -t
D_on_site[i, i+1] = -t
D = {'on_site': [D_on_site], 'couple': []}
coupling1 = Coupling(Lead(D_couple_lead, matrix(eye(N))*-t, D_couple_lead), 0, D_couple)
coupling2 = Coupling(Lead(D_couple_lead, matrix(eye(N))*-t, D_couple_lead), 0, D_couple)
couplings.append(coupling1)
couplings.append(coupling2)
T = []
E_range = linspace(-2, 2, 1000)
for E in E_range:
system = System(D, couplings, E, 1)
system.cal_diag_gf()
system.cal_T(0, 1)
T.append(system.T[0, 1])
plt.plot(E_range, T, 'o-')
print((datetime.datetime.now() - start_time).total_seconds())
#plt.show()