Occupation number operators
Let us define occupation-number operators \(\hat{N}_P\) as \[\begin{equation} \label{eq:ON_operator} \require{physics} \hat{N}_P = \hat{a}^\dagger_P \hat{a}_P \thinspace , \end{equation}\] having the following properties:
ON operators \(\hat{N}_P\) act on ON vectors \(\ket{\vb{k}}\) as \[\begin{equation} \hat{N}_P \ket{\vb{k}} = k_P \ket{\vb{k}} \thinspace , \end{equation}\]
ON operators \(\hat{N}_P\) are Hermitian: \[\begin{equation} \hat{N}_P^\dagger = \hat{N}_P \end{equation}\]
ON operators commute amongst themselves: \[\begin{equation} \comm{\hat{N}_P}{\hat{N}_Q} = 0 \end{equation}\]
ON operators are idempotent: \[\begin{equation} \hat{N}_P^2 = \hat{N}_P \end{equation}\]
From these properties follow that the ON vectors \(\ket{\vb{k}}\) are simultaneous eigenvectors of all the \(\hat{N}_P\), and that \(\hat{N}_P\) is a projection operator in the spin-orbital basis, in the sense that it annihilates every vector that has \(k_P=0\). If we let \(\ket{\vb{c}}\) be a general vector of Fock space, i.e. \[\begin{equation} \ket{\vb{c}} = \sum_{\vb{k}} c_{\vb{k}} \ket{\vb{k}} \thinspace , \end{equation}\] then \[\begin{equation} \hat{N}_P \ket{\vb{c}} = \sum_{\vb{k}}^{P \thinspace \text{occ}} c_{\vb{k}} \ket{\vb{k}} \thinspace . \end{equation}\]
The commutators of ON operators and elementary creation and annihilation operators are: \[\begin{equation} \comm{\hat{N}_P}{\hat{a}^\dagger_Q} = \delta_{PQ} \hat{a}^\dagger_Q \thinspace , \end{equation}\] and \[\begin{equation} \comm{\hat{N}_P}{\hat{a}_Q} = - \delta_{PQ} \hat{a}_Q \thinspace , \end{equation}\]
Let us now define an arbitrary string of creation and annihilation operators: \[\begin{equation} \label{eq:arbitrary_string} \hat{X} = \qty( \prod_{Q=1}^M (\hat{a}^\dagger_Q)^{q_Q} ) \qty( \prod_{Q=1}^M (\hat{a}_Q)^{q_Q'} ) \thinspace , \end{equation}\] where \(q_Q\) counts the number of creation operators \(\hat{a}^\dagger_Q\) and \(q_Q'\) counts the number of annihilation operators \(\hat{a}_Q\). The commutator of such a string with the ON operator \(\hat{N}_P\) then becomes \[\begin{equation} \comm{\hat{N}_P}{\hat{X}} = (q_P - q_P') \hat{X} \thinspace . \end{equation}\]
We can now define the total number operator as \[\begin{equation} \hat{N} = \sum_{P=1}^M \hat{N}_P \thinspace , \end{equation}\] whose action on an ON vector \(\ket{\vb{k}}\) is to return the total number of electrons in it: \[\begin{equation} \hat{N} \ket{\vb{k}} = N \ket{\vb{k}} \thinspace , \end{equation}\] and whose commutator with an arbitrary string (cfr. equation \(\eqref{eq:arbitrary_string}\)) is \[\begin{equation} \comm{\hat{N}}{\hat{X}} = \qty[ \qty( \sum_{P=1}^M q_P ) - \qty( \sum_{P=1}^M q_P' ) ] \hat{X} \thinspace . \end{equation}\] We can thus see that \(\hat{N}\) commutes with strings that have the same amount of creation and annihilation operators.
The total number operator may be rewritten as \[\begin{align} \hat{N} &= \sum_P \hat{a}^\dagger_P \hat{a}_Q \\ &= \sum_{PQ} \Sigma_{PQ} \hat{a}^\dagger_P \hat{a}_Q \thinspace , \end{align}\] with \(\boldsymbol{\Sigma}\) the overlap matrix in the orthonormal basis related to the operators \(\set{ \hat{a}^\dagger_P }\). For the elements of the (orthonormal) overlap matrix, we have: \[\begin{equation} \Sigma_{PQ} = \braket{\phi_{P \alpha}}{\phi_{Q \alpha}} + \braket{\phi_{P \beta}}{\phi_{Q \beta}} = \delta_{PQ} \thinspace , \end{equation}\] since the spinors related to \(\set{ \hat{a}^\dagger_P }\) form an orthonormal basis. Since the overlap matrix can be subdivided into an \(\alpha\) and a \(\beta\)-part, we may naturally define a \(\sigma\)-spin “number” operator as \[\begin{equation} \hat{N}^\sigma = \sum_{PQ} \Sigma^{\sigma \sigma}_{PQ} \hat{a}^\dagger_P \hat{a}_Q \end{equation}\] such that \[\begin{equation} \hat{N} = \sum_\sigma \hat{N}^\sigma \thinspace , \end{equation}\] by defining the \(\sigma\)-orbital overlap matrix (in orthonormal basis): \[\begin{align} \Sigma^{\sigma \sigma}_{PQ} &= \braket{\phi_{P \sigma}}{\phi_{Q \sigma}} \\ &= ( \vb{C}^{\sigma, \dagger} \vb{S}^{\text{AO}} \vb{C}^\sigma )_{PQ} \thinspace , \end{align}\] with \(\vb{S}^{\text{AO}}\) the \((K \times K)\) overlap matrix of the non-orthogonal scalar basis functions and \(\vb{C}^\sigma\) the \((K \times 2K)\)-\(\sigma\)-coefficients of the spinors.
Even though we must keep in mind that it is, in general, not a real “number” operator as defined before, we can associate its expectation value \[\begin{equation} N_\sigma = \ev{\hat{N}^\sigma}{\Psi} \end{equation}\] with a “number of \(\sigma\)-electrons”, since in a spin-orbital basis the associated orbital occupation number operators are number operators and the expectation value is exactly the (integer) number of \(\sigma\)-spinors that are ‘occupied’.