# How to prove that the trace of a density matrix is $1$?

Equation 2 gives the following proof:

$$\text{Tr}[\rho] = \sum_x \langle x\vert \rho\vert x\rangle = \sum_x \langle x\vert \sum_i p_i\vert \psi_i\rangle \langle \psi_i\vert\vert x\rangle = \sum_i p_i\sum_x \vert \langle \psi_i\vert x\rangle \vert^2 = \sum_i p_i = 1.$$

I wonder how they got from $$\sum_x \langle x\vert \sum_i p_i\vert \psi_i\rangle \langle \psi_i\vert\vert x\rangle$$ to $$\sum_i p_i\sum_x \vert \langle \psi_i\vert x\rangle \vert^2$$. When I did the math, I got $$\sum_x \sum_i p_i \langle x\vert \vert \psi_i\rangle \langle \psi_i\vert \vert x\rangle$$. Is it correct?

• Three facts: 1. Addition can be done in any order. 2. Inner product is conjugate symmetric. 3. Product of any complex number with its conjugate equals the square of its absolute value. Feb 7, 2023 at 3:51
• @AdamZalcman thank you for the note. I am still not sure if my approach is correct. Do the step I have stopped at correct? Feb 7, 2023 at 3:55
• Yes, your intermediate step is correct, though people generally write a single | rather than two ||. Feb 7, 2023 at 3:59

I wonder how they got from $$\sum_x \langle x\vert \sum_i p_i\vert \psi_i\rangle \langle \psi_i\vert\vert x\rangle$$ to $$\sum_i p_i\sum_x \vert \langle \psi_i\vert x\rangle \vert^2$$.
When I did the math, I got $$\sum_x \sum_i p_i \langle x\vert \vert \psi_i\rangle \langle \psi_i\vert \vert x\rangle$$. Is it correct?
Yes. The meanings of the following three things are all the same: $$\langle x||\psi_i\rangle \equiv \langle x|\psi_i\rangle \equiv \psi_i(x)$$
Similarly: $$\langle \psi_i||x\rangle \equiv \langle \psi_i|x\rangle = \langle x|\psi_i\rangle^* = \psi_i(x)^*$$
So you can re-write: $$\langle x||\psi_i\rangle\langle \psi_i||x\rangle = \langle x|\psi_i\rangle\langle x|\psi_i\rangle^* \equiv |\langle x|\psi_i\rangle|^2\;,$$ by definition of the absolute square: $$|z|^2 = z z^*$$