Hi Pawel,
It seems that Joe was too fast for me.
In addition to what Joe wrote - the need to rescale the momenta properly -
you also rescaled the energy twice so the energy scale was also wrong.
The following script adapted from yours gives correct results.
Regards,
Xavier
from matplotlib import pyplot
import kwant
import numpy
import math
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
def calculation(mydx,W):
m=0.0667
lead=make_lead(W=100,dx=mydx).finalized()
band=kwant.physics.Bands(lead)
momenta = numpy.linspace(-numpy.pi, numpy.pi, 101)
energies = [band(k) for k in momenta]
f=open("band_W"+str(W)+"_dx"+str(mydx)+".dat",'w')
for i in range(len(momenta)):
f.write("%f " % (momenta[i]/mydx))
for j in range(len(energies[0])):
f.write("%f " % (energies[i][j]))
f.write("\n")
f.close()
calculation(0.1,100)
calculation(0.2,50)