Operator in quantum mechanics
Inquantum mechanics, for systems where the totalnumber of particles may not be preserved, thenumber operator is theobservable that counts the number of particles.
The following is inbra–ket notation: The number operator acts onFock space. Let

be aFock state, composed of single-particle states
drawn from abasis of the underlying Hilbert space of the Fock space. Given the correspondingcreation and annihilation operators
and
we define the number operator by

and we have

where
is the number of particles in state
. The above equality can be proven by noting that
then![{\displaystyle {\begin{array}{rcl}{\hat {N_{i}}}|\Psi \rangle _{\nu }&=&a^{\dagger }(\phi _{i})a(\phi _{i})\left|\phi _{1},\phi _{2},\cdots ,\phi _{i-1},\phi _{i},\phi _{i+1},\cdots ,\phi _{n}\right\rangle _{\nu }\\[1ex]&=&{\sqrt {N_{i}}}a^{\dagger }(\phi _{i})\left|\phi _{1},\phi _{2},\cdots ,\phi _{i-1},\phi _{i+1},\cdots ,\phi _{n}\right\rangle _{\nu }\\[1ex]&=&{\sqrt {N_{i}}}{\sqrt {N_{i}}}\left|\phi _{1},\phi _{2},\cdots ,\phi _{i-1},\phi _{i},\phi _{i+1},\cdots ,\phi _{n}\right\rangle _{\nu }\\[1ex]&=&N_{i}|\Psi \rangle _{\nu }\\[1ex]\end{array}}}](/image.pl?url=https%3a%2f%2fwikimedia.org%2fapi%2frest_v1%2fmedia%2fmath%2frender%2fsvg%2fa4b165f253ce6c2ce7f529d1aaaf7d9cccf84023&f=jpg&w=240)