Site layout API

LatticeCore.AbstractSiteLayoutType
AbstractSiteLayout

Abstract supertype for strategies that store the per-site AbstractSiteType of a lattice. Three concrete layouts are provided, each picking a different memory / flexibility trade-off:

  • UniformLayout — every site shares the same site type (stored once; zero per-site memory overhead)
  • SublatticeLayout — each geometric sublattice has its own site type (Vector{Int} of sublattice ids)
  • ExplicitLayout — one AbstractSiteType per site (for disordered / quenched-random configurations)

All layouts satisfy site_type(layout, i)::AbstractSiteType.

source
LatticeCore.UniformLayoutType
UniformLayout(st::AbstractSiteType)

Every site has the same site type. The type parameter carries the concrete site-type singleton so that downstream MC code can dispatch on it at compile time (constant folding in the hot loop).

source
LatticeCore.SublatticeLayoutType
SublatticeLayout(by_sublattice::NTuple{N, <:AbstractSiteType}, sublattice_of::Vector{Int})

Per-sublattice site type. by_sublattice is a tuple of site type instances, one per geometric sublattice; sublattice_of[i] tells which sublattice site i belongs to (1-based).

This is the natural layout for mixed-spin models (e.g. Ising on the A sublattice, XY on B).

source
LatticeCore.ExplicitLayoutType
ExplicitLayout(types::Vector{<:AbstractSiteType})

One site type per site. Use for quenched disorder or any configuration where the per-site type cannot be factored through a sublattice assignment.

source
LatticeCore.site_typeFunction
site_type(layout::AbstractSiteLayout, i::Int) → AbstractSiteType

Return the site type stored at site index i.

source