Hi, > I am trying new Kwant 1.3 features on a very simple example of > graphene monolayer, and, apart from a standard well-working code I add: > > for x in sys.sites(): x.family.norbs=1 for x in leadxp.sites(): > x.family.norbs=1 for x in leadxm.sites(): x.family.norbs=1 (to avoid > norbs not defined error) > > ... > > J_0 = kwant.operator.Current(sys) wf = > kwant.solvers.default.wave_function(sys, energy=0.01, > args=[phi,chempot,0]) psi=wf(1) current = J_0(psi) >
'psi' is a bunch of wavefunctions, but the operators only work on one wavefunction at a time, so you'd have to : currents = [J_0(p) for p in psi] to get the current for each wavefunction. This is actually a pretty common thing to want to do, so it would make sense for the operators to be able to work in a "vectorized" manner. I'll open an enhancement issue on the bugtracker. Happy Kwanting, Joe
