Lattices.jl icon indicating copy to clipboard operation
Lattices.jl copied to clipboard

Helical/Snake Boundaries

Open emerali opened this issue 3 years ago • 7 comments

Helical BCs are a fast approximation to Periodic BCs which make use of the linear storage of arrays to scrape off some computational overhead associated with accessing N-dimensional arrays. See Chapter 13 of Newman and Barkema's book: "Monte Carlo Methods in Statistical Physics" for an overview, or Wikipedia for a very brief summary of the HyperCubic case. People familiar with DMRG will recognize this as something similar to the "Snake" boundary condition.

It is, however, difficult to implement in a clean way:

  • For one, there isn't an easy way to mix Helical BCs with other boundary conditions since it's a "global" boundary condition, as opposed to Periodic or Open BCs which can be applied to each dimension independently (though you probably don't want to mix Helical with anything else anyway).
  • Methods dealing with Helical BCs will treat lattice sites as single integers, while methods for Open/Periodic BCs treat lattice sites a Coordinates. This isn't a type-stability issue (since we're dispatching on the BC type anyway), more of a user-experience one.
  • When using Helical BCs we often only want to specify the number of sites in a lattice directly, however, we don't necessarily set this number to be equal to the product of the dimensions. For example, one could represent a 2D square lattice of size 5x4 with only 18 sites. This conflicts with the fact that we're storing the lengths of each dimension separately in the Lattice struct.

So my question is: will people use Helical BCs? Please comment below if you believe you will.

emerali avatar Sep 17 '20 00:09 emerali