## Learn to Use ITensor

main / classes / spinhalf

# SpinHalf and SpinHalfSite

The SpinHalf class is a specialization of SiteSet which initializes its sites of be of type SpinHalfSite, representing a S=1/2 spin.

The SpinHalfSite class can also be used to create custom SiteSets which mix SpinHalfSites with other types of sites.

SpinHalf and SpinHalfSite are defined in the file "itensor/mps/sites/spinhalf.h"

## Synopsis

auto sites = SpinHalf(100);

auto Sz3 = sites.op("Sz",3);

auto Sp4 = sites.op("S+",4);

//Use IQIndexVals to get the +,+ element of the Sz operator
auto Szpp = Sz3.real(sites(3,"Up"),prime(sites(3,"Up")));


## States of a SpinHalfSite

• "Up" — the $m_z=+1/2$ spin state

• "Dn" — the $m_z=-1/2$ spin state

## Operators Provided by SpinHalfSite

• "Sz" — the $S^z = \frac{1}{2}\sigma^z$ spin operator

• "S+" — the $S^+ = \sigma^+$ operator (alternate name is "Sp")

• "S-" — the $S^- = \sigma^-$ operator (alternate name is "Sm")

• "Sx" — the $S^x = \frac{1}{2}\sigma^x$ operator (must be converted to an ITensor prior to usage)

• "Sy" — the $S^y = \frac{1}{2}\sigma^y$ operator (must be converted to an ITensor prior to usage)

• "ISy" — defined as $i\,S^y = \frac{i}{2}\sigma^y$ (must be converted to an ITensor prior to usage)

Back to Classes
Back to Main