open-standards/wai/wai-quantum/course/lessons/grover/lesson.en.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

7 lines
987 B
Markdown

Grover's algorithm searches N items for a marked one in about √N queries. Its oracle marks the item with a minus sign. A sign alone changes no outcome, so each round follows the oracle with a *diffusion*: a reflection of every amplitude about the average of all of them.
After the oracle, the marked amplitude is negative and the average falls a little below the others. Reflecting about the average lifts the marked amplitude well above the rest. Repeated about (π/4)√N times, the marked item comes up with probability close to 1. For N = 4 one round is exact: the outcome is the marked item every time.
The diffusion is a sign on |0…0⟩ between two layers of Hadamards. The Studio's example "Grover search, 3 qubits" runs two rounds on N = 8: the marked item comes up with probability 121/128.
This exercise asks for no gates that cancel: the critique's smells are part of the check. `wai-quantum critique` lists them with their lines, and **What went wrong?** quotes them.