The Trace of a Matrix#
The trace of a square matrix is a fundamental concept in linear algebra, defined as the sum of the elements on its main diagonal. It is denoted as \(\text{tr}(A)\).
For an \(n \times n\) square matrix \(A\) with elements \(a_{ij}\), its trace is calculated as:
For example, for the matrix \(A = \begin{pmatrix} 3 & 0 & 1 \\ 5 & -2 & 9 \\ 4 & 6 & 8 \end{pmatrix}\), the trace is \(\text{tr}(A) = 3 + (-2) + 8 = 9\).
Properties of the Trace#
The trace has several important properties that make it a useful tool in linear algebra and its applications.
Linearity: The trace is a linear operator. For matrices \(A\) and \(B\) and a scalar \(c\):
\(\text{tr}(A + B) = \text{tr}(A) + \text{tr}(B)\)
\(\text{tr}(cA) = c \cdot \text{tr}(A)\)
Cyclic Property: The trace of a product of matrices is invariant under cyclic permutations of the matrices. For matrices \(A\) and \(B\):
\[ \text{tr}(AB) = \text{tr}(BA) \]This property is one of the most significant. It implies that \(\text{tr}(ABC) = \text{tr}(BCA) = \text{tr}(CAB)\). Note that the trace is not invariant under arbitrary permutations, so in general, \(\text{tr}(ABC) \neq \text{tr}(ACB)\).
Trace of the Transpose: The trace of a matrix is equal to the trace of its transpose: \(\text{tr}(A) = \text{tr}(A^T)\).
Interpretation: Divergence of a Vector Field 🌊#
The trace has a powerful geometric and physical interpretation when the matrix \(A\) represents a linear vector field, defined by the transformation \(\vec{F}(\vec{x}) = A\vec{x}\). In this context, the trace of the matrix \(A\) is equal to the divergence of the vector field \(\vec{F}\).
The divergence measures the rate at which “flow” is expanding or contracting at a given point.
Positive Trace (\(\text{tr}(A) > 0\)): The vector field is expanding. This corresponds to a source or an expanding fluid.
Negative Trace (\(\text{tr}(A) < 0\)): The vector field is contracting. This corresponds to a sink or a compressing fluid.
Zero Trace (\(\text{tr}(A) = 0\)): The vector field is incompressible or divergence-free. The flow entering any region is exactly balanced by the flow exiting it. This is a crucial concept in fluid dynamics for modeling materials like water.