# How to prove that ${\rm tr}(A|\psi\rangle\langle\psi|)=\langle\psi| A|\psi\rangle$?

How can one prove that $$tr(A\mid\psi\rangle\langle\psi\mid)=\langle\psi\mid A\mid\psi\rangle$$? In Nielsen/Chuang they mention this is due to Gram-Schmidt decomposition but I can’t understand how.

You can proceed in the following way: $$\text{Tr}(A|\psi\rangle\langle\psi|) = \sum_i \langle i|A|\psi\rangle\langle\psi|i\rangle = \sum_i \langle\psi|i\rangle\langle i|a|\psi\rangle = \langle \psi|(\sum_i |i\rangle\langle i|)A|\psi\rangle = \langle\psi|A|\psi\rangle$$

There's a couple of ways you can do this. Let $$\{|u_i\rangle\}$$ be any orthonormal basis. Then the definition of the trace is simply $$\text{Tr}(A|\psi\rangle\langle\psi|)=\sum_i\langle u_i|A|\psi\rangle\langle\psi|u_i\rangle.$$ Since $$\langle u_i|A|\psi\rangle\langle\psi|u_i\rangle$$ is just two numbers multiplied together, I can change the order of multiplication to $$\langle\psi|u_i\rangle\langle u_i|A|\psi\rangle$$, so that the trace is $$\text{Tr}(A|\psi\rangle\langle\psi|)=\sum_i\langle\psi|u_i\rangle\langle u_i|A|\psi\rangle=\langle\psi|A|\psi\rangle.$$ by using the completeness relation.

One step beyond this I personally find to be particularly elegant. If I can choose any orthonormal basis, why don't I select the basis such that $$|u_1\rangle=|\psi\rangle$$. The other $$|u_i\rangle$$ can be absolutely anything, it really doesn't matter (yes, you could use Gram-Schmidt to construct them, but you never need to construct them). Then, you have $$\text{Tr}(A|\psi\rangle\langle\psi|)=\sum_i\langle u_i|A|\psi\rangle\langle\psi|u_i\rangle=\langle u_1|A|\psi\rangle\langle\psi|u_1\rangle+\sum_{i\neq 1}\langle u_i|A|\psi\rangle\langle\psi|u_i\rangle.$$ All the terms in the final sum are 0 because the $$|u_i\rangle$$ are orthogonal to $$|\psi\rangle=|u_1\rangle$$. This just leaves the first term $$\text{Tr}(A|\psi\rangle\langle\psi|)=\langle u_1|A|\psi\rangle\langle\psi|u_1\rangle=\langle\psi|A|\psi\rangle.$$

You can use the cyclic property of the trace, $${\rm Tr}(XY) = {\rm Tr}(YX)$$.

Another way is to note that both sides are linear over $$A$$. Thus it's enough to prove it for $$A = E_{ij} = |i\rangle\langle j|$$.

• By using the cyclic property on the LHS I would get the RHS inside a trace though, how do i get rid of it? Commented Feb 23, 2023 at 10:35
• It's just a number. Trace of a number is the number itself. Commented Feb 23, 2023 at 10:36
• It is perhaps not obvious that if you have an operator $|\psi\rangle\langle\psi|$ that you can split that up and use the cyclic property to just move the ket. (I agree it works, I'm just saying it's not obvious that the cyclic property extends in that way) Commented Feb 23, 2023 at 12:20