About cubic lattice hopping
hello ! I am trying to simulate a cubic lattice and I want to write hopping without using neighbors() function,as I am writing different hopping parameters in different directions my lattice is this: lat = kwant.lattice.general([(1,0,0),(0,1,0),(0,0,1)],[(0,0,0)]) def make(a = 4 ,b = 5, c= 1,t=1,delta = 1): def cube(pos): x,y,z = pos return 0<=x<=a and 0<=y<=b and 0<=z<=c sys = kwant.Builder() sys[lat.shape(cube,(0,0,0))] = 4* t sys[lat(0,0,0),lat(0,0,1)] = t return sys this code is showing me an error: TypeError: 'Polyatomic' object is not callable
Hi Anant,
The problem lies in the way you defined your lattice. If we take a look at
the graphene example from the tutorial for a moment, we can define a
graphene lattice as follows:
graphene = kwant.lattice.general([(1, 0), (sin_30, cos_30)], [(0, 0),
(0, 1 / sqrt(3))])
a, b = graphene.sublattices
so we first set the lattice vectors and then the basis coordinates of all
the sublattices. One sublattice is centered around (0,0) and is called 'a',
the other is centered around (0,1/sqrt(3)) and is called 'b'. How did we
define hoppings in that tutorial? Between sublattices:
sys[a(0,0),b(0,0)] = t
so really a hopping between an 'a' atom and a 'b' atom.
Now coming back to your question, by writing
lat = kwant.lattice.general([(1,0,0),(0,1,0),(0,0,1)],[(0,0,0)])
you defined lat as something consisting of one cubic sublattice centered
around (0,0,0). If you want to define hoppings and on site potentials you
have to do the same as for the graphene example, by explicitly defining the
sublattice as:
lat = lat.sublattices
A nicer way however is to define lat as:
lat = kwant.lattice.general([(1,0,0),(0,1,0),(0,0,1)])
The difference is that now I did not define a basis coordinate, so kwant
sees this as a single lattice (Monatomic) and lat(0,0,0) makes perfect
sense. Before lat(0,0,0) did not make much sense since lat could contain
multiple sublattices (Polyatomic) and it is not clear to which sublattice
(0,0,0) is referring to.
with seasonal greetings,
Robert
On Thu, Dec 25, 2014 at 2:55 PM, ANANT
hello ! I am trying to simulate a cubic lattice and I want to write hopping without using neighbors() function,as I am writing different hopping parameters in different directions my lattice is this:
lat = kwant.lattice.general([(1,0,0),(0,1,0),(0,0,1)],[(0,0,0)])
def make(a = 4 ,b = 5, c= 1,t=1,delta = 1): def cube(pos): x,y,z = pos return 0<=x<=a and 0<=y<=b and 0<=z<=c
sys = kwant.Builder() sys[lat.shape(cube,(0,0,0))] = 4* t sys[lat(0,0,0),lat(0,0,1)] = t return sys
this code is showing me an error:
TypeError: 'Polyatomic' object is not callable
participants (2)

ANANT

Robert Sokolewicz