plotting argument 'site_zise' for an unfinalized system
#Comment on the problem: When the system is unfinalized, using an array for site_size will give an incorrect result. #a comparison of a finalized system and an unfinalized one illustrates this.
import kwant
from matplotlib import pyplot
import scipy.linalg as la
lat = kwant.lattice.honeycomb()
a, b = lat.sublattices
def make_system(r=8, t=-1, tp=-0.1):
def circle(pos):
x, y = pos
return x**2 + y**2 < r**2
syst = kwant.Builder()
syst[lat.shape(circle, (0, 0))] = 0
syst[lat.neighbors()] = t
return syst
n=22
syst = make_system(tp=0)
sysf = syst.finalized()
ham = sysf.hamiltonian_submatrix()
evecs = la.eigh(ham)[1]
wf = abs(evecs[:, n])**2
#with an UNFINALIZED system
kwant.plot(syst, site_size= 100*wf, site_color=(0, 0, 1, 0.3), hop_lw=0.1)
#with a FINALIZED system
kwant.plot(sysf, site_size=100*wf, site_color=(0, 0, 1, 0.3), hop_lw=0.1)
Edited by Anton Akhmerov