Site layout API
LatticeCore.AbstractSiteLayout — Type
AbstractSiteLayoutAbstract 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— oneAbstractSiteTypeper site (for disordered / quenched-random configurations)
All layouts satisfy site_type(layout, i)::AbstractSiteType.
LatticeCore.UniformLayout — Type
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).
LatticeCore.SublatticeLayout — Type
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).
LatticeCore.ExplicitLayout — Type
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.
LatticeCore.site_type — Function
site_type(layout::AbstractSiteLayout, i::Int) → AbstractSiteTypeReturn the site type stored at site index i.