Ma · Mathematics

What Is the Trace of a Linear Operator?

Published By the 9to5Science editorial team

At a glance

  1. 1. Choose a basis

    Represent the operator by a square matrix in any basis of the finite-dimensional vector space.

  2. 2. Add the diagonal

    The trace is the sum of the matrix’s diagonal entries.

  3. 3. Change basis freely

    The value is independent of the basis, so it belongs to the operator itself.

The trace of a linear operator is a scalar that captures a simple feature of its matrix representation: the sum of the diagonal entries. Although you calculate it using a basis, the result is the same in every basis. This makes trace a property of the operator itself, rather than of a particular coordinate system.

The usual definition applies to an operator on a finite-dimensional vector space. The key qualification is finite-dimensional: an arbitrary operator on an infinite-dimensional space does not generally have a trace.

Definition

Let VV be an nn-dimensional vector space over a field FF, and let T:V→VT:V\to V be a linear operator. Choose a basis of VV and write the matrix of TT in that basis as A=(aij)A=(a_{ij}). The trace of TT is

tr⁡(T)=tr⁡(A)=∑i=1naii.\operatorname{tr}(T)=\operatorname{tr}(A)=\sum_{i=1}^{n} a_{ii}.

For example, if the matrix of TT is

A=(250−13471−2),A=\begin{pmatrix} 2 & 5 & 0 \\ -1 & 3 & 4 \\ 7 & 1 & -2 \end{pmatrix},

then

tr⁡(T)=2+3+(−2)=3.\operatorname{tr}(T)=2+3+(-2)=3.

The off-diagonal entries do not contribute. The trace is defined for square matrices, as an operator from VV to itself has the same input and output space and therefore has a square matrix in any basis.

Why the trace does not depend on the basis

If you change basis, the matrix of TT changes by a similarity transformation. If AA is its matrix in the first basis and PP is the change-of-basis matrix, the matrix in the new basis has the form P−1APP^{-1}AP.

For square matrices, tr⁡(XY)=tr⁡(YX)\operatorname{tr}(XY)=\operatorname{tr}(YX). Using this identity,

tr⁡(P−1AP)=tr⁡(APP−1)=tr⁡(A).\operatorname{tr}(P^{-1}AP) =\operatorname{tr}(APP^{-1}) =\operatorname{tr}(A).

So every basis gives the same sum. The matrix entries depend on the basis, but their diagonal sum does not. This is why it is meaningful to speak of the trace of the operator TT.

You can also express the definition directly using a basis v1,…,vnv_1,\ldots,v_n and its dual basis φ1,…,φn\varphi_1,\ldots,\varphi_n. If T(vj)=∑iaijviT(v_j)=\sum_i a_{ij}v_i, then φj(T(vj))=ajj\varphi_j(T(v_j))=a_{jj}, so

tr⁡(T)=∑j=1nφj(T(vj)).\operatorname{tr}(T)=\sum_{j=1}^{n}\varphi_j(T(v_j)).

This expression still uses a basis and its dual, but the result is independent of which basis you choose.

A worked example from a linear map

Suppose T:R2→R2T:\mathbb{R}^2\to\mathbb{R}^2 is defined by

T(x,y)=(4x+y, 2x−y).T(x,y)=(4x+y,\,2x-y).

Using the standard basis e1=(1,0)e_1=(1,0) and e2=(0,1)e_2=(0,1), calculate the images of the basis vectors:

T(e1)=(4,2),T(e2)=(1,−1).T(e_1)=(4,2),\qquad T(e_2)=(1,-1).

These vectors are the columns of the matrix of TT:

[T]=(412−1).[T]=\begin{pmatrix}4&1\\2&-1\end{pmatrix}.

Add the diagonal entries to obtain tr⁡(T)=4+(−1)=3\operatorname{tr}(T)=4+(-1)=3. If you represent the same map using another basis, the matrix entries may differ, but its diagonal sum will still be 33.

Useful properties

For operators S,T:V→VS,T:V\to V and a scalar cc, trace is linear:

tr⁡(S+T)=tr⁡(S)+tr⁡(T),tr⁡(cT)=ctr⁡(T).\operatorname{tr}(S+T)=\operatorname{tr}(S)+\operatorname{tr}(T),\qquad \operatorname{tr}(cT)=c\operatorname{tr}(T).

For compatible square matrices, cyclic rearrangement of a product preserves trace: tr⁡(AB)=tr⁡(BA)\operatorname{tr}(AB)=\operatorname{tr}(BA). More generally, the trace of a product is unchanged by moving its first factor to the end. This does not mean that matrix products can be reordered arbitrarily; for instance, tr⁡(ABC)=tr⁡(BCA)\operatorname{tr}(ABC)=\operatorname{tr}(BCA), but it need not equal tr⁡(ACB)\operatorname{tr}(ACB).

Over the complex numbers, the trace also equals the sum of the eigenvalues, counted with algebraic multiplicity. This remains true when the operator is not diagonalizable. The eigenvalues and the diagonal entries need not match one by one; it is their sums that agree.

Common mistakes

  • Treating the trace as one fixed diagonal from every representation. The diagonal entries change with the basis. Only their sum is invariant.
  • Adding every matrix entry. Trace means the main diagonal only: a11+a22+⋯+anna_{11}+a_{22}+\cdots+a_{nn}.
  • Taking the trace of a nonsquare matrix. The usual trace is defined for square matrices, or equivalently for operators from a finite-dimensional space to itself.
  • Assuming every infinite-dimensional operator has a trace. In infinite-dimensional analysis, trace is defined only for certain operators under additional conditions, such as trace-class operators on a Hilbert space.
  • Confusing trace with determinant. Both are basis-independent quantities for a finite-dimensional operator, but they are different: trace is a sum of diagonal entries, while determinant is a separate scalar with different properties.

References

  1. Linear Algebra Done Right, Sheldon Axler
  2. Linear Algebra, Stephen H. Friedberg, Arnold J. Insel, and Lawrence E. Spence

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.