The number operator counts oscillator quanta in a bosonic mode. For creation and annihilation operators with , it is and satisfies
The number states obey , . For the quantum harmonic oscillator, , so counting quanta also determines the energy. Positivity follows from on the operator domain. [ref]
An expectation value need not be a possible sharp count. In , , but a quantum measurement of gives only or , each with probability one half. For a general quantum field, a particle number operator also depends on the chosen modes and need not commute with an interacting Hamiltonian.
New to topics? Read the docs here!