leads not properly attached in a one-dimensional system
Dear KWANT developers, I am a new user of KWANT, and is building my first one-dimensional toy system that consists of a 20-site central device and two 2-site leads. After constructing the two leads, I found that both are not properly attached to the central device by using the “attach_lead” function. First, the “kwant.plot” only shows one site for each lead. Second, the calculated conductance is always zero regardless of energy. Enclosed please find my simple kwant script. Any comments and suggestions are highly appreciated.. Thanks. Hanning Chen, Ph.D. Assistant Professor Department of Chemistry George Washington University Washington, DC 20052 http://www.chenlagbwu.net import kwant import matplotlib.pyplot as plt import scipy import numpy as np #build central device L = 20 a = 1 alpha = 0 beta = -1 device=kwant.Builder() lat_device = kwant.lattice.chain(a=a,name='20_site_1D_chain',norbs=1) device[(lat_device(i) for i in range(L))]=alpha for i in range(L): if i > 0: device[lat_device(i),lat_device(i-1)]=beta #build left electrode L_left = 2 alpha_left = 0 beta_left = -1 symmetry_left_lead = kwant.TranslationalSymmetry([-1]) left_lead = kwant.Builder(symmetry_left_lead) left_lead[(lat_device(i) for i in range(L_left))]=alpha_left for i in range(L_left): left_lead[lat_device(i),lat_device(i+1)]=beta_left #build right electrode L_right = 2 alpha_right = 0 beta_right = -1 symmetry_right_lead = kwant.TranslationalSymmetry([+1]) right_lead = kwant.Builder(symmetry_right_lead) right_lead[(lat_device(i) for i in range(L_right))]=alpha_right for i in range(L_right): right_lead[lat_device(i),lat_device(i+1)]=beta_right #attach the left electrode to the central device device.attach_lead(left_lead) #attach the right electrode to the central device device.attach_lead(right_lead) #plot the system kwant.plot(device) #finalize the whole system, which consists of left eletrode, device and right electrode device = device.finalized() #eigenvalues and eigevectors of device's Hamiltonian sparse_mat = device.hamiltonian_submatrix(sparse=False) print(np.matrix(sparse_mat)) evs = scipy.sparse.linalg.eigs(sparse_mat,10)[0] print(evs.real) #conductance calculation through transmission matrix energies = [] transmission = [] for ie in range(100): energy = ie * 0.01 smatrix = kwant.smatrix(device, energy) energies.append(energy) transmission.append(smatrix.transmission(1,0)) plt.figure() plt.plot(energies,transmission) plt.xlabel("energy") plt.ylabel("conductance") plt.show()
Dear Chen, Your program works fine. You just missed reading correctly the results: 1) For the leads, kwant plots by default 2 unit cells. If you want to change that, you can use the option 'num_lead_cells' kwant.plot(sys,num_lead_cells=6) for example. 2) The conductance you are getting is actually 1 as expected and not 0. (it is written 0.00 1e-12 +1). Change your potential to alpha=0.1 to see the difference. I hope this helps, Adel Regards On Tue, Apr 23, 2019 at 10:59 PM Hanning Chen <chenhanning@email.gwu.edu> wrote:
Dear KWANT developers,
I am a new user of KWANT, and is building my first one-dimensional toy system that consists of a 20-site central device and two 2-site leads.
After constructing the two leads, I found that both are not properly attached to the central device by using the “attach_lead” function.
First, the “kwant.plot” only shows one site for each lead. Second, the calculated conductance is always zero regardless of energy.
Enclosed please find my simple kwant script. Any comments and suggestions are highly appreciated..
Thanks.
Hanning Chen, Ph.D. Assistant Professor Department of Chemistry George Washington University Washington, DC 20052 http://www.chenlagbwu.net
import kwant import matplotlib.pyplot as plt import scipy import numpy as np
#build central device L = 20 a = 1 alpha = 0 beta = -1
device=kwant.Builder() lat_device = kwant.lattice.chain(a=a,name='20_site_1D_chain',norbs=1)
device[(lat_device(i) for i in range(L))]=alpha
for i in range(L): if i > 0: device[lat_device(i),lat_device(i-1)]=beta
#build left electrode L_left = 2 alpha_left = 0 beta_left = -1 symmetry_left_lead = kwant.TranslationalSymmetry([-1]) left_lead = kwant.Builder(symmetry_left_lead) left_lead[(lat_device(i) for i in range(L_left))]=alpha_left for i in range(L_left): left_lead[lat_device(i),lat_device(i+1)]=beta_left
#build right electrode L_right = 2 alpha_right = 0 beta_right = -1 symmetry_right_lead = kwant.TranslationalSymmetry([+1]) right_lead = kwant.Builder(symmetry_right_lead) right_lead[(lat_device(i) for i in range(L_right))]=alpha_right for i in range(L_right): right_lead[lat_device(i),lat_device(i+1)]=beta_right
#attach the left electrode to the central device device.attach_lead(left_lead) #attach the right electrode to the central device device.attach_lead(right_lead) #plot the system kwant.plot(device)
#finalize the whole system, which consists of left eletrode, device and right electrode device = device.finalized()
#eigenvalues and eigevectors of device's Hamiltonian sparse_mat = device.hamiltonian_submatrix(sparse=False) print(np.matrix(sparse_mat)) evs = scipy.sparse.linalg.eigs(sparse_mat,10)[0] print(evs.real)
#conductance calculation through transmission matrix energies = [] transmission = []
for ie in range(100): energy = ie * 0.01 smatrix = kwant.smatrix(device, energy) energies.append(energy) transmission.append(smatrix.transmission(1,0))
plt.figure() plt.plot(energies,transmission) plt.xlabel("energy") plt.ylabel("conductance") plt.show()
-- Abbout Adel
participants (2)
-
Abbout Adel
-
Hanning Chen