0.9 The trace

The trace is an operation which turns outer products into inner products, tr ⁣:baab. \operatorname{tr}\colon |b\rangle\langle a| \longmapsto \langle a|b\rangle. We have just seen that any linear operator can be written as a sum of outer products, and so we can extend the definition of trace (by linearity) to any operator. Equivalently, for any square matrix AA, the trace of AA can be defined to be the sum of its diagonal elements: trA=kekAek=kAkk. \operatorname{tr}A = \sum_k \langle e_k|A|e_k\rangle = \sum_k A_{kk}. In fact, the trace of AA is equal to the sum of the eigenvalues of AA, even in the case where AA is not diagonalisable.

You can show, using this definition or otherwise, that the trace is cyclic18 (tr(AB)=tr(BA)\operatorname{tr}(AB) = \operatorname{tr}(BA)) and linear (tr(αA+βB)=αtr(A)+βtr(B)\operatorname{tr}(\alpha A+\beta B) = \alpha\operatorname{tr}(A)+\beta\operatorname{tr}(B), where AA and BB are square matrices and α\alpha and β\beta complex numbers).

To recover the first definition from the second, we argue as follows: trba=kekbaek=kaekekb=a1b=ab. \begin{aligned} \operatorname{tr}|b\rangle\langle a| &= \sum_k \langle e_k|b\rangle\langle a|e_k\rangle \\&= \sum_k \langle a|e_k\rangle\langle e_k|b\rangle \\&= \langle a|\mathbf{1}|b\rangle \\&= \langle a|b\rangle. \end{aligned} Here, the second term can be viewed both as the sum of the diagonal elements of ba|b\rangle\langle a| in the ek|e_k\rangle basis, and as the sum of the products of two complex numbers ekb\langle e_k|b\rangle and aek\langle a|e_k\rangle. We have used the decomposition of the identity, kekek=1\sum_k|e_k\rangle\langle e_k|=\mathbf{1}. Given that we can decompose the identity by choosing any orthonormal basis, it is clear that the trace does not depend on the choice of the basis.


  1. Note that “cyclic” does not mean the same thing as “permutation invariant”! It is not true in general that tr(ABC)=tr(CBA)\operatorname{tr}(ABC)=\operatorname{tr}(CBA), but only that tr(ABC)=tr(BCA)=tr(CAB)\operatorname{tr}(ABC)=\operatorname{tr}(BCA)=\operatorname{tr}(CAB), i.e. we can only cyclically permute the operators.↩︎