Learn to Use ITensor

main / classes / latticebond

LatticeBond Objects

A LatticeBond is a simple struct which represents an interaction bond in a lattice model. It does not have to be a nearest-neighbor bond only, and can represent interactions of various distances and types.

Functions such as squareLattice and triangularLattice return a std::vector of LatticeBond objects which can be iterated over in a range-based for loop. For more information about these functions see Functions for Making Lattices.


int Nx = 10;
int Ny = 10;
auto lattice = squareLattice(Nx,Ny);
// lattice is a std::vector<LatticeBond>

for(auto& bnd : lattice) // bnd is of type LatticeBond
    printfln("Bond from site %d -> %d",bnd.s1,bnd.s2);
    printfln("  Connecting points (%s,%s) -> (%s,%s)",bnd.x1,bnd.y1,bnd.x2,bnd.y2);
    printfln("  This bond is of type \"%s\"",bnd.type);

LatticeBond Data Members

Back to Classes
Back to Main