Why does $\sum_n \langle n|M_m\rho M_m^\dagger|n\rangle$ simplify to $\langle \psi|M_m^\dagger M_m|\psi\rangle$?

I was trying to derive the formula for $$p(m)$$ in exercise 8.2 on page 357 in Nielsen & Chuang. But I am wondering what rule I can apply to simplify this

$$\mathrm{tr}(\mathcal{E}_m(\rho) )= \sum_n \langle n | M_m \rho M_m^{\dagger} | n\rangle = \sum_n \langle n | M_m | \psi\rangle \langle \psi | M_m^{\dagger} | n\rangle$$

to $$\langle\psi|M_m^{\dagger}M_m|\psi\rangle$$?

Because after this I can’t find any idea to boil down to this.

• @glS.: Sometimes good titles just do not come to mind. It was not intentional. – user27286 Feb 25 at 10:04

$$\sum_n \langle n | M_m | \psi\rangle \langle \psi | M_m^{\dagger} | n\rangle = \sum_n \langle \psi | M_m^{\dagger} | n\rangle \langle n | M_m | \psi\rangle = \langle \psi | M_m^{\dagger} I M_m | \psi\rangle = \langle \psi | M_m^{\dagger} M_m | \psi\rangle$$
note that $$\sum_n|n\rangle\langle n| = I$$