# 迹（线性代数）

方阵的迹是其主对角线上元素之和：对 \( n \times n \) 矩阵 \( A \)，\( \operatorname{tr}(A) = \sum_{j=1}^{n} A_{jj} \)。<sup>[1](https://users.metu.edu.tr/ozan/Math261-262Textbook.pdf)</sup>尽管这个定义依赖于坐标，有限维向量空间上线性算子的迹却不依赖于表示它所用的基，这使得迹与行列式一样，成为算子的内禀量。<sup>[2](https://ericdarve.github.io/NLA/content/trace.html)</sup><sup> • </sup><sup>[3](https://phys.libretexts.org/Bookshelves/Quantum_Mechanics/Advanced_Quantum_Mechanics_%28Kok%29/01%3A_Linear_Vector_Spaces_and_Hilbert_Space/1.05%3A_The_Trace_and_Determinant_of_an_Operator)</sup>

| 关键事实 | 细节 |
|---|---|
| 定义 | \( \operatorname{tr}(A) = \sum_{j=1}^{n} A_{jj} \)，即对角元素之和；仅对方阵有定义，因为非方阵没有完整的对角线。<sup>[1](https://users.metu.edu.tr/ozan/Math261-262Textbook.pdf)</sup><sup> • </sup><sup>[4](https://www.learnmathclass.com/linear-algebra/matrix/trace)</sup> |
| 基无关性 | 对任意可逆的 \( S \)，\( \operatorname{tr}(S^{-1}AS) = \operatorname{tr}(A) \)；相似矩阵有相同的迹。<sup>[2](https://ericdarve.github.io/NLA/content/trace.html)</sup> |
| 刻画性质 | 关于自变量的线性性加上循环性质 \( \operatorname{tr}(AB) = \operatorname{tr}(BA) \)，在方阵上的线性泛函中将迹确定到相差一个比例常数的程度。<sup>[5](https://cse.buffalo.edu/~knepley/classes/cse439/ClassNotes.pdf)</sup> |
| 特征值 | 迹等于特征值之和，因为在特征基下它可以直接从对角线上读出。<sup>[6](https://runestone.academy/ns/books/published/linearpython/sec-matrix-operator.html)</sup> |
| 转置行为 | \( \operatorname{tr}(A^T) = \operatorname{tr}(A) \)，而对共轭转置有 \( \operatorname{tr}(A^H) = \overline{\operatorname{tr}(A)} \)。<sup>[2](https://ericdarve.github.io/NLA/content/trace.html)</sup> |
| 它不是什么 | 迹不是乘性的：一般地 \( \operatorname{tr}(AB) \neq \operatorname{tr}(A)\operatorname{tr}(B) \)，并且 \( \operatorname{tr}(ABC) \) 未必等于 \( \operatorname{tr}(ACB) \)。<sup>[2](https://ericdarve.github.io/NLA/content/trace.html)</sup> |
| 数值实践 | 对非常大的矩阵，迹常用随机方法估计，即用随机向量的吉拉尔–哈钦森估计量。<sup>[7](https://www.sciencedirect.com/science/article/pii/S030439752600383X)</sup> |

## 定义与基本性质

迹对任何方阵都有定义，无论该矩阵表示一个线性算子还是仅仅存储数据。<sup>[8](https://www.math.uh.edu/~climenha/doc/linear-algebra-notes.pdf)</sup>它是其自变量的线性函数：\( \operatorname{tr}(A + B) = \operatorname{tr}(A) + \operatorname{tr}(B) \)，且 \( \operatorname{tr}(\alpha A) = \alpha\,\operatorname{tr}(A) \)。<sup>[5](https://cse.buffalo.edu/~knepley/classes/cse439/ClassNotes.pdf)</sup>

**循环性质。** 最重要的恒等式是 \( \operatorname{tr}(AB) = \operatorname{tr}(BA) \)。<sup>[5](https://cse.buffalo.edu/~knepley/classes/cse439/ClassNotes.pdf)</sup>它立刻给出基无关性：若 \( S \) 可逆，则 \( \operatorname{tr}(S^{-1}AS) = \operatorname{tr}(ASS^{-1}) = \operatorname{tr}(A) \)，所以相似矩阵尽管各自的对角元素不同，却有相同的迹。<sup>[2](https://ericdarve.github.io/NLA/content/trace.html)</sup>该性质是循环的，而非完全对称的：对三个因子，\( \operatorname{tr}(ABC) \) 与 \( \operatorname{tr}(ACB) \) 可以不同，来源中给出了一个例子，其中一个等于 1，另一个等于 0。<sup>[2](https://ericdarve.github.io/NLA/content/trace.html)</sup>

迹也不是乘性的：取 \( A = B = I_2 \)，得 \( \operatorname{tr}(AB) = 2 \)，而 \( \operatorname{tr}(A)\operatorname{tr}(B) = 4 \)。<sup>[2](https://ericdarve.github.io/NLA/content/trace.html)</sup>转置不改变对角线，所以 \( \operatorname{tr}(A^T) = \operatorname{tr}(A) \)；共轭转置把每个对角元素 \( a_{ii} \) 换成 \( \overline{a_{ii}} \)，所以 \( \operatorname{tr}(A^H) = \overline{\operatorname{tr}(A)} \)。<sup>[2](https://ericdarve.github.io/NLA/content/trace.html)</sup>

## 基无关性与算子的迹

有限维向量空间上线性算子 \( T \) 的矩阵依赖于所选的基，因此一个把对角元素相加的定义引出一个问题：结果对 \( T \) 本身是否有意义。<sup>[1](https://users.metu.edu.tr/ozan/Math261-262Textbook.pdf)</sup><sup> • </sup><sup>[9](https://www.cfm.brown.edu/people/dobrush/cs52/Mathematica/Part6/similar.html)</sup>答案是肯定的：\( T \) 在两个基下的矩阵是相似的，\( [T]_{\alpha} = ([\mathrm{Id}]_{\alpha}^{\beta})^{-1}[T]_{\beta}[\mathrm{Id}]_{\alpha}^{\beta} \)，而相似矩阵共享它们的迹，所以 \( \operatorname{tr}(T) := \operatorname{tr}([T]_{\beta}) \) 是良定义的。<sup>[10](https://www.math.cuhk.edu.hk/course_builder/2223/math2040b/HW4Sol.pdf)</sup>

迹可以完全不用任何基来刻画。在方阵空间上的线性泛函中，迹是满足可加性、齐性以及 \( \operatorname{tr}(AB) = \operatorname{tr}(BA) \) 的那一个；任何满足 \( \eta(AB) = \eta(BA) \) 的泛函 \( \eta \) 都与迹成比例。<sup>[5](https://cse.buffalo.edu/~knepley/classes/cse439/ClassNotes.pdf)</sup>一个相关的刻画是：归一化的迹是 \( n \times n \) 矩阵上满足 \( f(I) = 1 \) 与 \( f(AB) = f(BA) \) 的唯一线性泛函 \( f \)。<sup>[11](https://arxiv.org/abs/1402.4272)</sup>

也存在无坐标的定义。一种定义把张量 \( A = \sum_k v_k \otimes f_k^* \in V \otimes V^* \) 的迹定义为 \( \sum_k f_k^*(v_k) \)，这是一个典范地附着于该张量、与任何分解无关的数；在基及其对偶基中展开，就回到对角元素之和。<sup>[1](https://users.metu.edu.tr/ozan/Math261-262Textbook.pdf)</sup>另一种定义与行列式的外幂定义平行，把 \( N \) 维空间上算子 \( \hat A \) 的迹定义为诱导映射 \( \wedge^N \hat A_1 \) 作用于任何非零体积张量 \( \omega \in \wedge^N V \) 时使其倍乘的那个数。<sup>[1](https://users.metu.edu.tr/ozan/Math261-262Textbook.pdf)</sup>

## 与特征值及相似不变量的关系

由于相似矩阵有相同的迹、行列式和特征值，迹是一个相似不变量。<sup>[6](https://runestone.academy/ns/books/published/linearpython/sec-matrix-operator.html)</sup>迹与行列式一起被描述为算子的两个特殊函数，它们在线性向量空间理论中起关键作用，两者都最便于以矩阵形式计算，却又与所选的基无关。<sup>[3](https://phys.libretexts.org/Bookshelves/Quantum_Mechanics/Advanced_Quantum_Mechanics_%28Kok%29/01%3A_Linear_Vector_Spaces_and_Hilbert_Space/1.05%3A_The_Trace_and_Determinant_of_an_Operator)</sup>

这两个不变量彼此独立：矩阵可以有相同的秩而迹不同，也可以有相同的迹而秩不同。<sup>[12](https://commeunjeu.org/cours/fr-ecgapprofondies-2-linear-algebra-complements/?lang=en)</sup>

## 内积、范数与导数

迹提供了矩阵空间上的标准内积。Frobenius 内积为 \( A \cdot B = \sum_{ij} \overline{A_{ij}} B_{ij} = \operatorname{tr}(A^\dagger B) \)，相应的 Frobenius 范数定义在同一空间上。<sup>[5](https://cse.buffalo.edu/~knepley/classes/cse439/ClassNotes.pdf)</sup>由于迹是线性泛函，它生活在矩阵空间的对偶空间中，这正是使这种内积构造成为可能的原因。<sup>[4](https://www.learnmathclass.com/linear-algebra/matrix/trace)</sup>

## 应用

**谱矩与闭游走。** 对谱为 \( \sigma \) 的矩阵 \( M \)，第 \( s \) 阶谱矩是 \( \sum_{\lambda \in \sigma} \lambda^s = \operatorname{trace}(M^s) \)。当 \( M \) 是图的邻接矩阵时，乘积 \( M_{i_1,i_2} M_{i_2,i_3} \cdots M_{i_s,i_1} \) 非零，恰好当一条长度为 \( s \) 的闭游走经过相应的顶点，所以 \( \operatorname{trace}(M^s) \) 计数长度为 \( s \) 的闭游走。<sup>[13](https://academic.oup.com/qjmath/article/75/3/869/7696175)</sup>例如，第二阶谱矩是边数的两倍，因为长度为 2 的闭游走是沿一条边来回走。<sup>[13](https://academic.oup.com/qjmath/article/75/3/869/7696175)</sup>这一观察是组合迹方法的基础，该方法通过计数闭游走或对其数量给出界限来获得关于图特征值的信息，反之亦然。<sup>[14](https://www.tandfonline.com/doi/abs/10.4169/college.math.j.44.1.032)</sup>

**统计学。** 随机向量 \( \mathbf{X} \) 的总变差是其总体方差-协方差矩阵的迹，\( \operatorname{trace}(\Sigma) = \sigma_1^2 + \sigma_2^2 + \cdots + \sigma_p^2 \)，即总体方差之和；它由 \( \operatorname{trace}(S) \) 估计，即样本方差之和，在主成分分析和因子分析中受到关注。<sup>[15](https://online.stat.psu.edu/stat505/Lesson01)</sup>

**随机估计。** 对于只能通过矩阵-向量乘积访问的大矩阵，迹通过采样来估计。吉拉尔引入了基于随机高斯向量的无偏随机估计量，哈钦森通过用拉德马赫随机变量替代高斯向量对其加以改进，从而降低了方差。<sup>[7](https://www.sciencedirect.com/science/article/pii/S030439752600383X)</sup>诸如 Hutch++ 之类的方差缩减算法，把半正定矩阵在精度 \( \varepsilon \) 下所需的样本复杂度从 \( \mathcal{O}(\varepsilon^{-2}) \) 次乘积降到 \( \mathcal{O}(\varepsilon^{-1}) \) 次。<sup>[16](https://arxiv.org/abs/2608.28135)</sup>哈钦森采样与切比雪夫逼近相结合的多层蒙特卡罗方法可以进一步降低方差，特别是在核范数估计问题上。<sup>[17](https://doi.org/10.1016/j.laa.2021.12.010)</sup>

**物理学。** 迹下的循环不变性是迹动力学的基本工具，该框架为具有非交换相空间变量的矩阵模型建立经典拉格朗日与哈密顿动力学。<sup>[18](https://www.cambridge.org/core/books/quantum-theory-as-an-emergent-phenomenon/trace-dynamics-the-classical-lagrangian-and-hamiltonian-dynamics-of-matrix-models/7A499DECC6013B13459FD1D31A4DCB73)</sup>

## 历史

据阿尔布雷希特·皮奇所述，方阵的迹的定义自 18 世纪以来一直在使用。<sup>[19](https://www.irishmathsoc.org/bull96/wef/Articles/TRACE/TRACE-wef.pdf)</sup>代数数域中元素的迹这一相关概念最早由戴德金引入。<sup>[19](https://www.irishmathsoc.org/bull96/wef/Articles/TRACE/TRACE-wef.pdf)</sup>迹所属的更广泛的矩阵理论在 19 世纪主要由凯莱和弗罗贝尼乌斯发展起来；弗罗贝尼乌斯 1878 年的论文还引入了矩阵的秩，并证明了矩阵满足其自身的特征方程。<sup>[20](https://mathshistory.st-andrews.ac.uk/HistTopics/Matrices_and_determinants/)</sup>

## References

1. [The trace of a square matrix, Section 3.8, METU Math 261-262 textbook](https://users.metu.edu.tr/ozan/Math261-262Textbook.pdf)
2. [The Trace of a Matrix, CME 302 Numerical Linear Algebra (Eric Darve, Stanford)](https://ericdarve.github.io/NLA/content/trace.html)
3. [The Trace and Determinant of an Operator, Physics LibreTexts](https://phys.libretexts.org/Bookshelves/Quantum_Mechanics/Advanced_Quantum_Mechanics_%28Kok%29/01%3A_Linear_Vector_Spaces_and_Hilbert_Space/1.05%3A_The_Trace_and_Determinant_of_an_Operator)
4. [Trace of a Matrix: Properties & Identities, Learn Math Class](https://www.learnmathclass.com/linear-algebra/matrix/trace)
5. [Class Notes, CSE 439 (Matt Knepley, University at Buffalo)](https://cse.buffalo.edu/~knepley/classes/cse439/ClassNotes.pdf)
6. [The matrix of a linear operator, Runestone Academy](https://runestone.academy/ns/books/published/linearpython/sec-matrix-operator.html)
7. [Stochastic trace and diagonal estimator for tensors, Theoretical Computer Science](https://www.sciencedirect.com/science/article/pii/S030439752600383X)
8. [Linear algebra lecture notes, University of Houston](https://www.math.uh.edu/~climenha/doc/linear-algebra-notes.pdf)
9. [The matrix of a linear operator, Brown University CS 52](https://www.cfm.brown.edu/people/dobrush/cs52/Mathematica/Part6/similar.html)
10. [MATH2040 Homework 4 solutions, Chinese University of Hong Kong](https://www.math.cuhk.edu.hk/course_builder/2223/math2040b/HW4Sol.pdf)
11. [A short proof of the fact that the matrix trace is the expectation of the numerical values, arXiv](https://arxiv.org/abs/1402.4272)
12. [Linear algebra complements, CommeUnJeu](https://commeunjeu.org/cours/fr-ecgapprofondies-2-linear-algebra-complements/?lang=en)
13. [Exponentially Many Graphs Are Determined By Their Spectrum, The Quarterly Journal of Mathematics](https://academic.oup.com/qjmath/article/75/3/869/7696175)
14. [The Combinatorial Trace Method in Action, The College Mathematics Journal](https://www.tandfonline.com/doi/abs/10.4169/college.math.j.44.1.032)
15. [Measures of Central Tendency, Dispersion and Association, STAT 505, Penn State](https://online.stat.psu.edu/stat505/Lesson01)
16. [Stochastic trace estimation for positive trace-class operators, arXiv](https://arxiv.org/abs/2608.28135)
17. [A multilevel approach to stochastic trace estimation, Linear Algebra and its Applications](https://doi.org/10.1016/j.laa.2021.12.010)
18. [Trace dynamics: the classical Lagrangian and Hamiltonian dynamics of matrix models, Cambridge University Press](https://www.cambridge.org/core/books/quantum-theory-as-an-emergent-phenomenon/trace-dynamics-the-classical-lagrangian-and-hamiltonian-dynamics-of-matrix-models/7A499DECC6013B13459FD1D31A4DCB73)
19. [Trace, Irish Mathematical Society Bulletin](https://www.irishmathsoc.org/bull96/wef/Articles/TRACE/TRACE-wef.pdf)
20. [Matrices and determinants, MacTutor History of Mathematics](https://mathshistory.st-andrews.ac.uk/HistTopics/Matrices_and_determinants/)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 17, 2026; Sep 30, 2026; Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 数与代数 › Linear and multilinear algebra › Matrix theory › Trace and matrix invariants

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/trace-linear-algebra

English original: https://www.edgepedia.org/trace-linear-algebra
