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.gr...@cea.fr] 
Sent: 27. oktober 2016 12:15
To: Camilla Espedal <camilla.espe...@ntnu.no>
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

Reply via email to