Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Heavy-hex lattice #1530

Open
PhilipVinc opened this issue Jul 13, 2023 · 9 comments
Open

Adding Heavy-hex lattice #1530

PhilipVinc opened this issue Jul 13, 2023 · 9 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@PhilipVinc
Copy link
Member

PhilipVinc commented Jul 13, 2023

I would like to add the heavy hex lattice as a built-in one in netket to make it easy to look at ibm's stuff.

This is relatively easy to do, thanks to @attila-i-szabo implementation of lattice, and I think can be done by adding two new sites to the unit cell

import netket as nk

extent = (2,2)
site_offsets = [
    [0.50, 0.50 / 3**0.5],
    [0.75, 0.75 / 3**0.5],
    [1.00, 1.00 / 3**0.5],
    [1.25, 0.75 / 3**0.5],
    [1.00, 1.50 / 3**0.5],
]

g = nk.graph._common_lattices._hexagonal_general(
    extent=extent,
    site_offsets=site_offsets,
    pbc=False,
)

but this gives the following graph

Screenshot 2023-07-13 at 13 44 46

which is correct, but does not really match the way that IBM does it (also, the 'unit' used by ibm corresponds to 2 unit cells in this representation.

But the way IBM uses this lattice is that... they have a certain number of unit cells plus some extra sites.
I'm unsure how to do it exactly if we want to keep using a Lattice...
Indeed we could just hardcode the same graph structure that they use, but maybe I'm missing something...

@PhilipVinc PhilipVinc added enhancement New feature or request help wanted Extra attention is needed labels Jul 13, 2023
@attila-i-szabo
Copy link
Collaborator

Do you want the exact structure in Fig.2 here? I suspect that would need additional work because at least the black dots at the very top and very bottom don't match the periodic structure in the bulk

@PhilipVinc
Copy link
Member Author

almost. The shape used by ibm devices is this one, which as you correctly point out is not really a periodic lattice because of the extra sites

41586_2023_6096_Fig1_HTML png copy

@attila-i-szabo
Copy link
Collaborator

Yeah. Idk what the best way of constructing this would be - quite possibly just a snaking chain + vertical bonds added by hand

@gcarleo
Copy link
Member

gcarleo commented Jul 13, 2023

do they have a map of the connectivy that can be just downloaded? I think it's much easier to define a custom graph and that's it, then all symmetries should be still doable automatically

@PhilipVinc
Copy link
Member Author

retworkx , IBM's reimplementation of networkx in rust, does generate their interpretation of an heavy-hex graph, but the code is messy. Someone should either ask gpt4 or take a student and make him write it.

@gcarleo
Copy link
Member

gcarleo commented Jul 13, 2023

if that code generates an adjacency list... I think we don't need to implement it in netket, I would just call that code and put the adjacency list in one of our graph-based objects ?

@PhilipVinc
Copy link
Member Author

and erroring if the user has not installed retworkx? indeed that's the simplest option.

@attila-i-szabo
Copy link
Collaborator

then all symmetries should be still doable automatically

I think this structure has at most a 180° rotation symmetry, so there's not a whole lot to be gained from the lattice code anyway

@gcarleo
Copy link
Member

gcarleo commented Jul 13, 2023

No I mean I think we shouldn't even support it, it's oo specialized/not a standard lattice I think, if someone wants to use this lattice they can call the IBM library and convert it I to a graph we can use? Maybe we can add an example, not sure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants