自己实现小型模拟器
Build a small simulator
理解复振幅数组、单比特门、受控门、测量采样与 O(2ⁿ) 状态存储的边界。
Work with complex-amplitude arrays, single-qubit and controlled gates, measurement sampling, and the O(2ⁿ) state-storage limit.
QUANTUM COMPUTING · HANDS-ON TRACK
理论 21 天之后,用代码把“理解”变成“可运行、可测试、可解释”。当前开放 statevector、线路 IR、Deutsch–Jozsa/Grover、QFT/相位估计、N=15 周期骨架、噪声/重复码、VQE、QAOA 与 Qiskit 编译工作流;真实 QPU 作业由用户在自己的 Qiskit 环境中选择执行。
After the 21-day theory course, turn understanding into code that runs, tests, and explains results. Statevector, circuit IR, Deutsch–Jozsa/Grover, QFT/phase estimation, the N=15 period outline, noise/repetition-code, VQE, QAOA, and a Qiskit transpilation workflow are available; users submit real QPU jobs from their own configured Qiskit environment.
当前页面的模拟完全在浏览器本地运行;不需要账户、API key 或量子硬件。The simulator on this page runs locally in your browser; no account, API key, or quantum hardware is required.
理解复振幅数组、单比特门、受控门、测量采样与 O(2ⁿ) 状态存储的边界。
Work with complex-amplitude arrays, single-qubit and controlled gates, measurement sampling, and the O(2ⁿ) state-storage limit.
路线覆盖 Deutsch–Jozsa、Grover、QFT/相位估计、Shor 小规模示例、VQE 与 QAOA;以基准态、理论分布和经典结果交叉测试。
The roadmap covers Deutsch–Jozsa, Grover, QFT/phase estimation, a small Shor example, VQE, and QAOA—with reference states, distributions, and classical cross-checks.
学习噪声与基础纠错、Qiskit 构建和编译;再把理想模拟、含噪模拟与可选 QPU 结果放在一起分析。
Study noise and introductory error correction, build and transpile with Qiskit, then compare ideal, noisy, and optional QPU results.
能力边界:这是一条进阶实作路线,不保证仅凭阅读就达到独立研究水平。Day 1–8 教学材料和本地演示已完成;真实 QPU 作业需用户自行安装 Qiskit、管理服务商账户/凭据、选择真实后端并承担费用/排队限制,本网站不会上传凭据或声称代为运行硬件。
Scope: This advanced path is not a guarantee of research-level independence. Day 1–8 teaching material and local demos are complete. Real QPU jobs require users to install Qiskit, manage provider accounts/credentials, choose a real backend, and account for cost and queue limits; this site neither collects credentials nor claims to run hardware jobs.
复数振幅、H/X/Z/Ry、CNOT、规范化、固定种子测量与单元测试。
Complex amplitudes, H/X/Z/Ry, CNOT, normalization, seeded measurement, and unit tests.
加入门序列、受控旋转、位序约定、测量映射、Bell 态与性质测试。
Add gate sequences, controlled rotations, bit-order conventions, measurement maps, Bell states, and property tests.
从 oracle 到目标概率,写小规模穷举基准,检查查询轮数和过冲。
Implement oracles and target probabilities, add small exhaustive classical baselines, and test query counts and overshoot.
实现小位宽 QFT / 逆 QFT,比较精确相位与网格外相位;用理想化本征相位模型探索 N=15 周期和经典后处理。
Implement small-width QFT/inverse QFT, compare exact and off-grid phases, and explore N=15 periods and classical post-processing with an explicitly idealized eigenphase model.
加入退相位、振幅弛豫与读出错误,跑三比特重复码综合征;区分缓解、纠错与后选择。
Add dephasing, amplitude damping, and readout faults; simulate a three-qubit repetition-code syndrome and distinguish correction from post-selection.
用小型 Hamiltonian、参数化线路、期望值测量和经典优化器,比较精确基态、shot 噪声与优化稳定性。
Use a small Hamiltonian, parameterized circuit, expectation measurements, and a classical optimizer; compare exact ground states, shot noise, and optimizer stability.
把三角形 Max-Cut 写成代价 Hamiltonian,运行 p=1 交替算子线路,观察切分分布并与经典穷举最优值比较。
Encode triangle Max-Cut as a cost Hamiltonian, run a p=1 alternating-operator circuit, inspect the cut distribution, and compare with the exhaustive classical optimum.
查看 Qiskit 本地构建/编译的可复现命令,交互比较逻辑线路与受限拓扑上的 SWAP 路由;真实云硬件提交仅提供用户侧步骤,不伪造任务或结果。
Follow reproducible Qiskit build/transpile commands and interactively compare a logical circuit with SWAP routing on a constrained topology; real cloud hardware submission is documented as user-side steps, never fabricated.
模拟器用长度为 2ⁿ 的复数向量保存 n 个量子比特的振幅。下方使用两比特电路:先施加 H,再施加 CNOT,就会得到 Bell 态;你可以逐个加门,查看振幅、概率并做固定种子采样。
A simulator stores amplitudes for n qubits in a complex vector of length 2ⁿ. Use the two-qubit circuit below: apply H, then CNOT, to prepare a Bell state. Add gates one at a time and inspect amplitudes, probabilities, and seeded samples.
Add gates or run a measurement.
|ψ⟩ = Σₓ αₓ|x⟩ Norm squared = 1.000000000000 Gate sequence: (no gates yet) |00⟩ 1.0000 + 0.0000i P = 100.00% |01⟩ 0.0000 + 0.0000i P = 0.00% |10⟩ 0.0000 + 0.0000i P = 0.00% |11⟩ 0.0000 + 0.0000i P = 0.00%
线路中间表示(IR)把“要执行哪些门、按什么顺序执行”保存成数据,再从 |00⟩ 重放。测量映射则明确指定经典位 cᵢ 记录哪个量子位;下面可构建门序列、检查 IR,并对照两种位序下的测量结果。
A circuit intermediate representation (IR) stores which gates to execute and in what order, then replays them from |00⟩. A measurement map explicitly defines which qubit is recorded in each classical bit cᵢ. Build a gate sequence, inspect its IR, and compare outcomes under two bit orders.
Add gates to inspect the circuit IR; measurement uses the selected bit order.
{
"numQubits": 2,
"gates": [],
"measurementMap": [
0,
1
],
"basisOrder": "q0 is the least-significant bit",
"classicalBits": [
{
"classicalBit": 0,
"measuredQubit": 0
},
{
"classicalBit": 1,
"measuredQubit": 1
}
],
"displayOrder": "c1 … c0"
}
|ψ⟩ = Σₓ αₓ|x⟩ Norm squared = 1.000000000000 |00⟩ 1.0000 + 0.0000i P = 100.00% |01⟩ 0.0000 + 0.0000i P = 0.00% |10⟩ 0.0000 + 0.0000i P = 0.00% |11⟩ 0.0000 + 0.0000i P = 0.00%
位序要点:映射数组第 i 项表示 cᵢ ← q[mapping[i]]。因此 [0,1] 时 c0 取 q0、c1 取 q1;结果字符串按 c1c0 显示。Bell 态对换位序后仍是 00/11;用 X(q0) 制备 |01⟩ 才能直观看到映射改成 [1,0] 后显示为 |10⟩。
Bit-order rule: Entry i of the map means cᵢ ← q[mapping[i]]. With [0,1], c0 reads q0 and c1 reads q1; outcome strings display c1c0. A Bell state remains 00/11 when the map is reversed. Prepare |01⟩ with X(q0) to see it displayed as |10⟩ under [1,0].
两个算法都用黑盒 oracle 学习查询复杂度,但问题不同:Deutsch–Jozsa 在“常量或平衡”的 promise 下分类函数;Grover 为未排序搜索放大目标态振幅。下方运行的是可检查门序列的 2 输入位 / 4 项小型理想 statevector 实验,不是硬件运行,也不代表量子计算对所有任务都有指数加速。
Both algorithms illustrate oracle query complexity, but solve different problems: Deutsch–Jozsa classifies a function under a constant-or-balanced promise; Grover amplifies the marked state in an unstructured search. These are small ideal statevector experiments (two input bits / four items), not hardware runs or evidence that quantum computing gives exponential speedups for every task.
函数 oracle 实现 |x,y⟩ → |x, y XOR f(x)⟩。辅助位先制备为 |−⟩,让函数值变成相位;末尾对输入位做 H。若 f 为常量,测得输入 00;若 f 平衡,00 的概率为零。这个“1 次量子 oracle 查询 vs 最坏 3 次经典确定性查询”只针对两输入位且保证属于 promise 集的查询模型。
The function oracle implements |x,y⟩ → |x, y XOR f(x)⟩. Preparing the ancilla in |−⟩ turns function values into phases; Hadamards on the input bits reveal the result. A constant function yields input 00, while a balanced function gives it zero probability. “One quantum oracle query vs at most three deterministic classical queries” applies only to this two-input-bit promise problem.
Choose an oracle that satisfies the promise, then run the experiment.
四个候选态中标记一个,初态均匀叠加。每轮由 phase oracle 和 diffuser 组成;目标概率理论上为 sin²((2k+1)θ),其中 sin²θ=1/4。此 N=4 示例 k=1 恰好达到 100%;k=0 仅 25%,继续到 k=2 又降至 25%,展示离散迭代的过冲。一般搜索需按目标数量选择轮数,不能把本例的一轮当作通用规则。
Mark one of four candidates in a uniform superposition. Each round applies a phase oracle and diffuser; the theoretical success probability is sin²((2k+1)θ), where sin²θ=1/4. Here k=1 happens to reach 100%; k=0 gives 25%, and another round (k=2) drops back to 25%, illustrating discrete-iteration overshoot. General searches must choose iterations based on the number of marked items—one round is not a universal rule.
Choose a marked state and iteration count, then run the search.
实验边界:oracle 已编译成当前模拟器支持的 H/X/CNOT 门,显示的线路门数不包含噪声、硬件路由或编译开销;此处“查询次数”按 oracle 使用次数计,不等同于基础门数。全部计算在浏览器本地完成,采样是固定种子伪随机模拟。
Scope: Oracles are decomposed into H/X/CNOT gates supported by this simulator. Displayed gate counts exclude noise, hardware routing, and compilation overhead. “Query count” counts oracle uses, not elementary gates. All computation runs locally in the browser, and sampling uses a seeded pseudorandom generator.
QFT 把基态索引编码为相位斜坡;逆 QFT 把相位转回可测频率。本实验使用 q0 为最低有效位、最多 5 个量子位,直接构造受控相位门序列,并以正逆变换回到输入态作为校验。所有结果都是浏览器本地的理想 statevector 模拟。
The QFT encodes a basis index as a phase ramp; the inverse QFT turns phase back into measurable frequency. This lab constructs controlled-phase gate sequences using q0 as the least-significant bit, up to five qubits, and checks the transform by applying QFT followed by its inverse. Results are ideal statevector simulations in your browser.
Choose a basis input and transform, then run.
用 4 个估计位构造相位回踢,再施加逆 QFT。可输入相位 φ∈[0,1):当 φ=k/16 时理论结果集中在 k;偏离 1/16 网格时概率会展宽。这里的本征相位是直接编码到估计寄存器的可控模型,不包含通用目标寄存器或真实模乘 oracle。
With four estimation qubits, encode phase kickback and apply the inverse QFT. Enter φ∈[0,1): when φ=k/16, the ideal result is concentrated at k; phases between grid points spread probability across outcomes. This directly encodes a known eigenphase in a controlled model—it does not implement a general target register or a modular-multiplication oracle.
Choose a grid-aligned or off-grid phase, then run phase estimation.
选择与 15 互素的底数 a,查看相位测量 y/16 的连分数分母候选;经典端验证 aʳ mod 15=1,再在 r 为偶数且 a^(r/2)≠−1 mod 15 时计算 gcd(a^(r/2)±1,15)。y=0、分母不可靠或因子条件失败都要重试。为控制范围,本演示用经典枚举得到参考周期,并将该周期的本征相位等权混合后送入 4 位 QPE;这不是完整可逆模指数电路,也不是 Shor 量子加速或 QPU 运行。非互素底数会由经典 gcd 预检直接给出因子。
Choose a base a coprime to 15 and inspect continued-fraction denominator candidates for measured y/16. Classical post-processing verifies aʳ mod 15=1, then computes gcd(a^(r/2)±1,15) only when r is even and a^(r/2) is not −1 mod 15. y=0, unreliable denominators, and failed factor conditions require retries. To keep this lab bounded, a classical enumeration supplies the reference period; an equal mixture of its eigenphases is passed through four-bit QPE. This is not a reversible modular-exponentiation circuit, a demonstration of Shor speedup, or a QPU run. A non-coprime base returns a factor through a classical gcd pre-check.
Choose a base and run idealized period finding with classical post-processing.
验收练习:验证 3 位 QFT 后接逆 QFT 回到 |x⟩;用 φ=5/16 检查只出现 y=5,用 φ=0.30 观察主峰向 y=5 附近展宽;运行 a=2 与 a=4 比较恢复 r=4、r=2 及因子 3、5;再用 a=3 解释 gcd 预检为何已足够。QPE 的 shot 采样与 Shor 模型均固定种子、完全本地执行。
Exercises: Verify that a three-qubit QFT followed by its inverse returns |x⟩. For φ=5/16, only y=5 should appear; for φ=0.30, inspect the broadened peak near y=5. Compare a=2 and a=4 to recover r=4 and r=2 and factors 3 and 5, then explain why the gcd pre-check suffices for a=3. QPE sampling and the Shor model are seeded, local simulations.
对三物理比特编码态逐次采样独立 X 翻转、Z 退相位、振幅弛豫与经典读出错误。可以切换 bit-flip 码(|000⟩/|111⟩)和 phase-flip 码(|+++⟩/|---⟩),看综合征如何定位单个可纠错误;比较未经处理的逻辑读出、综合征纠正和只保留零综合征的后选择。这里是独立噪声的 Monte Carlo 轨迹模型,不含门故障、泄漏、相关噪声或完整容错架构。
Sample independent X flips, Z dephasing, amplitude damping, and classical readout faults on a three-physical-qubit encoded state. Switch between the bit-flip code (|000⟩/|111⟩) and phase-flip code (|+++⟩/|---⟩), inspect how syndromes locate a single correctable error, and compare raw logical readout, syndrome correction, and post-selection that keeps only zero-syndrome shots. This Monte Carlo trajectory model omits gate faults, leakage, correlated noise, and full fault-tolerant architecture.
Set noise strengths, then run the seeded trajectory simulation.
判读要点:综合征 s₀=q₀⊕q₁、s₁=q₁⊕q₂;01、11、10 分别指向 q₀、q₁、q₂ 单错。纠错是按综合征主动翻转相应物理位;后选择只丢弃非零综合征样本,会降低有效样本数但不能发现 000→111 这种零综合征逻辑错;读出错误也会污染综合征。重复码只能纠正所选基底中的单一 Pauli 翻转,另一类 Pauli 错误可能成为逻辑错误。
How to read it: s₀=q₀⊕q₁ and s₁=q₁⊕q₂; 01, 11, and 10 point to single-qubit errors on q₀, q₁, and q₂. Correction actively flips the indicated physical bit. Post-selection merely discards nonzero syndromes, reducing usable shots while missing zero-syndrome logical errors such as 000→111; readout faults also corrupt syndromes. A repetition code corrects one Pauli-flip type in its chosen basis; the complementary type can become a logical error.
变分量子本征求解器(VQE)在参数化线路中制备 |ψ(θ,φ)⟩,分别估计 Hamiltonian 各 Pauli 项的期望值,再由经典优化器调整参数。这里使用两比特各向同性 Heisenberg 模型 H = ½(XX + YY + ZZ):已知精确基态是单重态,能量 −1.5;本实验的小型 ansatz 可以到达该状态,方便检查测量和优化是否正确。
The variational quantum eigensolver (VQE) prepares |ψ(θ,φ)⟩ with a parameterized circuit, estimates each Pauli term in the Hamiltonian, and lets a classical optimizer update the parameters. This two-qubit isotropic Heisenberg model is H = ½(XX + YY + ZZ). Its known singlet ground state has energy −1.5; the compact ansatz here can reach it, making measurements and optimization easy to verify.
线路顺序为 X(q0) → Ry(q1, θ) → CNOT(q1→q0) → Rz(q1, φ)。q0 是最低有效位。θ=π/2、φ=π 时制备单重态(忽略全局相位)。每个 Pauli 项使用独立测量基底,每项采样 shots 次,所以总采样数为 3×shots。
The gate order is X(q0) → Ry(q1, θ) → CNOT(q1→q0) → Rz(q1, φ), with q0 as the least-significant bit. θ=π/2 and φ=π prepare the singlet up to global phase. Each Pauli term is measured in its own basis with the requested number of shots, so the total is 3×shots.
Set parameters to measure the three Pauli terms, or run the classical optimizer.
模型与优化边界:精确基态能量 −1.5 来自这个两比特 Hamiltonian 的解析谱,不是量子硬件测得。有限 shots 分别采样 XX、YY、ZZ,因此能量估计有统计误差。演示中的参数移步梯度由本地精确 statevector 期望计算,采样能量只作并列对照、没有反馈到参数更新;真实 VQE 会受有限 shots、噪声、ansatz 表达能力、优化器与设备编译影响。
Model and optimizer limits: The exact ground energy −1.5 comes from the analytic spectrum of this two-qubit Hamiltonian, not a quantum-hardware measurement. Finite shots independently sample XX, YY, and ZZ, so the energy estimate has statistical error. This demo computes parameter-shift gradients from exact local statevector expectations; shot estimates are shown for comparison but do not feed parameter updates. Real VQE is affected by finite shots, noise, ansatz expressibility, optimizer behavior, and device transpilation.
最大割(Max-Cut)把图的顶点分到两组,目标是让尽可能多的边跨越两组。此处固定三节点三角形,三条边为 (0,1)、(1,2)、(0,2)。用 bᵢ∈{0,1} 表示分组,经典代价为 C(b)=Σ(bᵢ XOR bⱼ),对应的量子代价 Hamiltonian 为 HC=Σ(1−ZᵢZⱼ)/2;三角形无法二分,经典穷举最大割为 2 条边。
Max-Cut divides a graph's vertices into two sets and tries to maximize crossing edges. This fixed three-node triangle has edges (0,1), (1,2), and (0,2). With bᵢ∈{0,1} denoting the set, the classical cost is C(b)=Σ(bᵢ XOR bⱼ), with quantum cost Hamiltonian HC=Σ(1−ZᵢZⱼ)/2. A triangle is not bipartite, so exhaustive classical search gives a maximum cut of two edges.
p=1 QAOA 先制备均匀叠加态,再交替施加代价演化 UC(γ)=e−iγHC 与混合演化 UB(β)=e−iβ(X₀+X₁+X₂),最后测量位串。模拟器把每条边的代价门分解为 CNOT—Rz(−γ)—CNOT(忽略全局相位),混合层对每位使用 Rx(2β)。显示位串按 q₂q₁q₀ 排列,q0 是最低有效位。
For p=1, QAOA starts in a uniform superposition, alternates cost evolution UC(γ)=e−iγHC and mixer evolution UB(β)=e−iβ(X₀+X₁+X₂), then measures a bitstring. Each edge cost is decomposed into CNOT—Rz(−γ)—CNOT (up to global phase); the mixer uses Rx(2β) on each qubit. Bitstrings display as q₂q₁q₀, with q0 the least-significant bit.
Set β, γ, and shots, then run the p=1 Max-Cut QAOA circuit.
实验边界:图、线路只有 3 个量子位,statevector 与全部 8 个切分都可经典穷举。参数优化按钮是在 CPU 上做二维均匀网格搜索,目标函数取精确理想 statevector 期望,shots 仅采样最后选出的线路;这不是量子硬件运行、不是有限-shot 反馈优化,也不是量子加速证据。网格分辨率会影响得到的参数精度。
Scope: The graph and circuit use only three qubits, so the statevector and all eight cuts are classically enumerable. The optimizer performs a uniform two-dimensional grid search on the CPU using the exact ideal statevector objective; shots sample only the selected final circuit. This is not a hardware run, shot-feedback optimization, or evidence of quantum speedup. Grid resolution limits parameter precision.
Qiskit 工作流通常分为:构造 QuantumCircuit → 选择 backend/目标指令集 → transpile(门分解、布局、路由、优化)→ 在本地模拟器或真实 backend 上 run → 记录 backend 名称、shots、作业 ID 与结果。编译不是单纯“缩短门数”:受限耦合图会触发 SWAP 路由,优化级别和初始布局也会改变结果。下方线路拓扑动画是教学模型;后面列出可由用户在自己的 Qiskit 环境运行的 API 轮廓。
A typical Qiskit workflow is: build a QuantumCircuit → choose a backend/target instruction set → transpile (decompose, layout, route, optimize) → run on a local simulator or real backend → record backend, shots, job ID, and results. Transpilation is not simply gate-count reduction: limited coupling can require SWAP routing, and optimization level or initial layout can change the output. The topology demo below is pedagogical; a user-side Qiskit API outline follows.
Choose a physical topology and initial layout to generate a conceptual routing sketch.
在独立 Python 环境安装兼容版本的 Qiskit(例如 python -m pip install qiskit qiskit-aer),保存以下脚本后运行。模拟器由本地安装提供,不会创建云作业;执行前请根据安装版本核对 import 和 API 文档。
Install compatible Qiskit packages in a separate Python environment (for example, python -m pip install qiskit qiskit-aer), save the script below, and run it locally. The simulator comes from the local install and creates no cloud job; check imports and APIs against the installed version before use.
from qiskit import QuantumCircuit, transpile
from qiskit_aer import AerSimulator
qc = QuantumCircuit(3, 3)
qc.h(0)
qc.cx(0, 1)
qc.cx(1, 2)
qc.measure([0, 1, 2], [0, 1, 2])
backend = AerSimulator()
compiled = transpile(qc, backend=backend, optimization_level=1, seed_transpiler=7)
result = backend.run(compiled, shots=1024, seed_simulator=2026).result()
print("depth", compiled.depth(), "ops", compiled.count_ops())
print(result.get_counts())
真实硬件边界:本网页不包含 provider SDK、凭据输入或网络作业提交,也不显示虚构的 backend、校准值、job ID 或 QPU counts。拓扑路由结果只是固定简化规则的概念演示,并非 Qiskit transpile 输出;请勿把教学 SWAP 数当成真实编译结果。
Hardware boundary: This page includes no provider SDK, credential entry, or network job submission, and shows no fabricated backend, calibration, job ID, or QPU counts. The topology route is a conceptual demo using fixed simplified rules, not Qiskit's transpiler output; do not treat its SWAP count as a real compilation result.
把基态编号 x 写成二进制,目标量子位 q 对应掩码 2^q。当该位为 0 时,和翻转该位后的基态组成一对;对这两个振幅应用 2×2 门矩阵即可,不需要建立庞大的 2ⁿ×2ⁿ 全局矩阵。
Write basis index x in binary; target qubit q corresponds to mask 2^q. Pair each basis state whose target bit is 0 with the state obtained by flipping that bit, then apply the 2×2 gate matrix. There is no need to construct a dense 2ⁿ×2ⁿ global matrix.
mask = 1 << target
for basis in 0 .. 2^n - 1:
if basis & mask == 0:
partner = basis | mask
a0, a1 = state[basis], state[partner]
state[basis] = m00*a0 + m01*a1
state[partner] = m10*a0 + m11*a1
| 检查项 | Check | 怎样验证 | How to verify |
|---|---|---|---|
| 归一化 | Normalization | 每次幺正门后,所有振幅模方之和 Σ|αₓ|² = 1;浮点误差使用容差比较。 | After each unitary, the sum of squared amplitudes Σ|αₓ|² = 1 within a floating-point tolerance. |
| 已知态 | Known states | 验证 X|0⟩=|1⟩、H|0⟩=(|0⟩+|1⟩)/√2。 | Check X|0⟩=|1⟩ and H|0⟩=(|0⟩+|1⟩)/√2. |
| 纠缠与位序 | Entanglement and bit order | H(q0) 后接 CNOT(q0,q1),应得到 |00⟩、|11⟩ 各一半,而非相邻两个编号。 | H(q0) followed by CNOT(q0,q1) should yield equal probabilities for |00⟩ and |11⟩, not adjacent indices. |
| 测量统计 | Sampling | 计数和必须等于 shots;固定种子可复现;经验频率会围绕理论概率波动。 | Counts must sum to shots; a fixed seed is reproducible; empirical frequencies fluctuate around theoretical probabilities. |
规模边界:状态向量内存随 2ⁿ 指数增长。单个单比特门直接作用于 statevector 需要约 O(2ⁿ) 次更新;这适合学习和小规模验证,不意味着可在普通设备模拟任意大电路。
Scaling: statevector memory grows exponentially as 2ⁿ. Applying one single-qubit gate takes about O(2ⁿ) updates. This is useful for learning and small verification—not a way to simulate arbitrarily large circuits on a laptop.
本页配套代码:量子线路模拟器、算法、QFT、噪声、VQE、QAOA 与周期后处理、Day 5 噪声实验、Day 6 VQE 实验、Day 7 QAOA 实验、Day 8 拓扑路由教学模型。在项目仓库中运行 node --test tests/quantum-simulator.test.cjs 执行模拟器与算法回归测试。算法实验限于小规模本地模型;真实 QPU 作业需用户自行安装 Qiskit、管理 provider 凭据并依其文档操作,本页不会代为提交。
Companion code: statevector simulator, algorithms, QFT, noise, VQE, QAOA, and period post-processing, Day 5 noise lab, Day 6 VQE lab, Day 7 QAOA lab, and Day 8 topology-routing teaching model. Run node --test tests/quantum-simulator.test.cjs for simulator and algorithm regressions. These are small local models. Real QPU jobs require a user-managed Qiskit install and provider credentials; this page does not submit them.