Bond API
LatticeCore.Bond — Type
Bond{D, T}A bond (edge) connecting two sites of a lattice.
Fields
i::Int— source site indexj::Int— target site indexvector::SVector{D, T}— displacementposition(j) - position(i), wrapped by the lattice's boundary condition if applicabletype::Symbol— bond type tag (e.g.:nearest,:next_nearest,:dimer_strong). Used as a dispatch key by anisotropic models (see the 07 MC layer design note).
LatticeCore.bonds — Function
bonds(lat::AbstractLattice)Iterator of all bonds in the lattice. The default implementation builds Bond objects on the fly from neighbors(lat, i) using the :nearest tag. Concrete lattices may override this for efficiency or to attach non-default bond types (e.g. dimer-strong vs dimer-weak).
LatticeCore.neighbor_bonds — Function
neighbor_bonds(lat::AbstractLattice, i::Int)Iterator of bonds incident to site i. The default implementation builds Bond objects from neighbors(lat, i) using the :nearest tag. This is the canonical entry point the 07 MC layer uses to walk interactions involving a given site.
LatticeCore.bond_center — Function
bond_center(lat::AbstractLattice, bond::Bond) → SVector{D, T}Geometric center (midpoint) of the bond in real space. Useful for bond-centered observables and for position-dependent bond modifiers such as sine-square deformation.
Uses the bond's stored displacement bond.vector rather than the literal positions of bond.i and bond.j. This matters under periodic boundary conditions: the wrapped target's position(j) is on the opposite side of the sample, so (position(i) + position(j))/2 would point to the sample interior instead of just outside the boundary. The bond carries the unwrapped displacement, so position(i) + bond.vector / 2 gives the true geometric midpoint.