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]>
1.1 KiB
1.1 KiB
容错(fault-tolerant)计算机把每个逻辑量子比特编码在许多物理量子比特中,并以快于错误积累的速度纠正错误。在常用的码上,Clifford 门(h、s、cx 及它们的乘积)作用于编码量子比特的代价很低。仅有 Clifford 门是不够的:Clifford 线路很容易用经典方法模拟(引擎的稳定子表就能做到),因此它做不了经典计算机做不到的事。
加上 T 门(绕 Z 轴旋转 π/4),门集合就成为通用的。但在表面码上,T 门不能直接作用。它要消耗一个魔术态(magic state),而魔术态要在“工厂”里通过蒸馏(distillation)制备,需要大量物理量子比特和大量时间。所以容错程序的代价,粗略来说,就是它的 T 门数(T count)。
Toffoli 门是算术运算的主力。用 Clifford+T 写出来,它需要七个 T 门;评析会统计它们(wai-quantum critique),最后一课的估算会为它们定价。