There’s no need to send your code both inlined and as an attachment…
Thanks for the help. I added all the sites and hoppings. But I can not display the image, an error: 'SimpleSiteFamily' object has no attribute 'pos'. What does this mean?
Let's say you have a site called "site". You can print its real space position with
The plotter also evaluates site.pos, which is a property that returns
(Do check this out in the source code of builder!) So, site.pos relies on the family of the site having a pos method, but SimpleSiteFamily, being the simple family it is, doesn't. This is by design: since SimpleSiteFamily accepts almost any Python object as a tag, what should be in general the corresponding position?
But we can add it. This should do the job:
class RealSpace(kwant.builder.SimpleSiteFamily): def pos(self, tag): return tag
If you want to optimze RealSpace a little bit, you can also add the following method:
def normalize_tag(self, tag): return ta.array(tag, float)
(where "tinyarray" was imported as "ta")
The pos method of the new RealSpace site family will only work when the tags are tuples of numbers, but this is what you have.