[RFC] [new feature] API for custom lattices
Created by: attila-i-szabo
The main limitation of Lattice
is that we can only colour edges by the distance between the sites. This is restrictive, e.g., we couldn't implement a Kitaev honeycomb model without defining an alternative Graph
.
I plan to add support for more general lattices soon. Basically, you can specify any configuration of bonds in a single unit cell and it can be repeated for the whole lattice automatically. The question is how the user should provide this data.
-
For each bond, we need the following information:
- which atom in the unit cell you start from
- which atom in the unit cell you go to
- if you need to move into a different unit cell
- the bond colour
In the input, I would keep all of this together for one bond, and then go to the next, so it would be like
bonds = [ (from, to, [Δx, Δy], col), # next bond ]
The alternative would be keeping the different kinds of data separate, so we'd pass an array of
from
,to
,Δr
,col
to the constructor, likebondops
andbondops_colors
inGraphOperator
. I don't like this because it would be much harder to read what belongs together across 3-4 distinct parameters. -
We can either specify
Δr
either in terms of the number of unit cells you have to move or as a Cartesian displacement vector. Both have their advantages and it is easy to convert from one to the other inside the constructor. I prefer the Cartesian option because I had to define some lattices with unconventional unit cells, which makes it hard to work out Δ(unit cell) by hand.
I'd be interested to hear what you think about these, it's easier to change the API before you write everything!
@femtobit @PhilipVinc @VolodyaCO