Lattice

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}

AbstractLattice{N}

Abstract type for lattices. N indicated the dimension of this lattice type.

source

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.BoundaryType.
Boundary <: LatticeTag

Abstract type for boundary conditions.

source

There are two kinds of boundary conditions for a lattice

QMTK.FixedType.
Fixed <: Boundary

Fixed boundary tag.

source
QMTK.PeriodicType.
Periodic <: Boundary

Periodic boundary tag.

source

Lattice with Boundary Condition

All lattices with a boundary condition is the subtype of

QMTK.BCLatticeType.
BCLattice{B, N} <: AbstractLattice{N}

Lattice with boundary condition.

source

The BCLattice has the following interface

QMTK.isperiodicFunction.
isperiodic(lattice) -> Bool

whether this lattice has periodic boundary.

source
QMTK.shapeFunction.
shape(lattice) -> Tuple

get the shape of a lattice

source
Base.lengthFunction.
length(lattice) -> Int

get the length (or the product of size in each dimension) of the lattice

source
QMTK.sitesFunction.
sites(lattice)

get the site iterator of the lattice.

source
QMTK.bondsFunction.
bonds(lattice, k)

get the $k$th bond's iterator of the lattice

source

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.ChainType.
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)
source

Square Lattice

QMTK.SquareType.
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.

source