# 张量缩并

**张量缩并**是多线性代数中的一种运算：它将张量的一个上（逆变）指标与一个下（协变）指标配对，令二者相等，并在共同取值范围内求和，从而产生一个阶数更低的新张量。在坐标表示中，它用爱因斯坦求和约定书写，是张量微积分、广义相对论以及张量网络数值计算的基本构件。<sup>[1](https://little-book-of.github.io/multilinear-algebra/)</sup><sup> • </sup><sup>[2](https://publications.csail.mit.edu/lcs/pubs/pdf/MIT-LCS-TR-615.pdf)</sup>

| 关键事实 | 详情 |
|---|---|
| 定义 | 将一个上指标与一个下指标配对并求和；张量积构造更大的张量，缩并则缩减它们<sup>[1](https://little-book-of.github.io/multilinear-algebra/)</sup> |
| 对阶数的影响 | 对 \( \mathcal{T}^r_s(\mathcal{V}) \) 中一个张量，关于第 \( p \) 位的逆变指标与第 \( q \) 位的协变指标作缩并，是一个线性映射 \( C^p_q : \mathcal{T}^r_s(\mathcal{V}) \to \mathcal{T}^{r-1}_{s-1}(\mathcal{V}) \)；缩并使张量的阶数降低二<sup>[3](https://eprints.ukh.ac.id/id/eprint/278/1/2013_Book_MathematicalPhysics.pdf)</sup><sup> • </sup><sup>[4](https://www.thp.uni-koeln.de/gross/files/linear-algebra.pdf)</sup> |
| 记法 | 在坐标基或抽象指标记法中用爱因斯坦求和约定表示<sup>[5](https://math.stackexchange.com/questions/1792230/coordinate-free-notation-for-tensor-contraction)</sup> |
| 坐标不变性 | 缩并是坐标不变的，因为逆变分量与协变分量彼此按相反方式变换<sup>[2](https://publications.csail.mit.edu/lcs/pubs/pdf/MIT-LCS-TR-615.pdf)</sup> |
| 次序无关性 | 由缩并的定义可知，连续进行多次缩并的先后次序无关紧要<sup>[6](https://web.math.princeton.edu/~nelson/books/ta.pdf)</sup> |
| 计算中的作用 | 所有张量网络例程的基础，都是将多个张量构成的网络缩并成单个张量；所选择的二元缩并顺序会影响总计算成本<sup>[7](https://www.frontiersin.org/journals/applied-mathematics-and-statistics/articles/10.3389/fams.2022.806549/full)</sup> |

## 定义

缩并作用于类型为 \( (r, s) \) 的张量，即具有 \( r \) 个逆变（上）指标和 \( s \) 个协变（下）指标的张量。选定第 \( p \) 位的一个逆变槽位与第 \( q \) 位的一个协变槽位后，缩并 \( C^p_q \) 令这两个指标相等，并沿对角线求和，得到一个从类型 \( (r, s) \) 到类型 \( (r-1, s-1) \) 的线性映射。<sup>[3](https://eprints.ukh.ac.id/id/eprint/278/1/2013_Book_MathematicalPhysics.pdf)</sup> 在分量形式中，同一个指标 \( k \) 取代原先的两个指标，并默认对 \( k \) 求和。<sup>[8](https://www.math.u-bordeaux.fr/~eprovenzi/include/Handbook.pdf)</sup> 每一次缩并都使协变次数与逆变次数各降低一，因此结果的阶数比输入低二。<sup>[8](https://www.math.u-bordeaux.fr/~eprovenzi/include/Handbook.pdf)</sup><sup> • </sup><sup>[4](https://www.thp.uni-koeln.de/gross/files/linear-algebra.pdf)</sup>

在坐标中，缩并对应于对分别属于对偶基与原基的两个指标作对角求和。<sup>[4](https://www.thp.uni-koeln.de/gross/files/linear-algebra.pdf)</sup> 该运算不仅适用于可分解张量，即向量与余向量的乘积，也适用于张量积空间 \( (V^*)^{\otimes m} \otimes V^{\otimes n} \) 的任意元素。<sup>[9](https://ncatlab.org/nlab/show/tensor%20contraction)</sup>

## 记法与爱因斯坦约定

缩并的标准记法是爱因斯坦求和约定：在一项中，若一个指标重复出现，且一上一下，即表示对其取值范围求和。<sup>[5](https://math.stackexchange.com/questions/1792230/coordinate-free-notation-for-tensor-contraction)</sup> 爱因斯坦在其1916年关于广义相对论的论文中引入了这一求和约定。<sup>[10](https://philsci-archive.pitt.edu/22758/1/2311.04612.pdf)</sup> 在度规为平凡的笛卡尔坐标系中，指标可以自由上下移动；在一般坐标系中，由于度规非平凡，必须保留上指标与下指标的区别。<sup>[11](https://arxiv.org/abs/1702.06343)</sup>

由于定义固定了哪些指标被配对，记法是无歧义的：当一个表达式中出现多次缩并时，它们执行的先后次序无关紧要。<sup>[6](https://web.math.princeton.edu/~nelson/books/ta.pdf)</sup>

## 坐标不变性

缩并是一种坐标不变的运算。由于逆变与协变的变换因子在被缩并的槽位中相互抵消，缩并是坐标不变的：部分缩并产生的张量，其分量可以随坐标变化，而完全缩并的量则是坐标不变的标量。<sup>[2](https://publications.csail.mit.edu/lcs/pubs/pdf/MIT-LCS-TR-615.pdf)</sup> 正是这种不变性使缩并成为从张量构造标量的自然方式：在一项中令一个上指标与一个下指标相等，会将类型 \( (n_u, n_l) \) 的张量映射为类型 \( (n_u - 1, n_l - 1) \) 的张量，重复该运算可将张量一直约化为标量。<sup>[2](https://publications.csail.mit.edu/lcs/pubs/pdf/MIT-LCS-TR-615.pdf)</sup> 通常有用的是，将张量读作作用在向量上的多线性映射，通过与向量分量缩并而返回低阶张量。<sup>[2](https://publications.csail.mit.edu/lcs/pubs/pdf/MIT-LCS-TR-615.pdf)</sup>

## 历史背景

缩并是在绝对微分学中定义的，这门学问由格雷戈里奥·里奇-库尔巴斯托罗（Gregorio Ricci Curbastro）加以阐发；他在1887年至1896年间发展出该理论及其完备记法，可适应分析、几何与物理中的问题。<sup>[12](https://mathshistory.st-andrews.ac.uk//Extras/Levi-Civita_Lezioni/)</sup> 里奇与图利奥·列维-奇维塔（Tullio Levi-Civita）在论文《绝对微分计算及其应用》（"Méthodes de calcul différentiel absolu et leurs applications"）中提出了这些方法，该文应费利克斯·克莱因（Felix Klein）之邀发表于《数学年刊》（*Mathematische Annalen*）第54卷。<sup>[12](https://mathshistory.st-andrews.ac.uk//Extras/Levi-Civita_Lezioni/)</sup> 该领域的历史学家强调，黎曼几何的发展与张量微积分的诞生之间存在密切联系。<sup>[13](https://link.springer.com/article/10.1007/s00407-024-00336-2)</sup>

## 张量网络的缩并

在数值工作中，张量网络是一组张量，其共享指标被缩并在一起；所有张量网络例程的基础，都是将一个包含许多张量的网络缩并成单个张量。<sup>[7](https://www.frontiersin.org/journals/applied-mathematics-and-statistics/articles/10.3389/fams.2022.806549/full)</sup> 成本取决于工作如何调度：当一次网络缩并被分解为一系列二元缩并时，序列的选择会改变总计算成本。<sup>[7](https://www.frontiersin.org/journals/applied-mathematics-and-statistics/articles/10.3389/fams.2022.806549/full)</sup> 若存在一种缩并顺序，其成本仅随网络规模多项式增长，则称该网络可精确缩并；否则必须近似缩并，正如许多用于时间演化和变分优化的张量网络算法中所发生的那样。<sup>[14](https://doi.org/10.1146%2Fannurev-conmatphys-040721-022705)</sup>

**降低成本。** 直接计算高阶张量的完全缩并，其复杂度随张量阶数呈指数增长。张量列分解（Tensor Train decomposition，TTD）提供了一种结构化的替代方案：利用图解式张量网络操作，张量列缩并积模型以与张量阶数无关、随张量维数线性增长的方式计算此类乘积，并且相对于标准方法加速了底层操作。<sup>[15](https://arxiv.org/abs/2109.00626)</sup> 草图方法提供了另一条近似缩并的途径，但现有方法仅支持无环张量网络，且其计算复杂度随缩并次数呈指数增长。<sup>[16](https://arxiv.org/abs/2603.07387)</sup>

## 应用

缩并是使张量网络可计算的运算，建立在其上的张量网络方法被应用于机器学习、数学优化、材料科学、量子化学和量子线路模拟等领域。<sup>[17](https://ieeexplore.ieee.org/abstract/document/10806706)</sup> 在量子信息科学与量子计算中，张量网络被用于表示和操作量子态与量子过程，用于模拟量子计算的缩并算法是一个活跃领域，包括张量网络缩并的高效并行化。<sup>[18](https://www.nature.com/articles/s42254-025-00853-1)</sup> 在机器学习中，核心问题是张量网络表示的表达能力以及计算开销的降低，而缩并成本是其中的主要组成部分。<sup>[19](https://ems.press/journals/mag/articles/7697412)</sup>

## References

1. [The Little Book of Multilinear Algebra, section 6.2, Contraction: Summing Paired Indices](https://little-book-of.github.io/multilinear-algebra/)
2. [Computation Structures (MIT LCS TR-615), tensors and contraction](https://publications.csail.mit.edu/lcs/pubs/pdf/MIT-LCS-TR-615.pdf)
3. [Mathematical Physics, Definition 26.1.9 (contraction of a tensor)](https://eprints.ukh.ac.id/id/eprint/278/1/2013_Book_MathematicalPhysics.pdf)
4. [Tensors and Multilinear Algebra, chapter 4 (University of Cologne lecture notes)](https://www.thp.uni-koeln.de/gross/files/linear-algebra.pdf)
5. [Coordinate-free notation for tensor contraction?, Mathematics Stack Exchange](https://math.stackexchange.com/questions/1792230/coordinate-free-notation-for-tensor-contraction)
6. [Tensor Analysis (Edward Nelson, Princeton), multilinear algebra notation](https://web.math.princeton.edu/~nelson/books/ta.pdf)
7. [A Practical Guide to the Numerical Implementation of Tensor Networks I: Contractions, Decompositions, and Gauge Freedom, Frontiers in Applied Mathematics and Statistics (2022)](https://www.frontiersin.org/journals/applied-mathematics-and-statistics/articles/10.3389/fams.2022.806549/full)
8. [Handbook, section 4.4, Operations on tensors (University of Bordeaux)](https://www.math.u-bordeaux.fr/~eprovenzi/include/Handbook.pdf)
9. [Tensor contraction, nLab](https://ncatlab.org/nlab/show/tensor%20contraction)
10. [Einstein's 1916 paper and the summation convention, PhilSci Archive](https://philsci-archive.pitt.edu/22758/1/2311.04612.pdf)
11. [Scalar and Tensor Parameters for Importing Tensor Index Notation including Einstein Summation Notation, arXiv:1702.06343](https://arxiv.org/abs/1702.06343)
12. [Levi-Civita: "Lezioni di calcolo differenziale assoluto", MacTutor History of Mathematics](https://mathshistory.st-andrews.ac.uk//Extras/Levi-Civita_Lezioni/)
13. [Some remarks on the history of Ricci's absolute differential calculus, Archive for History of Exact Sciences (2024)](https://link.springer.com/article/10.1007/s00407-024-00336-2)
14. [Tensor Network Algorithms: A Route Map, Annual Review of Condensed Matter Physics](https://doi.org/10.1146%2Fannurev-conmatphys-040721-022705)
15. [Reducing Computational Complexity of Tensor Contractions via Tensor-Train Networks, arXiv:2109.00626](https://arxiv.org/abs/2109.00626)
16. [Approximating Tensor Network Contraction with Sketches, arXiv:2603.07387](https://arxiv.org/abs/2603.07387)
17. [Survey on Computational Applications of Tensor-Network Simulations, IEEE Access, vol. 12 (2024)](https://ieeexplore.ieee.org/abstract/document/10806706)
18. [Tensor networks for quantum computing, Nature Reviews Physics (2025)](https://www.nature.com/articles/s42254-025-00853-1)
19. [Tensor networks in machine learning, EMS Press](https://ems.press/journals/mag/articles/7697412)

---
*Initially written Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 数与代数 › Linear and multilinear algebra › Multilinear and tensor algebra › Tensor manipulation and transformations

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/tensor-contraction

English original: https://www.edgepedia.org/tensor-contraction
