Spin operators
The spin of a single electron is an angular momentum operator, and defined in first quantization as \[\begin{equation} \require{physics} S^c_i = \frac{1}{2} \sigma_i \thinspace , \end{equation}\] related to the Pauli matrices \(\sigma_i\). The superscript \(c\) means that the operator is expressed in coordinate representation.
In second quantization, we project this first-quantized operator onto a spinor basis. In any case, the second-quantized spin operator \(\hat{\vb{S}}\) is the vector operator \[\begin{equation} \hat{\vb{S}} = \hat{S}_x \vb{e}_x + \hat{S}_y \vb{e}_y + \hat{S}_z \vb{e}_z \thinspace , \end{equation}\] where the components \(\hat{S}_i\) are expressed in the underlying spinor basis.
We can distinguish the following cases: