Lazy / infinite lattices API

See Lazy / infinite lattices guide for the narrative version.

LatticeCore.materializeFunction
materialize(abstract; kwargs...) → AbstractLattice

Materialise an infinite / conceptually-infinite abstract lattice into a finite AbstractLattice up to the given cutoff.

This is the entry point for working with infinite structures (quasicrystals beyond a cutoff radius, Fibonacci / L-system substitutions beyond a certain depth, etc.) inside LatticeCore. It is intentionally generic with no typed supertype: any package can ship its own "infinite abstract" type and implement materialize without having to inherit from a LatticeCore hierarchy.

Cutoff convention

The meaning of the cutoff keyword argument(s) is implementation- defined. Typical choices are:

  • depth::Int — substitution depth (Fibonacci, L-system)
  • radius::Real — spatial radius (Penrose cut-and-project)
  • dims::NTuple{D, Int} — explicit per-axis sizes

The returned lattice must be is_finite == true, i.e. its size_trait should be a FiniteSize, so it can be fed directly into Monte Carlo algorithms guarded by require_finite.

See dev/note/04_architecture/06_lazy_infinite/README.md for the infinite-abstract ↔ finite-materialisation design pattern, and for the parallel pattern in 05 Part B (HyperReciprocalLattice → BraggPeakSet).

source
LatticeCore.require_finiteFunction
require_finite(lat::AbstractLattice)

Assert that lat is a finite lattice. Throws ArgumentError if is_finite returns false.

Intended as a guard at the entry point of Monte Carlo algorithms or any routine that cannot operate on an infinite or not-yet-materialised lattice. Returns nothing on success.

Example

function run!(rng, state, lat::AbstractLattice, model, alg; kwargs...)
    require_finite(lat)
    # ... safe to walk the full site list from here ...
end
source