Lattice
Lattices are very common in both condensed matter physics and statistic physics. We offer a general tiny framework for lattices here.
All lattice types are subtype of AbstractLattice{N}
QMTK.AbstractLattice — Type.AbstractLattice{N}Abstract type for lattices. N indicated the dimension of this lattice type.
We also offers some property tags for lattices. All possible property types are subtype of LatticeProperty.
QMTK.LatticePropertyCurrently we only offer one property: Boundary
QMTK.Boundary — Type.Boundary <: LatticeTagAbstract type for boundary conditions.
There are two kinds of boundary conditions for a lattice
QMTK.Fixed — Type.Fixed <: BoundaryFixed boundary tag.
QMTK.Periodic — Type.Periodic <: BoundaryPeriodic boundary tag.
Lattice with Boundary Condition
All lattices with a boundary condition is the subtype of
QMTK.BCLattice — Type.BCLattice{B, N} <: AbstractLattice{N}Lattice with boundary condition.
The BCLattice has the following interface
QMTK.isperiodic — Function.isperiodic(lattice) -> Boolwhether this lattice has periodic boundary.
QMTK.shape — Function.shape(lattice) -> Tupleget the shape of a lattice
Base.length — Function.length(lattice) -> Intget the length (or the product of size in each dimension) of the lattice
QMTK.sites — Function.sites(lattice)get the site iterator of the lattice.
QMTK.bonds — Function.bonds(lattice, k)get the $k$th bond's iterator of the lattice
To traverse all sites of a certain lattice, you can use it as an iterator.
for each_site in sites(lattice)
println(each_site)
endTo traverse all bonds of a certain lattice, you can use bonds, the following example traverse 2nd nearest bond on the lattice.
for each_bond in bonds(lattice, 2)
println(each_bond)
endChain Lattice
QMTK.Chain — Type.Chain{B} <: BCLattice{B, 1}general chain lattice with boundary condition B.
Chain([Boundary], length)Construct a chain lattice with boundary (optional, default to be Fixed)
julia> Chain(10)
QMTK.Chain{QMTK.Fixed}(10)
Square Lattice
QMTK.Square — Type.Square{B} <: BCLattice{B, 2}General square lattice with boundary condition B.
Square([Boundary], height, width)
Square([Boundary], shape)Construct a square lattice. The shape follows the order of Julia's Native Array.