Hello,
I have just started working with KWANT but at the beginning I have a problem with the calculation of the energy band in lead. Blow I paste my code in which a define the lead and try to calculate the energy vs wave
vector. The definition of the lead comes from the example on the website
documentation. I assume a lattice with the size dx and then t=h/m/dx/dx.
The energy from the function kwant.bands is expresed in units of [t] and in this point a have a problem
because if I define the lead with W=100 points and dx=0.1 nm and calculate the E vs k bands, it differs from
the E vs k bands calculated for W=50 points and dx=0.2 nm (of course scale the energy multiplying it by t), although the width of the lead W_eff=W*dx is the same for both cases.
I would be grateful for any suggestions ?
Code of my program
from matplotlib import pyplot
import kwant
import numpy
import math
f_nm2au=18.897261
f_eV2au=0.03674932587
f_Ha=27.2114
def make_lead(W=30,dx=1.0,m=0.0667):
lat=kwant.lattice.square(dx)
#uzupelnianie
t=1.0/m/dx/dx
sym = kwant.TranslationalSymmetry((-dx, 0))
lead=kwant.Builder(sym)
lead[(lat(0,y) for y in range(-W+1,W))]=4*t
lead[lat.neighbors()]=-t
return lead
########## calculations for W=100 and dx=0.1 #############
lead=make_lead(W=100,dx=0.1*f_nm2au).finalized()
band=kwant.physics.Bands(lead)
momenta = numpy.linspace(-numpy.pi, numpy.pi, 101)
energies = [band(k) for k in momenta]
dx=0.1*f_nm2au
m=0.0667
wsp=f_Ha/(m*dx*dx)
#print len(energies[1])
f=open('mode_W100_dx01.dat','w')
for i in range(len(momenta)):
f.write("%f " % (momenta[i]))
for j in range(len(energies[0])):
f.write("%f " % (energies[i][j]*wsp))
f.write("\n")
f.close()
########## calculations for W=50 and dx=0.2 #############
lead=make_lead(W=50,dx=0.2*f_nm2au).finalized()
band=kwant.physics.Bands(lead)
momenta = numpy.linspace(-numpy.pi, numpy.pi, 101)
energies = [band(k) for k in momenta]
dx=0.2*f_nm2au
m=0.0667
wsp=f_Ha/(m*dx*dx)
#print len(energies[1])
f=open('mode_W50_dx02.dat','w')
for i in range(len(momenta)):
f.write("%f " % (momenta[i]))
for j in range(len(energies[0])):
f.write("%f " % (energies[i][j]*wsp))
f.write("\n")
f.close()
Best Regards
Pawel Wojcik