Hi Camilla, you should do the plotting before the finalization, not after. The reason is that before the finalization, kwant always works still internally with sites. After finalization, it's integers (note though that internally kwant will still call your onsite function within the finalized builder!). Best, Michael On 27-10-16 14:50, Camilla Espedal wrote:
The problem occurs when I try to plot a map of the voltage on the sample, to check that everything is working. The problem does not seem to occur when assigning it to a builder element
sys[lattice.shape(shape_sr, (1,1))] = onsite
gives no error messages.
This is what I am trying to do, I write a function that calculates the voltage (I followed one of your tutorials)
def V(sys): Hd = onsite(site) return (Hd[0,0] - Hd[1,1]).real
and then
sys = sys.finalized() kwant.plotter.map(sys, V)
to try to plot it, but then I get the error.
-----Original Message----- From: Christoph Groth [mailto:christoph.groth@cea.fr] Sent: 27. oktober 2016 12:15 To: Camilla Espedal
Cc: kwant-discuss@kwant-project.org Subject: Re: [Kwant] Family-dependent onsite potential Camilla Espedal wrote:
(...) but it does not work. I get error message: ‘int’ object has no attribute ‘family’. How can I solve this, or what am I doing wrong?
This shouldn’t be. Can you provide a complete script that demostrates the problem?
Christoph