Dear Johnny,
what you are
doing is just diagonalizing a matrix and obtaining the eigenvectors. So,
first, this does not concern the whole system (sys with the leads ).
second, the eigenvectors are not the wavefunction at a given site and
theirfore evecs[i] will return the eigenvector corresponding the the
eigenvalues number "i".
If you want the wavefunction, look at this in the documentation:
http://kwant-project.org/doc/1.0/reference/generated/kwant.solvers.default.wave_functionI have also written this code as an example for you:
import kwant
from matplotlib import pyplot
def make_sys(a=1,t=1,l=50):
def Tshape(pos):
x,y=pos
return x**2+y**2<=l
lat = kwant.lattice.square(a)
sys = kwant.Builder()
sys[lat.shape(Tshape, (0, 1))] = 0
sys[lat.neighbors()]=-1
sym = kwant.TranslationalSymmetry((-2, 1))
lead = kwant.Builder(sym)
lead[lat.wire((0, 3), 5)] = 0
lead[lat.neighbors()] = -1
sys.attach_lead(lead)
sys.attach_lead(lead.reversed())
return sys
def main():
sys = make_sys()
kwant.plot(sys)
sys = sys.finalized()
wf = kwant.solvers.default.wave_function(sys, energy=0)
wfs_of_lead_0 = wf(0)[3] #wave function due to lead 0 and mode 4 (counting starts from 0)
# if you want this wave function at site 35 just do
wf_35=wfs_of_lead_0[34]
#if you want this function at the position x,y=(-5,7) just do
Positions=[sys.sites[i].pos for i in range(len(sys.sites))] #list of all the positions of the sites
site_index=Positions.index((-5,7))
wf_5_7=wfs_of_lead_0[site_index] #wave function at site (-5,7) due to mode 4 of lead 0
print wf_5_7
#plot_conductance(Mysys, energies=[-4.5+0.01/3 * i for i in xrange(3*900)])
# Call the main function if the script gets executed (as opposed to imported).
# See <
http://docs.python.org/library/__main__.html>.
if __name__ == '__main__':
main()
I hope it will help.