# T门

T门是一种单量子比特量子门，对|1⟩态施加π/4的相位，其矩阵表示为diag(1, e^{iπ/4})。它是泡利-Z门的四次方根，产生π/4相位；由于在相差一个全局相位意义下等价于\( \exp(i\pi/8 \cdot Z) \)，有时也被称为π/8门。在Qiskit中，可以用t()方法将其作用于量子电路。<sup>[1](https://quantum.cloud.ibm.com/docs/en/api/qiskit/qiskit.circuit.library.TGate)</sup>

| 关键事实 | 详情 |
|---|---|
| 矩阵 | \( T = \begin{pmatrix} 1 & 0 \\ 0 & e^{i\pi/4} \end{pmatrix} \)，在相差一个全局相位意义下等价于绕Z轴旋转π/8弧度<sup>[1](https://quantum.cloud.ibm.com/docs/en/api/qiskit/qiskit.circuit.library.TGate)</sup> |
| 分类 | 非克利福德门；泡利-Z的四次方根<sup>[1](https://quantum.cloud.ibm.com/docs/en/api/qiskit/qiskit.circuit.library.TGate)</sup> |
| 通用性 | H、S和T构成通用门集：任意2 × 2酉矩阵都可由它们以任意精度逼近<sup>[2](https://www.jku.at/fileadmin/gruppen/180/2023_quantum_computing.pdf)</sup> |
| 容错实现 | 以魔法态\(\left\vert T\right\rangle = \left\vert 0\right\rangle + e^{i\pi/4}\left\vert 1\right\rangle\)的形式消耗，用[[15, 1, 3]]量子里德–穆勒码蒸馏，该码具有横向量子逻辑T门<sup>[3](https://www.nature.com/articles/s41534-024-00945-3)</sup> |
| 蒸馏比率 | 标准方案消耗15个含噪辅助比特，输出1个更精确的辅助比特<sup>[3](https://www.nature.com/articles/s41534-024-00945-3)</sup> |
| 难度基准 | 任何实现托佛利门或弗雷德金门的克利福德+T电路至少需要7个T门<sup>[4](https://www.microsoft.com/en-us/research/publication/an-algorithm-for-the-t-count/)</sup> |
| 成本度量 | T计数（T门数量）和T深度是克利福德+T电路的标准优化目标<sup>[5](https://www.nature.com/articles/s42256-025-01001-1)</sup> |

## 定义与代数性质

T门作用于单个量子比特时，保持|0⟩分量不变，将|1⟩分量乘以\( e^{i\pi/4} \)。<sup>[1](https://quantum.cloud.ibm.com/docs/en/api/qiskit/qiskit.circuit.library.TGate)</sup> 它是泡利-Z算符的四次方根，因此作用四次得到泡利-Z门，作用八次返回恒等操作，其平方为相移门S。π/8门这一名称反映的是：忽略全局相位后，该门为\( \exp(i\pi/8 \cdot Z) \)，即旋转角度为其矩阵指数所暗示角度的一半。<sup>[1](https://quantum.cloud.ibm.com/docs/en/api/qiskit/qiskit.circuit.library.TGate)</sup><sup> • </sup><sup>[19](https://www.mathworks.com/help/matlab/ref/tgate.html)</sup><sup> • </sup><sup>[20](https://quantum.cloud.ibm.com/docs/en/api/qiskit/1.2/qiskit.circuit.library.TGate)</sup>

该门位于克利福德群之外。克利福德群是由哈达玛门H、相移门S和CNOT生成的有限酉子群。<sup>[6](https://www.nature.com/articles/ncomms1166)</sup> 这一位置之所以重要，是因为戈特斯曼–奈尔定理：完全由克利福德门构成的任何电路都可以被经典计算机高效模拟，因此仅靠克利福德操作无法提供量子优势。<sup>[7](https://math.mit.edu/documents/spur/2024He_Robitaille_Tan.pdf)</sup> 将T门加入克利福德门集则改变了局面：H、S和T生成通用门集，意味着任意2 × 2酉矩阵都可由这些门以任意精度逼近。<sup>[2](https://www.jku.at/fileadmin/gruppen/180/2023_quantum_computing.pdf)</sup> 由H、T和CNOT组成的克利福德+T库因其适用于容错实现，在量子电路综合领域引起了特别关注。<sup>[8](https://www.dfki.de/web/forschung/projekte-publikationen/publikation/10453)</sup>

## 在容错量子计算中的作用

在容错量子计算的标准方法中，信息存储在量子纠错码（如表面码——一种将逻辑量子比特编码在物理量子比特网格上的纠错方案）中，处理过程遵循一种可概括为“先蒸馏后合成”的策略。<sup>[9](https://eprints.whiterose.ac.uk/id/eprint/112413/)</sup> 纠错码可以直接运行克利福德门，但T门等非克利福德门需要不同的资源：魔法态\(\left\vert T\right\rangle = \left\vert 0\right\rangle + e^{i\pi/4}\left\vert 1\right\rangle\)。<sup>[3](https://www.nature.com/articles/s41534-024-00945-3)</sup> 这些态之所以被称为魔法态，是因为它们与克利福德门一起能够实现通用量子计算，并且在制备不完美时，仅使用克利福德群操作即可将其纯化。<sup>[6](https://www.nature.com/articles/ncomms1166)</sup>

**魔法态蒸馏。** T态的主要蒸馏方案使用[[15, 1, 3]]量子里德–穆勒码，该码具有横向量子逻辑T门。<sup>[3](https://www.nature.com/articles/s41534-024-00945-3)</sup><sup> • </sup><sup>[10](https://www.nature.com/articles/s41534-026-01197-z)</sup> 将纠缠对中的一个量子比特编码到15量子比特码中，使用含噪输入辅助比特施加横向T门，并在X基下测量全部15个量子比特；若稳定子检验通过，剩余的量子比特即成为更精确的辅助比特。<sup>[3](https://www.nature.com/articles/s41534-024-00945-3)</sup> 该协议每产生一个被接受的输出消耗15个含噪辅助比特，而含噪辅助比特可以仅使用克利福德门从含噪输入态蒸馏到任意保真度。<sup>[3](https://www.nature.com/articles/s41534-024-00945-3)</sup> 早期的一项实验演示在核磁共振量子处理器上进行，将五个不完美的魔法态蒸馏为一个保真度更高的魔法态。<sup>[6](https://www.nature.com/articles/ncomms1166)</sup>

长期以来，蒸馏一直被认为是容错量子计算机的主要资源成本，但其开销已大幅降低。量子计算研究者丹尼尔·利廷斯基（Daniel Litinski）证明，当蒸馏电路以某种方式表达——使能够检测错误的量子比特与无法检测错误的量子比特分开——时，参与蒸馏的大多数逻辑量子比特都可以用非常低的码距编码；在极端条件下，蒸馏一个魔法态可能比在全码距保护的逻辑量子比特上执行一个逻辑克利福德门更便宜。<sup>[11](https://arxiv.org/abs/1905.06903)</sup> 替代制备路线也能降低成本：一种带标志量子比特的冗余辅助编码方案在物理错误率为10⁻⁴时，仅用64个物理量子比特就能产生逻辑错误率约为5 × 10⁻⁸的魔法态，而已知最佳蒸馏方案需要810个量子比特，且所有克利福德操作均在物理层面执行。<sup>[12](https://www.nature.com/articles/s41534-020-00319-5)</sup>

## T计数作为成本度量

由于容错电路中的每个T门最终都追溯到一个蒸馏出的魔法态，电路中T门的数量——即T计数——决定了资源成本，因此降低T计数已成为重要的优化目标。<sup>[5](https://www.nature.com/articles/s42256-025-01001-1)</sup><sup> • </sup><sup>[13](https://arxiv.org/abs/1712.08254)</sup> 配套度量T深度——即顺序T门层的数量——衡量电路运行时间。<sup>[14](https://www.mdpi.com/2079-9292/15/11/2334)</sup> 优化工作涵盖多种方法：

- 微软研究院（Microsoft Research）的一种算法针对给定酉矩阵计算T门数量最少的电路，并确立了任何实现托佛利门或弗雷德金门的克利福德+T电路至少需要7个T门。<sup>[4](https://www.microsoft.com/en-us/research/publication/an-algorithm-for-the-t-count/)</sup>
- 对于由CNOT和T门组成的电路，降低T计数等价于在阶为\( n - 4 \)的穿孔里德–穆勒码中，以最小距离解码一个长度为\( 2^{n} - 1 \)的二进制向量，这给出了由这些门构成的n量子比特酉矩阵的T门上界\( O(n^{2}) \)。<sup>[15](https://ieeexplore.ieee.org/document/8672175)</sup>
- 机器学习已进入该领域：AlphaTensor-Quantum专注于T计数优化，并针对有限域乘法找到了一种与经典卡拉楚巴方法复杂度相同的量子算法。<sup>[5](https://www.nature.com/articles/s42256-025-01001-1)</sup>
- 2025年对TODD算法的改进——该算法在各种电路上提供最佳的T计数缩减——证明了n量子比特无哈达玛电路优化后的T门数量上界为\( n(n+1)/2 + 1 \)。<sup>[16](https://quantum-journal.org/papers/q-2025-09-16-1860/)</sup>

T复杂度也成为控制流的性能瓶颈：量子纠错可能使作为量子程序实现的算法运行得比理想化硬件上更慢，在基准测试中，8个受测量子电路优化器只有2个恢复出具有渐近高效T复杂度的电路。<sup>[17](https://doi.org/10.1145/3656397)</sup>

## 硬件演示

容错逻辑T门已在物理平台上得到演示。在一台离子阱量子计算机中，研究人员在两个逻辑量子比特上实现了容错通用门集，通过量子隐形传态将魔法态从一个逻辑量子比特注入另一个，从而实现逻辑T门。<sup>[18](https://arxiv.org/abs/2111.12654)</sup> 可重构原子阵列提供了另一条途径：由于[[15, 1, 3]]码是一种3D码，在二维中用局部门对其进行编码效率不高，原子阵列的可重构性为物理层面蒸馏提供了显著优势，在99.5%的当前最佳CZ门保真度下进行模拟，当输入不保真度超过约0.75%时可实现收支平衡。<sup>[3](https://www.nature.com/articles/s41534-024-00945-3)</sup> 码级联提供了一种绕过伊斯廷–奈尔定理的替代方案：将具有横向{H, S, CNOT}的[[7, 1, 3]]斯坦恩码与具有横向{T, CNOT}的[[15, 1, 3]]量子里德–穆勒码级联，可在7 × 15原子阵列上产生通用容错门集。<sup>[3](https://www.nature.com/articles/s41534-024-00945-3)</sup>

## References

1. [TGate, IBM Quantum Documentation (Qiskit)](https://quantum.cloud.ibm.com/docs/en/api/qiskit/qiskit.circuit.library.TGate)
2. [Introduction to Quantum Computing, Johannes Kepler University Linz lecture notes](https://www.jku.at/fileadmin/gruppen/180/2023_quantum_computing.pdf)
3. [Efficient fault-tolerant implementations of non-Clifford gates with reconfigurable atom arrays, npj Quantum Information (2024)](https://www.nature.com/articles/s41534-024-00945-3)
4. [An algorithm for the T-count, Microsoft Research](https://www.microsoft.com/en-us/research/publication/an-algorithm-for-the-t-count/)
5. [Quantum circuit optimization with AlphaTensor, Nature Machine Intelligence (2025)](https://www.nature.com/articles/s42256-025-01001-1)
6. [Experimental magic state distillation for fault-tolerant quantum computing, Nature Communications 2, 169 (2011)](https://www.nature.com/articles/ncomms1166)
7. [Permutation gates in the third level of the Clifford hierarchy, MIT SPUR (2024)](https://math.mit.edu/documents/spur/2024He_Robitaille_Tan.pdf)
8. [T-Depth Optimization for Fault-Tolerant Quantum Circuits, DFKI](https://www.dfki.de/web/forschung/projekte-publikationen/publikation/10453)
9. [Unified framework for magic state distillation and multiqubit gate synthesis with reduced resource cost, White Rose Research Online](https://eprints.whiterose.ac.uk/id/eprint/112413/)
10. [Unfolded distillation: very low-cost magic state preparation for biased-noise qubits, npj Quantum Information (2026)](https://www.nature.com/articles/s41534-026-01197-z)
11. [Daniel Litinski (2019). Magic State Distillation: Not as Costly as You Think. arXiv:1905.06903; Quantum 3, 205](https://arxiv.org/abs/1905.06903)
12. [Very low overhead fault-tolerant magic state preparation using redundant ancilla encoding and flag qubits, npj Quantum Information (2020)](https://www.nature.com/articles/s41534-020-00319-5)
13. [T-count and Qubit Optimized Quantum Circuit Design of the Non-Restoring Square Root Algorithm, arXiv:1712.08254](https://arxiv.org/abs/1712.08254)
14. [Qrisp-Based Implementation and Experimental Evaluation of a T-Count-Optimized Non-Restoring Quantum Square-Root Circuit, Electronics (2025)](https://www.mdpi.com/2079-9292/15/11/2334)
15. [T-Count Optimization and Reed–Muller Codes, IEEE](https://ieeexplore.ieee.org/document/8672175)
16. [Lower T-count with faster algorithms, Quantum (2025)](https://quantum-journal.org/papers/q-2025-09-16-1860/)
17. [The T-Complexity Costs of Error Correction for Control Flow in Quantum Computation, Proceedings of the ACM on Programming Languages](https://doi.org/10.1145/3656397)
18. [Demonstration of fault-tolerant universal quantum gate operations, arXiv:2111.12654](https://arxiv.org/abs/2111.12654)
19. [mathworks.com](https://www.mathworks.com/help/matlab/ref/tgate.html)
20. [TGate (v1.2), IBM Quantum Documentation](https://quantum.cloud.ibm.com/docs/en/api/qiskit/1.2/qiskit.circuit.library.TGate)

---
*Initially written Oct 15, 2026 · Edited: Oct 25, 2026*

Topic: 物质世界与数学 › 物理学 › 量子物理学 › Quantum information science › Quantum computing and algorithms › Quantum gates and circuits › Single-qubit gates

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/t-gate

English original: https://www.edgepedia.org/t-gate
