In quantum mechanics, for systems where the total number of particles may not be preserved, the number operator is the observable that counts the number of particles.
then