-
Notifications
You must be signed in to change notification settings - Fork 174
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
[FR] Euclidian distance between nodes in nk.graph.lattice
#1682
Comments
Hi, on a graph it is generally not well specified what the euclidean distance is, so that's why we have not implemented it in the general case. |
There is a distance function, taking into account periodic boundary conditions, for a given geometry here: #1583 @oliviersimard I'd say you can use that code for the lattice as well. You just have to define the basis vectors for your lattice (e.g. in a 2D square lattice of size 4x5 the basis vectors would be e1=(4,0) and e2=(0,5)) and express your state vectors in terms of these lattice vectors (e.g. a spin at site (3,1) would have position (3/4 e1 + 1/5 e2)). This conversion should already be provided using |
This issue is just a reminder that we should implement a distance function for the lattice class. |
nk.graph.lattice
Hi,
Netket provides a method comprised in the class "netket.graph.Lattice" named "distances" which prints out the Manhattan distance between all nodes of the lattice graph (https://netket.readthedocs.io/en/latest/api/_generated/graph/netket.graph.Lattice.html#netket.graph.Lattice.distances). It would be nice to have a similar method that would provide the Euclidian distance between the nodes, taking into account the periodic boundary conditions, having the form:
Note that the function above does not consider the periodic boundary conditions.
Thanks :)
The text was updated successfully, but these errors were encountered: