# 量子算法

量子算法是在量子计算机上执行的分步过程，其中信息由能够处于叠加态并发生纠缠的量子比特承载，操作以酉变换的形式执行，最后进行测量。该领域最初是用计算机模拟物理的理论提议，20世纪90年代通过因式分解和搜索方面的里程碑成果得到推进，如今涵盖密码学、优化、模拟和机器学习应用，其中大多数仍在等待足够大的硬件来运行它们。

| 关键事实 | 详情 |
|---|---|
| 肖尔算法 | 多项式时间量子因式分解算法，最早于1994年作为会议论文发表，1997年作为期刊论文发表；它也能求解离散对数<sup>[1](https://quantum.cloud.ibm.com/learning/en/courses/fundamentals-of-quantum-algorithms/phase-estimation-and-factoring/introduction)</sup> |
| 格罗弗算法 | 在 O(√N) 步内搜索 N 种可能性，相较经典无序搜索实现二次改进，并且可证明对穷举搜索最优<sup>[2](https://arxiv.org/abs/quant-ph/9605043)</sup><sup> • </sup><sup>[3](https://arxiv.org/abs/quant-ph/0201152)</sup> |
| 核心子程序 | 量子傅里叶变换和量子相位估计是肖尔算法以及许多其他算法的基础<sup>[4](https://quantum.cloud.ibm.com/learning/en/modules/computer-science/qft)</sup> |
| 硬件要求 | 运行肖尔的破码算法可能需要数百万个量子比特，才能实现容错执行，并在其有限运行过程中保证可靠性<sup>[5](https://www.nist.gov/quantum-information-science/quantum-computing-explained)</sup><sup> • </sup><sup>[22](https://www.preskill.caltech.edu/pubs/preskill-1998-reliable.pdf)</sup> |
| 模拟优势 | 在模拟具有许多量子自由度的系统时，量子算法可以优于经典算法<sup>[6](https://www.nationalacademies.org/read/25196/chapter/5)</sup> |
| 实践中的注意事项 | 在现实世界中，格罗弗算法对密码学的优势较小，因为攻击会利用大规模并行经典处理<sup>[7](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-131Ar3.ipd.pdf)</sup> |

## 起源

1981年，在波士顿郊外的一次物理学家聚会上，理查德·费曼（Richard Feynman）谈到了用计算机模拟物理的可能性。这场演讲常被认为开创了该领域<sup>[5](https://www.nist.gov/quantum-information-science/quantum-computing-explained)</sup>。首批用于基于门电路的哈密顿量模拟的具体量子算法于20世纪90年代中期提出，后来的算法洞见显著缩短了运行时间<sup>[6](https://www.nationalacademies.org/read/25196/chapter/5)</sup>。

随后不久，两项成果确立了该领域的雄心。1994年，数学家彼得·肖尔（Peter Shor）发表了一种量子算法，能够快速分解公钥密码学中使用的大数，这立刻使量子计算成为国家安全问题<sup>[5](https://www.nist.gov/quantum-information-science/quantum-computing-explained)</sup>。该算法展示了量子计算的潜在威力，因为目前尚无已知的高效经典因式分解方法<sup>[8](https://doi.org/10.1103/RevModPhys.68.733)</sup>。1996年，洛夫·K·格罗弗（Lov K. Grover）描述了一种量子搜索算法，能在 O(√N) 步内从 N 个条目的非结构化数据库中找到被标记的条目，而任何经典算法至少需要 N/2 次查找才能以 50% 的概率成功<sup>[2](https://arxiv.org/abs/quant-ph/9605043)</sup>。

## 量子算法如何获得速度优势

量子算法利用叠加、纠缠和干涉。一个量子比特寄存器可以同时容纳许多计算态的叠加；每增加一个量子比特，组合数就翻倍，呈指数增长<sup>[5](https://www.nist.gov/quantum-information-science/quantum-computing-explained)</sup>。真正起作用的资源是干涉，而非并行性：通过调整操作的相位，成功的计算相互增强，而其他计算相互抵消<sup>[2](https://arxiv.org/abs/quant-ph/9605043)</sup>。

这种增益受测量限制。虽然计算可以在叠加态中完成，但最终测量只能提取关于所有这些计算的一小部分信息，因此叠加并不能实现对全部潜在解的高效暴力搜索<sup>[5](https://www.nist.gov/quantum-information-science/quantum-computing-explained)</sup>。每种算法的关键在于设计测量，使其提取关于整个结果集合的有用信息<sup>[5](https://www.nist.gov/quantum-information-science/quantum-computing-explained)</sup>。

## 主要算法与子程序

**肖尔算法。** 因式分解可归约为求阶问题，而量子相位估计可以求解求阶问题。量子傅里叶变换（QFT）是离散傅里叶变换的量子对应，可在计算基与傅里叶基之间转换，并能由量子电路高效实现<sup>[4](https://quantum.cloud.ibm.com/learning/en/modules/computer-science/qft)</sup>。量子相位估计利用酉算子的受控幂和逆 QFT 来估计酉算子的特征值，依赖相位回踢机制<sup>[4](https://quantum.cloud.ibm.com/learning/en/modules/computer-science/qft)</sup>。肖尔还发现了针对计算离散对数这一相关问题的高效量子算法，同样发表于 1994 年的那篇会议论文和 1997 年的那篇期刊论文中<sup>[1](https://quantum.cloud.ibm.com/learning/en/courses/fundamentals-of-quantum-algorithms/phase-estimation-and-factoring/introduction)</sup>。

**格罗弗算法。** 在其通常形式中，它使用 O(√N) 次查询和 O(√N log N) 个其他基本门，在 N 个条目的数据库中找到解<sup>[9](https://arxiv.org/abs/1512.07550)</sup>。对于穷举搜索，这种二次查询加速已被证明是最优的，即查询次数无法再减少<sup>[3](https://arxiv.org/abs/quant-ph/0201152)</sup>。振幅放大与振幅估计结合了格罗弗算法和肖尔算法的思想，将二次加速扩展到一大类搜索问题以及均值估计，为蒙特卡洛方法带来近乎二次的加速<sup>[10](https://arxiv.org/abs/quant-ph/0005055)</sup><sup> • </sup><sup>[11](https://arxiv.org/abs/1504.06987)</sup>。

**哈密顿量模拟。** 模拟量子系统的动力学是量子计算机最自然的应用，也是费曼最初的动机。应用包括化学、材料科学、凝聚态、核物理和高能物理<sup>[6](https://www.nationalacademies.org/read/25196/chapter/5)</sup>。哈密顿量模拟是一个核心问题，在许多现代量子算法中充当子程序，并已被证明是 BQP 完全的<sup>[12](https://doi.org/10.1146/annurev-physchem-082624-084635)</sup>。横跨多个领域的技巧包括量子奇异值变换、LCU（酉算子线性组合）算法，以及 qDRIFT 和 QITE 等时间演化方法<sup>[12](https://doi.org/10.1146/annurev-physchem-082624-084635)</sup>。

**变分算法。** 变分量子本征求解器（VQE）是一种混合方法，包含四个组成部分：描述待优化性质的哈密顿量、制备试探态的参数化拟设电路、期望值估计器，以及改变参数的经典优化器<sup>[13](https://qiskit.qotlabs.org/learning/courses/quantum-diagonalization-algorithms/vqe)</sup>。若不借助增强方法，VQE 本身不太可能足以支撑现代实用规模的量子计算，但它是更高级算法所基于的典型经典-量子混合方法<sup>[13](https://qiskit.qotlabs.org/learning/courses/quantum-diagonalization-algorithms/vqe)</sup>。量子近似优化算法（QAOA）同样以组合优化问题的近似解为目标<sup>[14](https://docs.quantum.ibm.com/api/qiskit/0.42/qiskit.algorithms.QAOA)</sup>。

## 应用及其现状

密码学是后果最明确的案例。由于肖尔算法可在多项式时间内运行，足够大、能高效运行该算法的量子计算机最终将使广泛实施的公钥密码方案失效<sup>[15](https://tsapps.nist.gov/publication/get_pdf.cfm?pub_id=934050)</sup>。美国国家标准与技术研究院（NIST）于2016年启动后量子密码学标准化工作，征集对经典计算机和量子计算机都难以处理的算法，其首批公布的标准基于结构化格和哈希函数<sup>[16](https://www.nist.gov/cybersecurity-and-privacy/what-post-quantum-cryptography)</sup>。

分子与材料的量子模拟是最常被认为具有潜在变革性的应用，候选用途包括药物发现，以及用于肥料生产或温室气体捕集的更好的催化剂<sup>[5](https://www.nist.gov/quantum-information-science/quantum-computing-explained)</sup>。量子计算机已被用于计算小分子的能量，并模拟相互作用的原子集合的磁性<sup>[5](https://www.nist.gov/quantum-information-science/quantum-computing-explained)</sup>。

**机器学习。** 量子机器学习（QML）将量子算法应用于学习任务，已有数十种提出的 QML 算法声称比经典对应方法更快、更准确或更节能<sup>[17](https://www.lemonde.fr/sciences/article/2025/01/13/ia-versus-ordinateur-quantique-un-combat-tres-physique_6496145_1650684.html)</sup>。可扩展性是一个结构性障碍：量子数据编码成本随数据集大小线性增长，因为每个训练样本都需要执行电路；经典 GPU 通过大批量分摊成本，而量子系统则顺序处理样本或以小批量处理；采样次数开销还会随训练样本数量成倍增加<sup>[18](https://link.springer.com/article/10.1007/s10791-026-10085-1)</sup>。

## 局限

当前设备噪声大且规模小。实验量子设备受噪声和错误困扰，且缺乏足够量子比特进行容错计算<sup>[19](https://nvlpubs.nist.gov/nistpubs/ir/2025/NIST.IR.8581.pdf)</sup>。美国能源部2018年的一份报告直言，迄今为止没有任何量子算法解决过经典上难以处理的问题<sup>[20](https://science.osti.gov/-/media/bes/pdf/reports/2018/QIS_Systems_Factual_Document.pdf)</sup>，当前量子计算机主要用于探索物理、化学和数学问题，并作为构建更强大机器的试验平台<sup>[5](https://www.nist.gov/quantum-information-science/quantum-computing-explained)</sup>。

即便是理论上成立的加速，在现实条件下也会缩水。格罗弗算法对暴力密钥搜索的加速可能没有人们以为的那么显著，因为现实世界的攻击会利用大规模并行经典处理<sup>[7](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-131Ar3.ipd.pdf)</sup>。在量子化学中，近期对基态能量估计中指数量子优势证据的审视得出结论：虽然多项式加速看来可行，但跨化学空间的广泛指数增益仍未得到证明<sup>[21](https://www.nature.com/nature-index/topics/l4/quantum-algorithms-for-molecular-simulations)</sup>。研究分子动力学变分方法的研究者判断，这类量子算法只有在尚未出现的纠错量子计算机上才会有意义<sup>[17](https://www.lemonde.fr/sciences/article/2025/01/13/ia-versus-ordinateur-quantique-un-combat-tres-physique_6496145_1650684.html)</sup>。

## References

1. [Introduction, Phase estimation and factoring, IBM Quantum Learning](https://quantum.cloud.ibm.com/learning/en/courses/fundamentals-of-quantum-algorithms/phase-estimation-and-factoring/introduction)
2. [Lov K. Grover (1996). A fast quantum mechanical algorithm for database search. arXiv](https://arxiv.org/abs/quant-ph/9605043)
3. [Lov K. Grover (2002). Tradeoffs in the Quantum Search Algorithm. arXiv](https://arxiv.org/abs/quant-ph/0201152)
4. [Quantum Fourier transform, IBM Quantum Learning](https://quantum.cloud.ibm.com/learning/en/modules/computer-science/qft)
5. [Quantum Computing Explained, NIST](https://www.nist.gov/quantum-information-science/quantum-computing-explained)
6. [Quantum Computing: Progress and Prospects, National Academies Press](https://www.nationalacademies.org/read/25196/chapter/5)
7. [Transitioning the Use of Cryptographic Algorithms and Key Lengths, NIST SP 800-131A r3](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-131Ar3.ipd.pdf)
8. [Artur Ekert and Richard Jozsa (1996). Quantum computation and Shor's factoring algorithm. Reviews of Modern Physics](https://doi.org/10.1103/RevModPhys.68.733)
9. [Optimizing the Number of Gates in Quantum Search, arXiv](https://arxiv.org/abs/1512.07550)
10. [Brassard, Høyer, Mosca, Tapp (2002). Quantum Amplitude Amplification and Estimation. arXiv](https://arxiv.org/abs/quant-ph/0005055)
11. [Montanaro (2015). Quantum speedup of Monte Carlo methods. arXiv](https://arxiv.org/abs/1504.06987)
12. [Quantum Computing Beyond Ground-State Electronic Structure, Annual Review of Physical Chemistry](https://doi.org/10.1146/annurev-physchem-082624-084635)
13. [The variational quantum eigensolver (VQE), IBM Quantum Documentation](https://qiskit.qotlabs.org/learning/courses/quantum-diagonalization-algorithms/vqe)
14. [QAOA, Qiskit API documentation](https://docs.quantum.ibm.com/api/qiskit/0.42/qiskit.algorithms.QAOA)
15. [Paving the Runway for Standardization of Post-Quantum Cryptography, NIST](https://tsapps.nist.gov/publication/get_pdf.cfm?pub_id=934050)
16. [What Is Post-Quantum Cryptography?, NIST](https://www.nist.gov/cybersecurity-and-privacy/what-post-quantum-cryptography)
17. [IA versus ordinateur quantique : un combat très physique, Le Monde (2025)](https://www.lemonde.fr/sciences/article/2025/01/13/ia-versus-ordinateur-quantique-un-combat-tres-physique_6496145_1650684.html)
18. [A review of quantum machine learning algorithms, applications, and emerging advantages, Discover Computing](https://link.springer.com/article/10.1007/s10791-026-10085-1)
19. [NIST IR 8581: Applied and Computational Mathematics Division, FY2024 Activities](https://nvlpubs.nist.gov/nistpubs/ir/2025/NIST.IR.8581.pdf)
20. [Scientific Applications of Quantum Computing, US Department of Energy Office of Science (2018)](https://science.osti.gov/-/media/bes/pdf/reports/2018/QIS_Systems_Factual_Document.pdf)
21. [Quantum Algorithms for Molecular Simulations, Nature Index](https://www.nature.com/nature-index/topics/l4/quantum-algorithms-for-molecular-simulations)
22. [preskill.caltech.edu](https://www.preskill.caltech.edu/pubs/preskill-1998-reliable.pdf)

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

Topic: 物质世界与数学 › 物理学 › 量子物理学 › Quantum information science › Quantum computing and algorithms › Quantum algorithms

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/quantum-algorithm

English original: https://www.edgepedia.org/quantum-algorithm
