Pauli-matrix spectral projectors (source code)

= Pauli-matrix spectral projectors
{c}
{title2=$P_s=(I+s\widehat{\mathbf d}\cdot\boldsymbol\sigma)/2$}

For $H=\mathbf d\cdot\boldsymbol\sigma$ with $\mathbf d\ne0$, the <eigenvalues> are $\pm|\mathbf d|$ and the projectors are $P_s=(I+s\widehat{\mathbf d}\cdot\boldsymbol\sigma)/2$. A normalized <eigenstate> has $\langle\boldsymbol\sigma\rangle=s\widehat{\mathbf d}$. At $\mathbf d=0$ the spectrum is degenerate and that direction is undefined.