Unit content
Trace of matrices and linear operators
For a square matrix $A$, the trace is the sum of its diagonal entries: $$\operatorname{tr}(A)=\sum_i A_{ii}.$$ For example, $$A=\begin{pmatrix}2&1\-3&5\end{pmatrix}$$ has $$\operatorname{tr}(A)=7.$$
Although this definition uses matrix entries, trace represents a property of the linear operator rather than of one chosen basis. If $A$ is changed to a similar matrix $$A'=S^{-1}AS,$$ then $$\operatorname{tr}(A')=\operatorname{tr}(A).$$
A key identity is the cyclic property $$\operatorname{tr}(AB)=\operatorname{tr}(BA),$$ and more generally factors inside a trace may be cyclically permuted. They cannot in general be reordered arbitrarily.
When an operator is diagonalizable, its trace equals the sum of its eigenvalues counted with algebraic multiplicity: $$\operatorname{tr}(A)=\sum_i\lambda_i.$$
Trace is especially useful when a scalar quantity must be extracted from operators in a basis-independent way. In quantum mechanics a density operator is normalized by $$\operatorname{tr}(\rho)=1,$$ and expectation values can be written $$\langle A\rangle=\operatorname{tr}(\rho A).$$
The trace therefore connects ordinary matrix arithmetic, eigenvalues and basis-independent operator formulas. Its simplicity hides an important structural role: it lets many quantities be calculated in whichever basis makes the operators easiest to represent.