open-standards/wai/wai-quantum/course/lessons/phase/lesson.zh-CN.md
Transaction Science fb230d8a62 wai-quantum: the circuits course as data, each exercise checked by the engine, and wai-quantum learn in English and Chinese
engine::course reads the course from wai-quantum/course/: 21 lessons from a
first circuit through superposition, entanglement, interference, the standard
algorithms, noise and mitigation, error correction and fault tolerance to
resource estimates, each a Markdown text in English and Simplified Chinese and
an exercise.json with a schema. A check runs each case of an exercise (a
generator's inputs) with its intent and the verdict, measures its constraints
(the gates allowed, counts, the T count, the critique's smells, the resource
estimate's counts), and says what went wrong from the diagnostics, the verdict
and the critique, never from the solution. The tests hold every solution to
pass by proof, every known wrong answer to fail for its stated reason, and
every locale to every text and message.

wai-quantum learn shows, starts, checks, hints and explains a lesson, keeps
progress only on this machine, and speaks the language --lang or LANG names;
the command summaries and docs topics have Chinese translations held to the
English they came from. The verdict gains of_diagnostic for a generator's
refusal. llms.txt names the course.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 08:42:54 -04:00

1.1 KiB
Raw Permalink Blame History

振幅不是概率。振幅有符号,一般而言还有复数相位,而且它们会相加。当两条路径通向同一个结果时,它们的振幅可以相互加强,也可以相互抵消。这就是干涉,也是量子计算机能做、而硬币做不到的那一件事。

连续两个 Hadamard 门什么也不做:通向 |1⟩ 的路径相互抵消,通向 |0⟩ 的路径相互叠加。

OPENQASM 3.0;
include "stdgates.inc";
qubit[1] q;
bit[1] c;
h q[0];
h q[0];
c = measure q;

这个程序每次都测得 0。中间加一个相位,就会改变哪些路径相互抵消。立即测量时,相位本身是看不见的;但之后一个把 |0⟩ 和 |1⟩ 混合起来的门会把它变成不同的结果。

引擎的评析(critique)会把相互抵消的门(例如 h q[0]; h q[0];)标记为一种问题模式(smell):wai-quantum critique 会指出它及其所在的行,Studio 会在线路图上标出它。