The Sz operator is defined as: Sz=∑τ12(a†τ↑a†τ↑−a†τ↓a†τ↓). The equivalent operator in Quanty is created by:
OppSz = NewOperator("Sz",NF,IndexUp,IndexDn)