In units with , the quantum harmonic oscillator Hamiltonian and number operator are
The nontrivial commutators among the creation and annihilation operators and are
Their reversed commutators have the opposite signs, while the commutator of any operator with itself is zero.
The operator is self-adjoint because
Its eigenvalues are therefore real. Moreover, for every state ,
so every eigenvalue is nonnegative.
If , the commutator with gives
and
Repeated application of lowers the eigenvalue by one. It must terminate before producing a negative eigenvalue. If is the last occupied rung, then , and the norm identity forces . Hence
This is the integer spectrum of the number operator.