# Sz

The $S_z$ operator is defined as: $$S_z = \sum_{\tau} \frac{1}{2}\left(a^{\dagger}_{\tau\uparrow}a^{\phantom{\dagger}}_{\tau\uparrow} - a^{\dagger}_{\tau\downarrow}a^{\phantom{\dagger}}_{\tau\downarrow}\right).$$ The equivalent operator in Quanty is created by:

Example.Quanty
OppSz = NewOperator("Sz",NF,IndexUp,IndexDn)