Trace of Matrix

Before deriving the form of an optimal baseline in AC A2C, let’s understand some prerequisite knowledge: the trace of a matrix.


the following content is generated by deepseek-R1

In linear algebra, the trace is an important property of a square matrix, defined as the sum of elements on the main diagonal. Here’s a detailed explanation:

Definition

For an square matrix , its trace is denoted as , calculated by the formula:

Examples:

Properties

  1. Linearity:

    where are square matrices of the same order, and is a scalar.

  2. Commutativity of Matrix Multiplication:

    This holds true even when and have different dimensions (e.g., when is and is ).

  3. Similarity Invariance: If (similarity transformation), then . This indicates that trace is a similarity invariant of matrices.

  4. Relationship with Eigenvalues: The trace equals the sum of all eigenvalues (counting algebraic multiplicity). If the eigenvalues of are , then:

  5. Other Properties:

    • Transpose doesn’t change the trace: .
    • The trace of an identity matrix equals its order: .

Applications

  1. Eigenvalue Analysis: The trace and determinant together reflect the characteristics of a matrix (trace is the sum of eigenvalues, determinant is the product of eigenvalues).
  2. Optimization Problems: In statistics and machine learning, the trace is used to measure the total variance of a covariance matrix.
  3. Quantum Mechanics: The trace of a density matrix represents the total probability of a system (which must remain 1).

Example Verification

Commutativity Verification:

Let , , then:

The results are consistent, verifying that .

Summary

The trace is the sum of the elements on the main diagonal of a square matrix. It has properties of linearity, similarity invariance, and is closely related to eigenvalues. It has wide applications in matrix analysis, optimization, and physics.