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.LatticeProperty
Currently we only offer one property: Boundary
QMTK.Boundary
— Type.Boundary <: LatticeTag
Abstract type for boundary conditions.
There are two kinds of boundary conditions for a lattice
QMTK.Fixed
— Type.Fixed <: Boundary
Fixed boundary tag.
QMTK.Periodic
— Type.Periodic <: Boundary
Periodic 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) -> Bool
whether this lattice has periodic boundary.
QMTK.shape
— Function.shape(lattice) -> Tuple
get the shape of a lattice
Base.length
— Function.length(lattice) -> Int
get 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)
end
To 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)
end
Chain 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.