English

Quantum computing processes quantum states through controlled transformations and measurements. Amplitudes can interfere, so a sequence of operations can change outcome probabilities in ways that differ from manipulating an ordinary random bit. The central algorithmic question is how to make a useful property observable with fewer resources than a suitable classical method.

A large state space is not a list of answers available for reading. Measuring a register gives an outcome, and learning a distribution generally requires repeated preparations and measurements. State preparation, gates, error correction, and extracting the desired output all contribute to cost. Some problems have quantum algorithms with important advantages; quantum computing is not a general speedup for every program.

Separate the ideal computational model from its physical implementation. A logical circuit specifies operations; hardware supplies imperfect control, connections, and measurements. Error correction encodes logical information across physical systems. Qubit count alone therefore does not say how large or reliable an algorithm a device can run.

Prerequisites: Complex-number linear algebra (§2.3), probability (§2.5), and basic complexity analysis (§3.3). Single-qubit circuits and two-qubit correlations provide a starting point before advanced quantum mechanics or error-correction theory.

From Physical Models to Algorithms and Error Correction

Quantum computing developed from several questions about physics and information. Benioff examined quantum-mechanical models of computation, while Feynman’s 1981 discussion, published in 1982, emphasized simulating quantum physics. A general many-body state can be expensive to represent classically, but special states and dynamics can have compact descriptions. The motivation was to exploit physical structure, not to prove that every quantum system resists classical simulation.

Deutsch’s 1985 work formalized a universal quantum computational model. Early oracle algorithms illustrated interference and differences in query complexity. A one-bit Deutsch problem does not provide an asymptotic exponential speedup. Deutsch–Jozsa gives a separation from exact deterministic classical query algorithms under a promise; randomized classical algorithms change that comparison. Stating the computational model is part of stating the advantage.

Shor’s 1994 algorithms for factoring and discrete logarithms connected quantum computation to established mathematical and cryptographic problems. They run in polynomial time in the relevant input length in the ideal model. The best known general classical factoring algorithms are slower, but a proof that no polynomial classical factoring algorithm exists is not known. This distinction prevents a comparison with known algorithms from becoming an unsupported lower-bound claim.

Grover’s 1996 search algorithm established a quadratic improvement in oracle queries for unstructured search. Quantum error-correction and threshold results developed ways to protect information and implement longer computations under specified noise and architecture assumptions. There is no single threshold or fixed number of physical qubits per logical qubit independent of those choices.

Physical demonstrations expanded across superconducting circuits, ions, neutral atoms, and photons. Sampling experiments and logical-memory experiments test different claims. For example, surface-code work published online in 2024 demonstrated decreasing logical-memory error as code distance increased in the studied regime. That is evidence about error correction, not by itself a demonstration of an arbitrary large fault-tolerant algorithm.

Benchmarks must specify the task, accuracy, resources, and classical comparison, which can improve after a quantum result is announced. Resource estimates for useful algorithms include logical operations, physical error rates, connectivity, decoding, and runtime. They are conditional engineering analyses, not dates at which useful quantum computing is guaranteed to arrive.

Cryptography already has an engineering response to the possibility of capable quantum attackers. NIST’s first three finalized post-quantum standards in 2024 included ML-KEM, ML-DSA, and SLH-DSA. These are classical algorithms designed for post-quantum security, not algorithms requiring quantum hardware. The standards effort did not end with those first publications; migration also involves protocols, implementations, and system inventories (§4.5).

Qubits, Gates, and Algorithms

The Quantum State and Its Manipulation

A pure qubit state can be written α|0⟩ + β|1⟩, with complex amplitudes satisfying |α|²+|β|²=1. Measurement in this basis yields 0 or 1 with the corresponding squared magnitudes. Relative phase affects later operations even when it does not change the probabilities of this immediate measurement. Mixed states and noise require a more general description, commonly a density matrix.

The Hadamard gate shows why amplitudes are more than probabilities. It maps |0⟩ to (|0⟩+|1⟩)/√2 and |1⟩ to (|0⟩−|1⟩)/√2. Starting at zero, one Hadamard followed by measurement gives equal probabilities. Two Hadamards before measurement return zero with certainty in the ideal circuit: the paths contributing to one cancel. Inserting a measurement between the gates removes that interference and changes the result.

A pure state of n qubits has 2ⁿ amplitudes in the computational basis. Storing all amplitudes for 30 qubits as 16-byte complex numbers takes 16×2³⁰ bytes = 16 GiB, before extra workspace. This describes a particular classical representation, not a requirement for every simulation algorithm. Product states and other structured circuit families can be represented more compactly.

Applying a Hadamard to the first qubit of |00⟩, followed by CNOT from the first to the second, creates (|00⟩+|11⟩)/√2. This state cannot be factored into two individual pure states. Its computational-basis results are correlated, but either observer’s local result is random; correlations do not provide a controllable faster-than-light message. Some highly entangled Clifford circuits are efficiently classically simulable, so entanglement alone is not a test for computational advantage.

Ideal gates act unitarily between measurements. An algorithm arranges state preparation, transformations, and measurement so that the desired property affects an observable distribution. It must explain how the property is extracted and how many repetitions are needed. The IBM Quantum material on states and interference develops these distinctions with small systems.

Key Quantum Algorithms

Shor’s factoring method reduces part of the task to finding the order of a number modulo N. For the small example N=15 and a=2, the order is 4 because 2⁴ ≡ 1 (mod 15) and no smaller positive power gives 1. The classical step obtains gcd(2²−1,15)=3 and gcd(2²+1,15)=5. Larger instances use quantum period or phase information and classical processing, with conditions on the chosen base and recovered order. Factoring 15 by a specially simplified circuit is not a benchmark for general cryptographic-scale factoring.

The quantum Fourier transform acts on amplitudes encoded in a quantum state. An efficient circuit for that transformation does not output an exponentially long list of classical Fourier coefficients. As with state preparation, measurement is part of the algorithm’s cost and output model.

Grover’s algorithm alternates an oracle phase change with a reflection that amplifies marked outcomes. With one marked item among four, the uniform amplitudes are initially all 1/2. Negating the marked amplitude makes their mean 1/4; reflecting each amplitude about this mean gives the marked item amplitude 1 and the others 0. One ideal iteration therefore succeeds with certainty in this case. The general O(√N) claim counts oracle queries; building the oracle, accessing data coherently, and performing fault-tolerant gates still cost resources.

Quantum simulation aims to estimate properties or dynamics of quantum systems. Efficient performance depends on the Hamiltonian description, state preparation, evolution, and requested observable. Variational eigensolvers use a classical optimizer with quantum expectation estimates; noise, sampling cost, optimization difficulty, and the classical baseline determine their usefulness.

Quantum linear-system and machine-learning proposals also need an input and output accounting. Preparing a state from arbitrary classical data may be expensive, and a state encoding a solution is not the same as reading all solution entries. Sparsity, conditioning, accuracy, data access, and the requested statistic can determine whether a claimed speedup survives an end-to-end comparison.

Physical Implementations and Their Challenges

Hardware platforms provide different controls and constraints. Superconducting circuits use selected energy levels and microwave control at cryogenic temperatures. Trapped ions use internal states and controlled couplings; neutral-atom approaches use trapped atoms and interactions such as Rydberg excitation. Photonic approaches encode information in light and use optical transformations, detection, and sometimes feedforward. Sources, loss, detectors, connectivity, and control infrastructure matter as much as an isolated gate demonstration.

A physical qubit is a device-level carrier of information. A logical qubit is an encoded degree of freedom protected by a code and its operations. Syndrome measurements reveal information about errors without directly reading the encoded logical value. This is not copying an unknown quantum state. The code, measurement circuit, decoder, and noise correlations jointly determine logical performance.

The required reliability depends on the algorithm’s size. In a simple budget with G logical operation locations, each having fault probability at most p, a union bound gives probability of any such fault at most Gp. For G=10⁸ and a target of at most 0.01, this suggests p≤10⁻¹⁰ as a sufficient budget for those faults. Actual analysis must include storage, preparation, measurement, correlations, and which faults cause algorithmic failure.

Increasing code distance can suppress logical errors in an appropriate below-threshold regime, but requires more physical resources and decoding work. Magic-state preparation and routing can add substantial costs for some fault-tolerant gate sets. There is consequently no universal “1,000 physical qubits per logical qubit” conversion or fixed runtime for Shor’s algorithm.

When reading a hardware or advantage claim, identify whether it concerns physical gates, an encoded memory, logical operations, or an application result. Compare total resources and error criteria with the best relevant classical approach, and distinguish measured results from extrapolated resource estimates.

What Studying This Changes

You should be able to distinguish an amplitude from a probability, a coherent superposition from a classical mixture, and an ideal circuit from its noisy implementation. Calculate the Hadamard and Bell-state examples by hand, then check them with a small simulator.

Implement the four-item Grover example and vary the number of iterations and measurement shots. Inspect both the state-vector calculation and the sampled outcomes. This makes interference, sampling uncertainty, and the difference between internal state and accessible output concrete.

For a proposed application, write down the input representation, oracle or gate costs, output required, error tolerance, and classical baseline. This resource accounting is more useful than inferring application value from a raw qubit count or a large state-space dimension.

Resources

Books and Texts

Mermin’s Quantum Computer Science develops the subject for readers with a computing background. Nielsen and Chuang provide a broader reference for circuits, information, and error correction. Hidary’s Quantum Computing: An Applied Approach connects algorithms with implementation examples. Preskill’s notes and Aaronson’s work deepen error-correction and complexity questions. Separate durable mathematical explanations from hardware and software examples tied to an edition.

Book Role Type
Nielsen & Chuang, Quantum Computation and Quantum Information Canonical comprehensive reference Reference
Mermin, Quantum Computer Science: An Introduction CS-oriented accessible entry Entry
Hidary, Quantum Computing: An Applied Approach (2nd ed.) Algorithms and implementation examples Entry
Preskill, lecture notes (free) Graduate-depth treatment; error correction Depth
Aaronson, Quantum Computing Since Democritus Conceptual and complexity context Depth

Courses and Lectures

Use the published MIT quantum computing materials, Preskill’s notes, or IBM Quantum Learning as a sequence matched to your background. First calculate simple circuits without a software package, then compare a simulator. Cloud hardware access, quotas, and admission to courses have their own conditions; access to educational material does not imply unrestricted hardware use.

Course Platform Type
MIT 8.370/18.435 Quantum Computing (free) MIT OCW / edX Entry
Preskill Ph 219 Quantum Computation (free) theory.caltech.edu Depth
IBM Quantum Learning (free materials) quantum.cloud.ibm.com/learning/en Practice
Aaronson quantum complexity course (free) scottaaronson.com Depth

Practice, Tools, and Current Sources

Quirk makes small circuits inspectable in a browser. Qiskit, Cirq, and PennyLane support different circuit and experiment workflows; select one and record the version, gate set, and noise model. Compare exact state-vector results with finite-shot measurements before using hardware results. The Error Correction Zoo helps identify what a code protects and under which assumptions; it is a reference rather than a first tutorial on quantum states.

Resource Platform Type
Qiskit SDK and simulators (free software) qiskit.org / github.com/Qiskit Practice
IBM Quantum Learning / legacy Qiskit Textbook archive quantum.cloud.ibm.com/learning/en / GitHub archive Practice
PennyLane (free) pennylane.ai Practice
Microsoft Quantum Katas (free) quantum.microsoft.com / GitHub Practice
PennyLane Codebook (free) pennylane.ai/codebook Practice
Quantum Country (free) quantum.country Auxiliary
Quirk circuit simulator (free) algassert.com/quirk Practice
Cirq (free) github.com/quantumlib/Cirq Practice
QuTiP (free) qutip.org Practice
Error Correction Zoo (free) errorcorrectionzoo.org Reference

Traps

Trap Why it misleads Better response
Imagining that all branches can be read as answers Measurement exposes an outcome, not an exponentially long amplitude table. Specify the interference and measurements that reveal the requested property.
Equating a large state space or entanglement with advantage Structured state and circuit families can admit efficient classical simulation. Identify the algorithm and the relevant classical comparison.
Ignoring data preparation and output costs A fast subroutine can depend on expensive access or return only a quantum state. Compare the complete task under the same input and output requirements.
Converting physical qubits to logical capacity with one fixed ratio Noise, code distance, connectivity, and algorithm reliability change overhead. Use a stated error model and resource estimate.
Treating a forecast or small demonstration as a general application result Compiled examples and extrapolations test narrower claims. Separate what was measured from what is assumed to scale.

