wave_function(...) returns array of size 0 when norbs=1

Hello Kwant community,
I am trying to use kwant.wave_function(...) on a system with norbs=1. For example, if I try to plot the wave function in the Kwant example file quantum_wire.py (which may be found here https://kwant-project.org/doc/1.0/_downloads/quantum_wire.py ), I get an error: "vector is incorrect shape."
The code to plot the wave function is: wf = kwant.wave_function(sys,energy=0)(0) rho = kwant.operator.Density(sys) density = rho(wf) kwant.plotter.density(sys, density)
When I do print(np.shape(wf)) I get (0, 300); where 300 is the number of sites in this example lattice. Thus it seems like the wave function information might be contained in the returned object, but I am not sure how to access it. Please let me know if you have any idea on what I am doing incorrectly here.
Thank you, Derek

Hi Derek,
The code to plot the wave function is: wf = kwant.wave_function(sys,energy=0)(0) rho = kwant.operator.Density(sys) density = rho(wf) kwant.plotter.density(sys, density)
When I do print(np.shape(wf)) I get (0, 300); where 300 is the number of sites in this example lattice. Thus it seems like the wave function information might be contained in the returned object, but I am not sure how to access it. Please let me know if you have any idea on what I am doing incorrectly here
The size of the first axis of 'wf' is zero because there are no propagating modes originating from lead #0 at energy 0 in your system. Try plotting the band structure of lead #0 with:
kwant.plotter.bands(sys.leads[0])
to see at what energies the lead supports propagating modes.
Happy Kwanting,
Joe
participants (2)
-
Derek Reitz
-
Joseph Weston