From 46ee2ec7ce995905cb621fb156a0e7998d3ced9e Mon Sep 17 00:00:00 2001 From: guanjihuan Date: Sat, 8 Jan 2022 17:46:01 +0800 Subject: [PATCH] update --- ...tance_calculation_using_Green_functions.py | 6 ++-- ...quantum_transport_in_multi_lead_systems.py | 33 ++++++++++--------- ...ansport_in_multi_lead_systems_with_guan.py | 9 ++--- ...nsport_in_multi_lead_systems_with_kwant.py | 7 ++-- 4 files changed, 30 insertions(+), 25 deletions(-) diff --git a/academic_codes/2019.11.01_conductance_calculation_using_Green_functions/conductance_calculation_using_Green_functions.py b/academic_codes/2019.11.01_conductance_calculation_using_Green_functions/conductance_calculation_using_Green_functions.py index 2e0f597..94aad57 100755 --- a/academic_codes/2019.11.01_conductance_calculation_using_Green_functions/conductance_calculation_using_Green_functions.py +++ b/academic_codes/2019.11.01_conductance_calculation_using_Green_functions/conductance_calculation_using_Green_functions.py @@ -91,9 +91,9 @@ def conductance(fermi_energy, h00, h01, nx=300): # 计算电导 else: green_nn_n = np.linalg.inv(fermi_energy*np.identity(dim)-h00-np.dot(np.dot(h01.transpose().conj(), green_nn_n), h01)-right_self_energy) green_0n_n = np.dot(np.dot(green_0n_n, h01), green_nn_n) - right_self_energy = (right_self_energy - right_self_energy.transpose().conj())*(0+1j) - left_self_energy = (left_self_energy - left_self_energy.transpose().conj())*(0+1j) - transmission = np.trace(np.dot(np.dot(np.dot(left_self_energy, green_0n_n), right_self_energy), green_0n_n.transpose().conj())) + gamma_right = (right_self_energy - right_self_energy.transpose().conj())*(0+1j) + gamma_left = (left_self_energy - left_self_energy.transpose().conj())*(0+1j) + transmission = np.trace(np.dot(np.dot(np.dot(gamma_left, green_0n_n), gamma_right), green_0n_n.transpose().conj())) return transmission # 返回电导值 diff --git a/academic_codes/2021.02.08_quantum_transport_in_multi_lead_systems/quantum_transport_in_multi_lead_systems.py b/academic_codes/2021.02.08_quantum_transport_in_multi_lead_systems/quantum_transport_in_multi_lead_systems.py index d347823..bfd941d 100755 --- a/academic_codes/2021.02.08_quantum_transport_in_multi_lead_systems/quantum_transport_in_multi_lead_systems.py +++ b/academic_codes/2021.02.08_quantum_transport_in_multi_lead_systems/quantum_transport_in_multi_lead_systems.py @@ -80,13 +80,14 @@ def main(): H_from_lead_4_to_center = np.zeros((width, width*length), dtype=complex) H_from_lead_5_to_center = np.zeros((width, width*length), dtype=complex) H_from_lead_6_to_center = np.zeros((width, width*length), dtype=complex) + move = 0 # the step of leads 2,3,6,5 moving to center for i0 in range(width): H_from_lead_1_to_center[i0, i0] = 1 - H_from_lead_2_to_center[i0, width*i0+(width-1)] = 1 - H_from_lead_3_to_center[i0, width*(length-1-i0)+(width-1)] = 1 + H_from_lead_2_to_center[i0, width*(move+i0)+(width-1)] = 1 + H_from_lead_3_to_center[i0, width*(length-move-1-i0)+(width-1)] = 1 H_from_lead_4_to_center[i0, width*(length-1)+i0] = 1 - H_from_lead_5_to_center[i0, width*(length-1-i0)+0] = 1 - H_from_lead_6_to_center[i0, width*i0+0] = 1 + H_from_lead_5_to_center[i0, width*(length-move-1-i0)+0] = 1 + H_from_lead_6_to_center[i0, width*(move+i0)+0] = 1 # 自能 self_energy_1 = np.dot(np.dot(H_from_lead_1_to_center.transpose().conj(), lead_1), H_from_lead_1_to_center) @@ -100,19 +101,19 @@ def main(): green = np.linalg.inv(fermi_energy*np.eye(width*length)-H_scattering_region-self_energy_1-self_energy_2-self_energy_3-self_energy_4-self_energy_5-self_energy_6) # Gamma矩阵 - self_energy_1 = 1j*(self_energy_1-self_energy_1.transpose().conj()) - self_energy_2 = 1j*(self_energy_2-self_energy_2.transpose().conj()) - self_energy_3 = 1j*(self_energy_3-self_energy_3.transpose().conj()) - self_energy_4 = 1j*(self_energy_4-self_energy_4.transpose().conj()) - self_energy_5 = 1j*(self_energy_5-self_energy_5.transpose().conj()) - self_energy_6 = 1j*(self_energy_6-self_energy_6.transpose().conj()) + gamma_1 = 1j*(self_energy_1-self_energy_1.transpose().conj()) + gamma_2 = 1j*(self_energy_2-self_energy_2.transpose().conj()) + gamma_3 = 1j*(self_energy_3-self_energy_3.transpose().conj()) + gamma_4 = 1j*(self_energy_4-self_energy_4.transpose().conj()) + gamma_5 = 1j*(self_energy_5-self_energy_5.transpose().conj()) + gamma_6 = 1j*(self_energy_6-self_energy_6.transpose().conj()) # Transmission - transmission_12 = np.trace(np.dot(np.dot(np.dot(self_energy_1, green), self_energy_2), green.transpose().conj())) - transmission_13 = np.trace(np.dot(np.dot(np.dot(self_energy_1, green), self_energy_3), green.transpose().conj())) - transmission_14 = np.trace(np.dot(np.dot(np.dot(self_energy_1, green), self_energy_4), green.transpose().conj())) - transmission_15 = np.trace(np.dot(np.dot(np.dot(self_energy_1, green), self_energy_5), green.transpose().conj())) - transmission_16 = np.trace(np.dot(np.dot(np.dot(self_energy_1, green), self_energy_6), green.transpose().conj())) + transmission_12 = np.trace(np.dot(np.dot(np.dot(gamma_1, green), gamma_2), green.transpose().conj())) + transmission_13 = np.trace(np.dot(np.dot(np.dot(gamma_1, green), gamma_3), green.transpose().conj())) + transmission_14 = np.trace(np.dot(np.dot(np.dot(gamma_1, green), gamma_4), green.transpose().conj())) + transmission_15 = np.trace(np.dot(np.dot(np.dot(gamma_1, green), gamma_5), green.transpose().conj())) + transmission_16 = np.trace(np.dot(np.dot(np.dot(gamma_1, green), gamma_6), green.transpose().conj())) transmission_12_array.append(np.real(transmission_12)) transmission_13_array.append(np.real(transmission_13)) @@ -176,4 +177,4 @@ def surface_green_function_lead(fermi_energy, h00, h01, dim): # 电极的表面 if __name__ == '__main__': - main() + main() \ No newline at end of file diff --git a/academic_codes/2021.02.08_quantum_transport_in_multi_lead_systems/quantum_transport_in_multi_lead_systems_with_guan.py b/academic_codes/2021.02.08_quantum_transport_in_multi_lead_systems/quantum_transport_in_multi_lead_systems_with_guan.py index fe4e23a..bdb52b3 100644 --- a/academic_codes/2021.02.08_quantum_transport_in_multi_lead_systems/quantum_transport_in_multi_lead_systems_with_guan.py +++ b/academic_codes/2021.02.08_quantum_transport_in_multi_lead_systems/quantum_transport_in_multi_lead_systems_with_guan.py @@ -67,13 +67,14 @@ def main(): h_lead4_to_center = np.zeros((width, width*length), dtype=complex) h_lead5_to_center = np.zeros((width, width*length), dtype=complex) h_lead6_to_center = np.zeros((width, width*length), dtype=complex) + move = 0 # the step of leads 2,3,6,5 moving to center for i0 in range(width): h_lead1_to_center[i0, i0] = 1 - h_lead2_to_center[i0, width*i0+(width-1)] = 1 - h_lead3_to_center[i0, width*(length-1-i0)+(width-1)] = 1 + h_lead2_to_center[i0, width*(move+i0)+(width-1)] = 1 + h_lead3_to_center[i0, width*(length-move-1-i0)+(width-1)] = 1 h_lead4_to_center[i0, width*(length-1)+i0] = 1 - h_lead5_to_center[i0, width*(length-1-i0)+0] = 1 - h_lead6_to_center[i0, width*i0+0] = 1 + h_lead5_to_center[i0, width*(length-move-1-i0)+0] = 1 + h_lead6_to_center[i0, width*(move+i0)+0] = 1 # 自能 self_energy1, gamma1 = guan.self_energy_of_lead_with_h_lead_to_center(fermi_energy, lead_h00, lead_h01, h_lead1_to_center) self_energy2, gamma2 = guan.self_energy_of_lead_with_h_lead_to_center(fermi_energy, lead_h00, lead_h01, h_lead2_to_center) diff --git a/academic_codes/2021.02.08_quantum_transport_in_multi_lead_systems/quantum_transport_in_multi_lead_systems_with_kwant.py b/academic_codes/2021.02.08_quantum_transport_in_multi_lead_systems/quantum_transport_in_multi_lead_systems_with_kwant.py index df48863..5e3d783 100644 --- a/academic_codes/2021.02.08_quantum_transport_in_multi_lead_systems/quantum_transport_in_multi_lead_systems_with_kwant.py +++ b/academic_codes/2021.02.08_quantum_transport_in_multi_lead_systems/quantum_transport_in_multi_lead_systems_with_kwant.py @@ -20,18 +20,21 @@ def make_system(): # lead2 lead3 # lead1(L) lead4(R) # lead6 lead5 + + move = 0 # the step of leads 2,3,6,5 moving to center + lead1 = kwant.Builder(kwant.TranslationalSymmetry((-a, 0))) lead1[(lat(0, j) for j in range(W))] = 0 lead1[lat.neighbors()] = -t syst.attach_lead(lead1) lead2 = kwant.Builder(kwant.TranslationalSymmetry((0, -a))) - lead2[(lat(j, 0) for j in range(W))] = 0 + lead2[(lat(move+j, 0) for j in range(W))] = 0 lead2[lat.neighbors()] = -t syst.attach_lead(lead2) lead3 = kwant.Builder(kwant.TranslationalSymmetry((0, -a))) - lead3[(lat(j+(L-W), 0) for j in range(W))] = 0 + lead3[(lat(j+(L-W-move), 0) for j in range(W))] = 0 lead3[lat.neighbors()] = -t syst.attach_lead(lead3)