中文

量子计算通过受控变换和测量处理量子态。振幅可以发生干涉,因此一系列操作改变结果概率的方式,与操纵普通随机比特不同。算法的核心问题是:怎样以少于合适经典方法的资源,让一个有用性质变得可观测?

大的状态空间不等于一份可以直接读取的答案清单。测量寄存器得到一个结果,而了解分布通常需要反复制备和测量。状态制备、量子门、纠错及提取所需输出,都构成成本。某些问题有具备重要优势的量子算法,但量子计算不会普遍加速所有程序。

应区分理想计算模型与物理实现。逻辑电路规定操作,硬件提供有误差的控制、连接和测量。纠错把逻辑信息编码到多个物理系统中。因此仅凭量子比特数量,不能判断设备可以运行多大、多可靠的算法。

前置知识:复数线性代数(§2.3)、概率(§2.5)和基本复杂度分析(§3.3)。可以从单比特电路与双比特关联入手,再学习高级量子力学或纠错理论。

从物理模型到算法与纠错

量子计算来自关于物理与信息的多种问题。Benioff 研究计算的量子力学模型,Feynman 在 1981 年讨论、1982 年发表的工作则强调模拟量子物理。一般多体态的经典表示可能很昂贵,但特殊的态与动力学可能有紧凑描述。其动机是利用物理结构,而不是证明每个量子系统都难以经典模拟。

Deutsch 的 1985 年工作形式化了通用量子计算模型。早期预言机算法展示了干涉及查询复杂度的差别。单比特 Deutsch 问题并不提供渐近意义的指数加速。Deutsch–Jozsa 在承诺条件下,相对于精确的确定性经典查询算法展示了差别;允许随机经典算法,会改变比较。因此计算模型也是优势主张的一部分。

Shor 在 1994 年提出的分解与离散对数算法,将量子计算与已有数学和密码问题联系起来。在理想模型中,它们相对于有关输入长度使用多项式时间。已知最好的通用经典分解算法更慢,但目前并没有经典多项式分解算法不可能存在的证明。这个区别避免把与已知算法的比较,误写成已经证明的下界。

Grover 的 1996 年搜索算法,对无结构搜索建立了预言机查询次数的平方级改进。量子纠错和阈值结果,则在明确的噪声与架构假设下,研究怎样保护信息并执行更长计算。不存在独立于这些选择的统一阈值,也不存在固定的物理比特与逻辑比特换算比。

物理演示扩展到超导电路、离子、中性原子和光子等平台。采样实验与逻辑存储实验检验的是不同主张。例如,2024 年在线发表的表面码研究,在研究范围内展示了随码距增大而下降的逻辑存储错误。这提供了关于纠错的证据,本身并不演示任意大型容错算法。

基准需要明确任务、准确性、资源和经典比较对象;经典方法可能在量子结果公布后继续改进。有用算法的资源估计包括逻辑操作、物理错误率、连接、解码和运行时间。这些是有条件的工程分析,不是有用量子计算必然到来的日期。

密码工程已经在回应有能力的量子攻击者出现的可能性。NIST 在 2024 年完成的首批三个后量子标准 包括 ML-KEM、ML-DSA 和 SLH-DSA。这些是在经典硬件上运行、面向后量子安全设计的算法,不需要量子硬件。标准化工作并未在首批发布后结束,迁移还涉及协议、实现和系统清单(§4.5)。

Qubits、Gates 与算法

量子态及其操作

纯态量子比特可以写成 α|0⟩ + β|1⟩,复振幅满足 |α|²+|β|²=1。在这组基中测量,以对应的模平方概率得到 0 或 1。相对相位即使不改变立即测量的概率,也会影响后续操作。混态与噪声需要更一般的描述,通常使用密度矩阵。

Hadamard 门说明了振幅为什么不只是概率。它把 |0⟩ 映射为 (|0⟩+|1⟩)/√2,把 |1⟩ 映射为 (|0⟩−|1⟩)/√2。从零开始,施加一次 Hadamard 再测量,两种结果等概率;测量前连续施加两次 Hadamard,理想电路则必然返回零,因为对结果一的振幅贡献相互抵消。在两个门之间插入测量,会消除这种干涉并改变结果。

n 个量子比特的纯态,在计算基中有 2ⁿ 个振幅。若每个复数使用 16 字节,存储 30 个量子比特的全部振幅需要 16×2³⁰ bytes = 16 GiB,还未计额外工作空间。这描述的是一种经典表示,不是每种模拟算法都必须付出的成本。乘积态和其他具有结构的电路族,可以更紧凑地表示。

对 |00⟩ 的第一个比特施加 Hadamard,再以第一个控制第二个施加 CNOT,得到 (|00⟩+|11⟩)/√2。这个态不能分解为两个单独纯态的乘积。计算基测量结果相关,但每个观察者的本地结果仍然随机;关联不能提供可控制的超光速消息。某些高度纠缠的 Clifford 电路可以高效经典模拟,因此仅有纠缠不能判定计算优势。

理想门在测量之间实施酉变换。算法安排状态制备、变换和测量,使目标性质影响可观察的分布,并说明怎样提取该性质、需要重复多少次。IBM Quantum 关于状态与干涉的材料 用小系统展开这些区别。

关键量子算法

Shor 分解方法将部分任务化为求一个数模 N 的阶。以 N=15、a=2 为小例子,阶为 4,因为 2⁴ ≡ 1 (mod 15),且没有更小正整数次幂给出 1。经典步骤随后得到 gcd(2²−1,15)=3 和 gcd(2²+1,15)=5。更大的实例结合量子周期或相位信息与经典处理,并对所选底数、恢复的阶有相应条件。用特意简化的电路分解 15,不能作为一般密码规模分解的基准。

量子傅里叶变换作用于编码在量子态中的振幅。该变换有高效电路,不代表可以输出指数长度的经典傅里叶系数列表。与状态制备一样,测量属于算法成本和输出模型的一部分。

Grover 算法交替使用预言机相位变化与反射,放大被标记结果。若四项中有一项被标记,初始均匀振幅均为 1/2。将被标记振幅取反后,振幅均值为 1/4;再把每个振幅关于该均值反射,被标记项变成 1,其他项变成 0。因此在这个例子中,一次理想迭代必然成功。一般的 O(√N) 主张计算的是预言机查询次数;构造预言机、相干访问数据和执行容错门,仍然消耗资源。

量子模拟旨在估计量子系统的性质或动力学。是否高效,取决于哈密顿量描述、状态制备、演化和所需可观测量。变分本征求解器把经典优化器与量子期望估计结合起来,噪声、采样成本、优化困难和经典基线共同决定其用途。

量子线性系统与机器学习方案,同样需要核算输入和输出。从任意经典数据制备量子态可能昂贵,编码了解的状态也不等于读出了所有解分量。稀疏性、条件数、精度、数据访问方式和目标统计量,可能决定所谓加速是否在端到端比较中仍然成立。

物理实现及其挑战

硬件平台提供不同控制方式与约束。超导电路在低温下使用选定能级和微波控制。囚禁离子使用内部态与受控耦合,中性原子方法使用被俘获的原子及里德堡激发等相互作用。光子方法在光中编码信息,使用光学变换、探测,有时也使用前馈。光源、损耗、探测器、连接和控制基础设施,与单个量子门的演示同样重要。

物理量子比特是设备层的信息载体,逻辑量子比特是通过编码及其操作保护的自由度。综合征测量揭示错误信息,而不直接读取被编码的逻辑值;这不是复制未知量子态。编码、测量电路、解码器及噪声相关性,共同决定逻辑表现。

所需可靠性取决于算法规模。在一个简化预算中,设有 G 个逻辑操作位置,每处故障概率至多为 p,并集界给出任意此类故障的概率至多为 Gp。若 G=10⁸,目标不超过 0.01,则 p≤10⁻¹⁰ 可作为这些故障的充分预算。实际分析还必须包括存储、制备、测量、相关性,以及哪些故障会导致算法失败。

在适当的低于阈值区间,增加码距可以抑制逻辑错误,但需要更多物理资源与解码工作。对于一些容错门集,魔态制备和路由还会增加显著成本。因此不存在通用的“1,000 个物理比特换一个逻辑比特”,也不存在固定的 Shor 算法运行时间。

阅读硬件或优势主张时,应辨认它涉及物理门、编码存储、逻辑操作,还是应用结果。用相同错误标准,比较总资源与相关的最佳经典方法,并区分实测结果和外推的资源估计。

