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