wai-quantum-service: two worked examples that measure in the middle #338

Merged
dcharlot merged 1 commit from wai/quantum-dynamic-examples into main 2026-10-19 20:26:18 -04:00
Owner

The service's worked examples (/v1/examples, the MCP quantum_circuit_examples tool, and the console's example chips) gain two programs that measure in the middle, now that the service runs them:

  • Teleporting a qubit: ry(0.7) on q0 arrives on q2 through two mid-circuit measurements and the if corrections they select. It runs on the state vector; ⟨Z2⟩ = cos 0.7 and ⟨X2⟩ = sin 0.7 exactly, weighed over all four branches.
  • A bit flip found and undone: the three-qubit bit-flip code holding |+⟩, with a flip on the middle qubit. Two ancillas, measured in the middle, name it; if undoes it; ⟨X0⟩ = 1 after decoding. Every gate is Clifford, so it runs on the stabilizer tableau.

the_measuring_examples_show_what_they_say runs both and holds each to what its description says, and the planner test lists the methods they take.

Checked on the build host: cargo clippy --locked --all-targets -- -D warnings and cargo test --locked in wai/wai-quantum-service (60 passed). Both programs were also run against the live service before the change.

🤖 Generated with Claude Code

The service's worked examples (`/v1/examples`, the MCP `quantum_circuit_examples` tool, and the console's example chips) gain two programs that measure in the middle, now that the service runs them: - **Teleporting a qubit:** `ry(0.7)` on q0 arrives on q2 through two mid-circuit measurements and the `if` corrections they select. It runs on the state vector; ⟨Z2⟩ = cos 0.7 and ⟨X2⟩ = sin 0.7 exactly, weighed over all four branches. - **A bit flip found and undone:** the three-qubit bit-flip code holding |+⟩, with a flip on the middle qubit. Two ancillas, measured in the middle, name it; `if` undoes it; ⟨X0⟩ = 1 after decoding. Every gate is Clifford, so it runs on the stabilizer tableau. `the_measuring_examples_show_what_they_say` runs both and holds each to what its description says, and the planner test lists the methods they take. Checked on the build host: `cargo clippy --locked --all-targets -- -D warnings` and `cargo test --locked` in `wai/wai-quantum-service` (60 passed). Both programs were also run against the live service before the change. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
wai-quantum-service: two worked examples that measure in the middle
All checks were successful
repository checks / lockfiles, tests in CI, workflow hygiene, spec and section references, public text (pull_request) Successful in 1m19s
wai-quantum service / does this change touch it (pull_request) Successful in 6s
standards workspaces build + test / which workspaces this change touches (pull_request) Successful in 8s
standards workspaces build + test / joule-code-rs (joule-code/joule-code-rs, joule-code-rs, linux-arm64, true) (pull_request) Successful in 6m46s
wai-quantum service / service · linux (pull_request) Successful in 43s
wai-quantum service / service · macos (pull_request) Successful in 34s
standards workspaces build + test / macOS energy backends (pull_request) Successful in 7m5s
af14523630
Teleportation (the state vector, four branches weighed) and the three-qubit
bit-flip code with its syndrome read mid-circuit and the correction chosen by
if (the stabilizer tableau). A test runs both and holds them to what their
descriptions say.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Transaction-Science/open-standards!338
No description provided.