open-standards/wai/wai-quantum/course/lessons/estimate/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

23 lines
1.6 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!-- 机器辅助翻译(machine-assisted translation):在对外推广之前,须由熟练的读者审校。 -->
*资源估算*(resource estimate)说明一台容错机器运行某个程序需要什么:多少物理量子比特、运行多长时间、需要多少个魔术态工厂。它从程序的逻辑计数出发(量子比特数、T 门数、Toffoli 门数,以及按综合所得门序列的 T 门数计算的旋转门),再加上物理模型:一种码(这里是表面码,其码距的选取要使整个运行的失败概率低于误差预算),作用在一种给定错误率和速度的物理量子比特上。
引擎直接从程序本身进行估算,估算中的每个数字都来自一个已说明的模型,并列出其假设。每份估算都会被封存(sealed),`verify` 会重新运行它:
```sh runnable
cat > carry.qasm <<'QASM'
OPENQASM 3.0;
include "stdgates.inc";
qubit[3] q;
ccx q[0], q[1], q[2];
QASM
wai-quantum estimate carry.qasm
wai-quantum estimate carry.qasm --json > carry-estimate.json
wai-quantum verify carry-estimate.json
```
Studio 的 **Estimate**(估算)面板显示同样的计数、在所选量子比特上的估算,以及量子比特数与时间之间的权衡前沿。
反计算往往是必要的(它把辅助量子比特恢复到 |0⟩,以便重复使用),而它是有代价的。这道练习的检查会对你的程序运行估算,结果会显示它给出的物理数字。
课程到此结束。配套课程《重新认识量子》会把同一个引擎带入基于干涉的学习,以及量子优势的局限。