Welcome to the documentation of Lattice.jl
This is a Julia package for defining lattices in Julia.
All lattice type in this package is duck typed. Any Julia type with the (Geometric) Region/Lattice Interface can be considered as a (geometric) region/lattice.
Interfaces
Conversion between lattice position and serial number
Site iterator
function: sites
Edge iterator
function: edges
Surround iterator (Optional)
function: surround
Face iterator (Optional)
function: faces
Neighbor sites iterator (Optional)
function neighbors
Lattices
Lattices.BoundedLattice — Type.BoundedLattice{N, BC} <: AbstractLattice{N}A lattice with boundary conditions BC on N dimension.
Lattices.Fixed — Type.Fixed <: BoundaryConditionFixed boundary condition.
Lattices.HyperRect — Type.HyperRect{N, Shape, BC} <: BoundedLattice{N, BC}Hyper Rectangle lattice on N dimension with size Shape.
Lattices.Periodic — Type.Periodic <: BoundaryConditionPeriodic boundary condition.
Lattices.boundary — Function.boundary(lattice) -> BoundaryConditionReturns lattice's boundary condition.
Lattices.edges — Function.edges(lattice; [order=1]) -> iteratorReturns an iterator for all edges of the lattice of a given order. For example, order = 1 means nearest neighbor edges and order = 2 means next-nearest neighbors edges.
Lattices.faces — Function.faces(lattice) -> iteratorReturns an iterator of all faces.
Lattices.isperiodic — Function.isperiodic(lattice) -> BoolCheck if this lattice's boundary condition is periodic.
Lattices.neighbors — Function.neighbors(lattice, s; order=1) -> iteratorReturns an iterator of the surrounding sites of given site s.
Lattices.sites — Function.sites(lattice) -> iteratorReturns an iterator for all sites on the lattice.
Lattices.surround — Function.surround(lattice) -> iteratorReturns an iterator of surroundings of all sites.
surround(lattice, site) -> iteratorReturns an iterator of surrounding sites of given site.
Lattices.AbstractLattice — Type.AbstractLattice{N}Abstract type for general lattices. N indicates the dimension. For a more concrete definition please refer the following material:
- Lattice (group): https://en.wikipedia.org/wiki/Lattice_(group)
- Lattice Model: https://en.wikipedia.org/wiki/Latticemodel(physics)
- Lattice Graph: https://en.wikipedia.org/wiki/Lattice_graph
Lattices.BoundaryCondition — Type.BoundaryConditionBoundary conditions for lattices. There usually has two:
- Fixed boundary
- Periodic boundaryRef: https://nanohub.org/resources/7577/download/MartiniL5BoundaryConditions.pdf
Base.length — Method.length(lattice) -> IntReturns the length of this lattice, or the production of each dimension size.
Base.nameof — Method.name(lattice) -> StringReturns the name of this lattice.
Base.ndims — Method.ndims(lattice) -> NReturns number of dimensions of the lattice.
Base.size — Method.size(lattice) -> TupleReturns the size of this lattice.
Lattices.fastmod1 — Method.fastmod1(::Val{X}, ::Val{Y})mod1 in compile time, 40x faster if the value can be determined