学习这一部分会改变什么

学完后,应能区分振幅与概率、相干叠加与经典混合,以及理想电路与有噪声的实现。手算 Hadamard 和 Bell 态的例子,再用小型模拟器检查。

实现四项搜索的 Grover 例子,改变迭代次数和测量次数,同时查看态向量计算与采样结果。这样可以具体理解干涉、采样不确定性,以及内部状态和可获取输出之间的区别。

评价一个应用方案时,写出输入表示、预言机或门的成本、所需输出、错误容差与经典基线。这样的资源核算,比从原始比特数量或状态空间维度直接推断应用价值更有用。

资源

书籍与文本

Mermin 的 Quantum Computer Science 面向有计算背景的读者展开主题。Nielsen 与 Chuang 提供更广的电路、信息与纠错参考。Hidary 的 Quantum Computing: An Applied Approach 将算法与实现例子联系起来。Preskill 的讲义与 Aaronson 的工作,进一步研究纠错和复杂度。应区分稳定的数学解释与特定版本中的硬件、软件例子。

书籍 作用 类型
Nielsen & Chuang, Quantum Computation and Quantum Information 经典综合参考 参考
Mermin, Quantum Computer Science: An Introduction 面向 CS 的易读入口 入门
Hidary, Quantum Computing: An Applied Approach(第 2 版) 算法与实现例子 入门
Preskill, lecture notes(免费) 研究生深度处理;纠错 深入
Aaronson, Quantum Computing Since Democritus 概念与复杂性语境 深入

课程与讲座

可以根据自己的基础,选择公开的 MIT 量子计算 材料、Preskill 讲义 或 IBM Quantum Learning 作为学习顺序。先不依赖软件包计算简单电路,再与模拟器比较。云硬件访问、配额及课程参与有各自条件,能够访问学习材料,不等于能无限使用硬件。

课程 平台 类型
MIT 8.370/18.435 Quantum Computing(免费) MIT OCW / edX 入门
Preskill Ph 219 Quantum Computation(免费) theory.caltech.edu 深入
IBM Quantum Learning(免费材料) quantum.cloud.ibm.com/learning/en 实践
Aaronson quantum complexity course(免费) scottaaronson.com 深入

实践、工具与当前资料

Quirk 让人能在浏览器里检查小电路。Qiskit、Cirq 和 PennyLane 支持不同的电路与实验流程;选择一种,并记录版本、门集和噪声模型。在使用硬件结果之前,先比较精确态向量计算与有限次测量。Error Correction Zoo 帮助查找一种编码保护什么、依赖哪些假设,它是参考资料,而不是量子态的第一份教程。

资源 平台 类型
Qiskit SDK 与模拟器(免费软件) qiskit.org / github.com/Qiskit 实践
IBM Quantum Learning / 旧 Qiskit Textbook 存档 quantum.cloud.ibm.com/learning/en / GitHub 存档 实践
PennyLane(免费) pennylane.ai 实践
Microsoft Quantum Katas(免费) quantum.microsoft.com / GitHub 实践
PennyLane Codebook(免费) pennylane.ai/codebook 实践
Quantum Country(免费) quantum.country 辅助
Quirk circuit simulator(免费) algassert.com/quirk 实践
Cirq(免费) github.com/quantumlib/Cirq 实践
QuTiP(免费) qutip.org 实践
Error Correction Zoo(免费) errorcorrectionzoo.org 参考

陷阱

误区 为什么会误导 更好的做法
以为所有分支都能作为答案读出 测量提供一个结果,而不是指数长度的振幅表。 说明通过什么干涉和测量揭示目标性质。
把大状态空间或纠缠等同于优势 有结构的态与电路族可能支持高效经典模拟。 明确算法与相关经典比较对象。
忽略数据制备与输出成本 快速子程序可能依赖昂贵访问,或只返回量子态。 在相同输入输出要求下比较完整任务。
用固定比例把物理比特换成逻辑能力 噪声、码距、连接和算法可靠性要求都会改变开销。 使用明确的错误模型和资源估计。
把预测或小演示当成一般应用结果 专门化例子和外推检验的是更窄的主张。 区分已经测得什么,以及假定什么能够扩展。