Dear Camilla, in which context do you use this function? What the error message tells you that `site` in your function is an integer. This shouldn't be if you passed onsite to a Builder. Are you getting this problem when using trying to plot this function? Best, Michael On 27-10-16 11:34, Camilla Espedal wrote:
Hello,
I am making a system with 2 sublattices, so they belong to different families (a and b), and I wish to define a sublattice-dependent onsite energy. I tried using the following code for the onsite function.
def onsite(site):
onsite_a = 2
onsite_b = 2
return onsite_a if site.family == a else onsite_b
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?
Best,
Camilla