Canonical: https://knowlpedia.com/linear-algebra/trace/

# Trace

Sum of diagonal entries of a square matrix, invariant under change of basis.

A **trace** is the scalar associated to an \(n\times n\) matrix \(A=(a_{ij})\) over a field \(\mathbb{F}\) defined by
\[
\operatorname{tr}(A)=\sum_{i=1}^n a_{ii}.
\]
For a [linear operator](https://knowlpedia.com/linear-algebra/linear-operator/) \(T:V\to V\) on a finite-dimensional [vector space](https://knowlpedia.com/linear-algebra/vector-space/), the trace \(\operatorname{tr}(T)\) is defined as \(\operatorname{tr}(A)\) for any matrix \(A\) representing \(T\) in a basis; this is independent of the basis.

## Remarks

Trace is often paired with the [determinant](https://knowlpedia.com/linear-algebra/determinant/) in matrix identities and appears in coefficients of the [characteristic polynomial](https://knowlpedia.com/linear-algebra/characteristic-polynomial/). When the characteristic polynomial splits, the trace equals the sum of the [eigenvalues](https://knowlpedia.com/linear-algebra/eigenvalue/) counted with algebraic multiplicity.

## Examples

- If \(A\) is diagonal with diagonal entries \(d_1,\dots,d_n\), then \(\operatorname{tr}(A)=d_1+\cdots+d_n\).
- The identity matrix \(I_n\) satisfies \(\operatorname{tr}(I_n)=n\cdot 1_{\mathbb F}\).
- Any nilpotent matrix (some power equals \(0\)) has trace \(0\).
