Thank you. That's great. Quoting Joseph Weston <joseph.weston08@gmail.com>:
Hi again,
Hello Joseph,
One problem that I see is that I can only get neighbors() from Builders and lattices (using site.family).
Using something like this:
def first_neighbors(to_site, from_site): return to_site in from_site.family.neighbors(1)
is a good idea, but am I really comparing two sites?
-------------------------------- for i in x.family.neighbors(1): print(i)
HoppingKind((1, 0, 0), <Monatomic lattice 13>) HoppingKind((0, 1, 0), <Monatomic lattice 13>) -------------------------------------------
Ah, sorry I was confused.
Also, since this is very expensive computationally, is there any other way to find the hopping distance between two sites?
Sure! If the sites are from the same lattice then you can just take the difference of the "tags" of the sites:
delta = to_site.tag - from_site.tag
'delta' will be an integer array: the position of the site in the basis of lattice vectors. If the sites are from different lattices then you probably can't do better than comparing the realspace positions:
realspace_delta = to_site.pos - from_site.pos
Happy Kwanting,
Joe
-- Dr. Eleni Chatzikyriakou Computational Physics lab Aristotle University of Thessaloniki elchatz@auth.gr - tel:+30 2310 998109