Reference lattices API

LatticeCore ships two minimal concrete lattices so the interface can be exercised end-to-end without any downstream package. These are reference implementations, not production lattices — the full 2D catalogue (triangular, honeycomb, kagome, ...) lives in Lattice2D.jl.

LatticeCore.LineLatticeType
LineLattice{T, B, L}(N, boundary, layout)

A 1D linear chain of N sites with unit spacing.

LatticeCore's simplest reference implementation; paired with SimpleSquareLattice it is also the canonical mock used by downstream Monte Carlo unit tests.

Examples

# Default: PBC + UniformLayout(IsingSite())
line = LineLattice(5)

# Open boundary chain
chain = LineLattice(5, OpenAxis())

# Custom layout (e.g. XY sites)
xy = LineLattice(5; layout = UniformLayout(XYSite()))
source
LatticeCore.SimpleSquareLatticeType
SimpleSquareLattice{T, B <: LatticeBoundary}(Lx, Ly, boundary)

A 2D square lattice of Lx × Ly sites with unit spacing. boundary is a LatticeBoundary whose two axis components independently select between PeriodicAxis, OpenAxis, and TwistedAxis — so mixed BCs (e.g. cylinders) are supported natively.

LatticeCore's 2D reference implementation. It exists so that the core interface can be exercised end-to-end without depending on Lattice2D.jl. The production-grade 2D lattice, with the full topology catalogue (triangular, honeycomb, kagome, ...), sublattice site types, and reciprocal-lattice machinery, lives in Lattice2D.jl.

Site indexing

Sites are laid out in row-major order:

site_index(x, y) = (y - 1) * Lx + x     # 1 <= x <= Lx, 1 <= y <= Ly

so sites 1..Lx form the bottom row, Lx+1..2Lx the next, and so on.

Examples

# Default: 2D PBC
sq = SimpleSquareLattice(3, 3)

# Uniform open boundary
open_sq = SimpleSquareLattice(3, 3, OpenAxis())

# Cylinder: periodic in x, open in y
cylinder = SimpleSquareLattice(3, 3, LatticeBoundary((PeriodicAxis(), OpenAxis())))
source
LatticeCore.basis_vectorsFunction
basis_vectors(lat::LineLattice) → SMatrix{1, 1, T}

Real-space basis matrix. For the unit-spacing reference chain this is the 1×1 identity.

source
basis_vectors(lat::SimpleSquareLattice) → SMatrix{2, 2, T}

Real-space basis matrix. For the unit-spacing reference square this is the 2×2 identity.

source