Ssqr

The $S^2$ operator is defined as $S_x^2+S_y^2+S_z^2$ or: \begin{eqnarray} S^2 &=& \sum_{\tau,\sigma} \frac{3}{4}a^{\dagger}_{\tau,\sigma}a^{\phantom{\dagger}}_{\tau,\sigma} \\ \nonumber &+& \sum_{\tau_1,\tau_2}\sum_{\sigma_1,\sigma_2} \, -\sigma_1\sigma_2 \, a^{\dagger}_{\tau_1\sigma_1}a^{\dagger}_{\tau_2\sigma_2}a^{\phantom{\dagger}}_{\tau_1\sigma_1}a^{\phantom{\dagger}}_{\tau_2\sigma_2} \\ \nonumber &&\quad\quad\quad\quad - a^{\dagger}_{\tau_1\uparrow}a^{\dagger}_{\tau_2\downarrow}a^{\phantom{\dagger}}_{\tau_1\downarrow}a^{\phantom{\dagger}}_{\tau_2\uparrow}, \end{eqnarray} with $\sigma$ the spin index which either can be $1/2$ for spin up ($\uparrow$) or $-1/2$ for spin down ($\downarrow$). The equivalent operator in Quanty is created by:

Example.Quanty
OppSsqr = NewOperator("Ssqr", NF, IndexUp, IndexDn)

Table of contents