Trace (mathematics)

In mathematics, a trace is a property of a matrix and of a linear operator on a vector space. The trace plays an important role in the representation theory of groups (the collection of traces is the character of the representation) and in statistical thermodynamics (the trace of a thermodynamic observable times the density operator is the thermodynamic average of the observable).

Definition for matrices
Let A be a square n &times; n matrix; its trace is defined by

\mathrm{Tr}(\mathbf{A})\; \stackrel{\mathrm{def}}{=} \; \sum_{i=1}^n A_{ii} $$ where Aii is the ith diagonal element of A.

Example

\mathbf{A} = \begin{pmatrix} 2.1 & 1.3 & 0.0 \\ 5.0 & -0.1 & 8.3 \\ 7.0 & -4.7 & 3.0 \\ \end{pmatrix} \Longrightarrow \mathrm{Tr}(\mathbf{A}) = 2.1-0.1+3.0 = 5.0 $$ Theorem.

Let A and B be square finite-sized matrices, then Tr(A B) = Tr (B A).

Proof

\mathrm{Tr}(\mathbf{AB}) = \sum_{i=1}^n (\mathbf{AB})_{ii} = \sum_{i=1}^n\sum_{j=1}^n \; A_{ij}B_{ji} = \sum_{j=1}^n\sum_{i=1}^n \; B_{ji} A_{ij} = \sum_{j=1}^n (\mathbf{BA})_{jj} = \mathrm{Tr}(\mathbf{BA}) $$

Theorem

The trace is invariant under a similarity transformation Tr(B&minus;1A B) = Tr(A).

Proof

\mathrm{Tr}\big(\mathbf{B}^{-1}(\mathbf{AB})\big) = \mathrm{Tr}\big((\mathbf{AB})\mathbf{B}^{-1}\big) = \mathrm{Tr}(\mathbf{A E}) = \mathrm{Tr}(\mathbf{A}), $$ where we used B B&minus;1 = E (the identity matrix).

Definition for a linear operator on a finite-dimensional vector space
Let Vn be an n-dimensional vector space (also known as linear space). Let $$\hat{A}$$ be a linear operator (also known as linear map) on this space,

\hat{A}:\quad V_n \rightarrow V_n $$. Let

\{v_1, v_2, \ldots, v_n\} $$ be a basis for Vn, then the matrix of $$\hat{A}$$ with respect to this basis is given by

\hat{A} v_i = \sum_{j=1}^n\; v_j A_{ji} \quad \hbox{for}\quad i=1,\ldots, n, \quad\hbox{and}\quad \mathbf{A} \equiv (A_{ij}). $$

Definition: The trace of the linear operator $$\hat{A}$$ is the trace of its matrix. The trace is independent of the choice of basis.

The definition is self-evident, the second part must proved, i.e., the independence of a trace of an operator on the choice of basis. Consider two bases connected by the non-singular matrix B (a basis transformation matrix),

w_i = \sum_{j=1}^n\; v_j B_{ji}, \quad i=1,\ldots, n. $$ Above we introduced the matrix A of $$\hat{A}$$ in the basis vi. Write A' for its matrix in the basis wi

\hat{A}' w_i = \sum_{j=1}^n\; w_j A'_{ji} \quad\hbox{with}\quad \mathbf{A}' = (A'_{ij}). $$ It is not difficult to prove that

\mathbf{A}' = \mathbf{B}^{-1}\; \mathbf{A}\; \mathbf{B}\quad\Longrightarrow\quad \mathrm{Tr}(\mathbf{A}' ) = \mathrm{Tr}(\mathbf{A} ), $$ from which follows that the trace of $$\hat{A}$$ in both bases is equal.