Site type API

See Site types and layouts for the narrative version and Site types and spin models for the physics.

Abstract type and interface

LatticeCore.AbstractSiteTypeType
AbstractSiteType

Abstract supertype for site types — value-level descriptors of the physical degree of freedom living on a lattice site.

Concrete subtypes are deliberately lightweight (typically singletons or thin parametric singletons) so they can be embedded in lattice structs and used as a dispatch key by MC models.

Required interface

  • state_type(st)::Type — the Julia type used to store a state
  • random_state(rng, st) — sample a uniformly random state

Optional interface

  • zero_state(st) — a canonical zero state (if defined)
  • domain(st) — iterable over the state space (for small discrete site types)
  • element_type(st)::AbstractLatticeElement — which geometric element the DOF lives on. Defaults to VertexCenter. Override for bond / plaquette-centered variables such as dimer or gauge fields.

See dev/note/04_architecture/04_site_type/README.md.

source
LatticeCore.zero_stateFunction
zero_state(st::AbstractSiteType)

Canonical zero state (e.g. 0 for Ising, 0.0 for XY). Not all site types have to define this.

source
LatticeCore.domainFunction
domain(st::AbstractSiteType)

Iterable over the state space. Only meaningful for small discrete site types (Ising, Potts); continuous types leave this unimplemented.

source
LatticeCore.element_typeFunction
element_type(st::AbstractSiteType) → AbstractLatticeElement

Which geometric element the DOF lives on. Defaults to VertexCenter. Override for bond / plaquette / cell-centered site types.

source

Built-in site types

LatticeCore.XYSiteType
XYSite{T <: AbstractFloat}()

Planar rotor: state is an angle θ ∈ [0, 2π) stored as T (default Float64).

source
LatticeCore.HeisenbergSiteType
HeisenbergSite{T <: AbstractFloat}()

Classical Heisenberg spin: state is a unit vector in ℝ³ stored as SVector{3, T} (default Float64).

source
LatticeCore.EmptySiteType
EmptySite()

Vacancy / empty site: stores nothing. Useful for diluted models and as a placeholder where a site has no degrees of freedom.

source