wai-quantum 0.6.14: design critique, equivalence, alternatives and classical shortcuts across every surface; contraction trees that sweep along the line #427

Merged
dcharlot merged 1 commit from wai/quantum-0.6.14 into main 2026-10-22 09:00:55 -04:00
Owner

Five features for WAI Quantum and two engine and service improvements, released as 0.6.14, which carries the unpublished 0.6.13. The five features are the four co-design features from the human–AI creativity research and the classical-shortcut lens. The improvements are contraction trees that sweep along the line, and the design checks on the job service.

This replaces #417 (and #405 before it). Both conflicted with main in the changelog only, because every session adds its entries at the top of the same section. These entries now sit above the 0.6.12 entry, among the other quantum entries, so new entries at the top no longer collide with them. The engine is the microscope and the judge, a local model is a muse that waits to be asked, and the reader is the author. Every figure is the engine's, and nothing changes the program until the reader applies a change.

0.6.13: the engine

  • engine::critique gives a program's measures before it runs:

    • gates by kind; one-, two- and three-qubit gates; T gates; gates off the Clifford angles;
    • depth and two-qubit depth, and the measured qubits;
    • whether it is a Clifford circuit;
    • a fidelity at reference error rates, named as a model, not a run.

    It also gives the program's smells, each with its lines and operations: gates that cancel, rotations that merge or do nothing, idle qubits, and qubits never measured. A mid-circuit measurement, reset or condition is a barrier.

  • critique::variants rewrites the program's own text with its smells fixed. It offers all the fixes, to a fixed point, and each one alone, each distinct program once. A fix touches only a statement alone on its line, and a merge keeps the user's expressions and comment. Every candidate carries its measures and the equivalence verdict. One the check finds different is never offered.

  • engine::equiv checks two programs are the same circuit up to a global phase:

    • Clifford circuits by their tableaus, at any size;
    • otherwise every basis state up to 8 qubits;
    • otherwise 3 random product states up to 22 qubits, which is evidence, not proof;
    • otherwise unchecked, with the reason.
  • engine::shortcuts lists every exact classical route the engine knows for a program, priced on it, and names the cheapest for counts, amplitudes, expectation values and one-qubit expectation values. The routes:

    • the stabilizer tableau;
    • the cut-rank sum, with the engine's order search, priced per sample including the graph-form reduction;
    • an exact matrix product state, at a rigorous bond bound: across each cut, the product of the operator Schmidt ranks of the gates crossing it, computed from their matrices;
    • the light cone of a one-qubit expectation value;
    • a tensor-network contraction of one amplitude, when asked to be thorough;
    • the state vector.

    A cheap route proves a design classically easy; none being cheap proves nothing, and the result says so. On the 70-qubit random graph-state circuit:

    • the quick check finds the cut-rank sum, widest cut 30, in 1.8 s;
    • the thorough one finds widest cut 29 (an 8 GiB table) in 238 s, and prices the tensor-network route at a largest intermediate of 2^48.
  • qasm::parse_lines gives each operation's line. draw::layout gives each gate its operation's index (op), so the diagram can mark what a smell names.

0.6.14: contraction trees that sweep along the line

  • Placed networks. Network::amplitude_split_placed builds the same network as amplitude_split, index for index, with each index's place: a qubit and a time.
  • Sweep trees. tensor_places, sweep_orders and sweep_path turn the places into the trees that sweep qubit by qubit, or time by time.
  • Seeded search. find_path_seeded and find_path_restarts_seeded score the sweeps beside the trials and polish the best of them all alike.
  • Where it's used. The engine's tensor_network method and the thorough lens take both sweeps as seeds.

On the 70-qubit random graph-state circuit, one amplitude's largest intermediate falls from 2^48 to 2^36, and its multiply-adds from 2^56.1 to 2^48.7, in the thorough lens. With 16 trials and no seeds, the search finds 2^59. The plans pinned in tests/bit_identity.rs are unchanged.

0.6.14: the design checks on the job service

  • The endpoints: POST /v1/critique, /v1/equivalent, /v1/improve and /v1/shortcuts, with the MCP tools critique_qasm, check_equivalent, improve_qasm and classical_shortcuts.
  • The bounds. They run in the service's own process:
    • each counts against the client's submissions;
    • at most two run at once, and one that waits 10 s is refused with a 503;
    • equivalence work past 4·10⁹ gate amplitudes, and a thorough search, are refused with a 422 naming the local command.
  • Smoke checks. smoke.sh checks each endpoint. It now follows a job that outlasts /v1/run's wait, as a client does, instead of failing on a loaded host.

Where it reaches

  • wai-web: engine_critique, engine_equivalent, engine_variants and engine_shortcuts, tested native and under wasm. The workflow's counts go from 4 to 6 native tests and from 6 to 8 wasm tests.
  • Quantum Studio:
    • Always-on critique. It shows the measures, each with its change since the last run, a Clifford badge and the modelled fidelity. Smells are listed with their lines and flagged on the diagram, where each gate's tooltip names its smell. Show selects the lines and marks the gates. Fix applies the engine's rewrite and says how it was checked; Undo restores the lines.
    • Alternatives. Improve offers the same circuit, cheaper: the engine's rewrites and the model's, each checked. One that is not the same circuit is listed with the reason and not offered. Explore takes an aim and asks the model for different circuits; the engine reads, measures and compares each. An atlas plots two-qubit gates against depth, and Apply puts one in the editor.
    • Predict first (opt-in). The reader names the outcome they expect and its share of the shots before the run. The counts are set against it, with a tally kept on the device.
    • The classical cost, on request. Under the critique, each route is priced and the cheapest named. Thorough adds the contraction search. A check is marked stale once the program changes.
    • The assistant asks questions first, and speaks only when asked. The stance can be set to ask questions first (the default), suggest changes, or write programs. The assistant speaks only when asked (the default), or can offer a hint, which it never sends itself, after a long-standing problem or two refused runs. New quick asks are "Ask me a question" and "Hint". New tools are critique_qasm, check_equivalent and classical_shortcuts.
  • Desktop app: native critique, equivalent, variants and shortcuts commands, the last off the window's thread.
  • wai-quantum-cli (0.1.1, released as 0.1.2):
    • critique;
    • equivalent a b, which exits 0 for the same circuit, 1 for different and 2 for unchecked;
    • improve, which prints the program to stdout and what changed to stderr;
    • shortcuts [--thorough] [--json];
    • MCP tools critique_qasm, check_equivalent, improve_qasm and classical_shortcuts, all covered by smoke.sh.
  • examples/cutrank_qasm gains probs: the exact 2^n·p of given bit strings and their linear XEB.

Tested, on the build host

Run through rb on the build host, as each workflow runs them, on this branch at current main:

  • wai-quantum: cargo test --features full --lib -- engine:: qasm:: quantum_tn:: passes. It includes:

    • the lens's seven tests, among them the bond bound held against the true Schmidt rank at every cut of 20 random circuits;
    • the sweep tests: the qubit sweep's boundary on a deep line, seeds never ending dearer than given, the plan's amplitude against the state vector, and a malformed seed ignored.

    tests/bit_identity.rs passes with its pins unchanged. Clippy finds nothing in the changed files.

  • wai-web: the engine's native tests pass 6 of 6, and its wasm tests under wasm-bindgen-test-runner pass 8 of 8, the workflow's new counts.

  • Quantum Studio: test/studio.test.mjs passes 58 of 58 checks in Chrome, against the engine package built as CI builds it. They cover:

    • the critique, the smells, Show, Fix and Undo;
    • the classical cost;
    • Improve and Explore, with and without a model;
    • predict first;
    • the assistant's defaults, tools and hint;
    • no "null" written out.
  • wai-quantum-cli: tests pass, clippy passes with and without default features, and smoke.sh holds for critique, improve, equivalent, shortcuts and the MCP tools.

  • wai-quantum-service: tests pass and clippy passes. smoke.sh holds against a service started on the build host, covering the four checks, the refused thorough search and the nine MCP tools.

  • Desktop app: tests pass, including the new commands, and clippy passes.

  • Every lockfile resolves with --locked at 0.6.14.

  • Name, comparative-prose, vanity-metric, tests-in-CI and orphan-source checks pass.

🤖 Generated with Claude Code

Five features for WAI Quantum and two engine and service improvements, released as 0.6.14, which carries the unpublished 0.6.13. The five features are the four co-design features from the human–AI creativity research and the classical-shortcut lens. The improvements are contraction trees that sweep along the line, and the design checks on the job service. This replaces #417 (and #405 before it). Both conflicted with main in the changelog only, because every session adds its entries at the top of the same section. These entries now sit above the 0.6.12 entry, among the other quantum entries, so new entries at the top no longer collide with them. The engine is the microscope and the judge, a local model is a muse that waits to be asked, and the reader is the author. Every figure is the engine's, and nothing changes the program until the reader applies a change. ## 0.6.13: the engine - **`engine::critique`** gives a program's measures before it runs: - gates by kind; one-, two- and three-qubit gates; T gates; gates off the Clifford angles; - depth and two-qubit depth, and the measured qubits; - whether it is a Clifford circuit; - a fidelity at reference error rates, named as a model, not a run. It also gives the program's smells, each with its lines and operations: gates that cancel, rotations that merge or do nothing, idle qubits, and qubits never measured. A mid-circuit measurement, reset or condition is a barrier. - **`critique::variants`** rewrites the program's own text with its smells fixed. It offers all the fixes, to a fixed point, and each one alone, each distinct program once. A fix touches only a statement alone on its line, and a merge keeps the user's expressions and comment. Every candidate carries its measures and the equivalence verdict. One the check finds different is never offered. - **`engine::equiv`** checks two programs are the same circuit up to a global phase: - Clifford circuits by their tableaus, at any size; - otherwise every basis state up to 8 qubits; - otherwise 3 random product states up to 22 qubits, which is evidence, not proof; - otherwise unchecked, with the reason. - **`engine::shortcuts`** lists every exact classical route the engine knows for a program, priced on it, and names the cheapest for counts, amplitudes, expectation values and one-qubit expectation values. The routes: - the stabilizer tableau; - the cut-rank sum, with the engine's order search, priced per sample including the graph-form reduction; - an exact matrix product state, at a rigorous bond bound: across each cut, the product of the operator Schmidt ranks of the gates crossing it, computed from their matrices; - the light cone of a one-qubit expectation value; - a tensor-network contraction of one amplitude, when asked to be thorough; - the state vector. A cheap route proves a design classically easy; none being cheap proves nothing, and the result says so. On the 70-qubit random graph-state circuit: - the quick check finds the cut-rank sum, widest cut 30, in 1.8 s; - the thorough one finds widest cut 29 (an 8 GiB table) in 238 s, and prices the tensor-network route at a largest intermediate of 2^48. - **`qasm::parse_lines`** gives each operation's line. **`draw::layout`** gives each gate its operation's index (`op`), so the diagram can mark what a smell names. ## 0.6.14: contraction trees that sweep along the line - **Placed networks.** `Network::amplitude_split_placed` builds the same network as `amplitude_split`, index for index, with each index's place: a qubit and a time. - **Sweep trees.** `tensor_places`, `sweep_orders` and `sweep_path` turn the places into the trees that sweep qubit by qubit, or time by time. - **Seeded search.** `find_path_seeded` and `find_path_restarts_seeded` score the sweeps beside the trials and polish the best of them all alike. - **Where it's used.** The engine's `tensor_network` method and the thorough lens take both sweeps as seeds. On the 70-qubit random graph-state circuit, one amplitude's largest intermediate falls from 2^48 to 2^36, and its multiply-adds from 2^56.1 to 2^48.7, in the thorough lens. With 16 trials and no seeds, the search finds 2^59. The plans pinned in `tests/bit_identity.rs` are unchanged. ## 0.6.14: the design checks on the job service - **The endpoints:** `POST /v1/critique`, `/v1/equivalent`, `/v1/improve` and `/v1/shortcuts`, with the MCP tools `critique_qasm`, `check_equivalent`, `improve_qasm` and `classical_shortcuts`. - **The bounds.** They run in the service's own process: - each counts against the client's submissions; - at most two run at once, and one that waits 10 s is refused with a 503; - equivalence work past 4·10⁹ gate amplitudes, and a thorough search, are refused with a 422 naming the local command. - **Smoke checks.** `smoke.sh` checks each endpoint. It now follows a job that outlasts `/v1/run`'s wait, as a client does, instead of failing on a loaded host. ## Where it reaches - **wai-web:** `engine_critique`, `engine_equivalent`, `engine_variants` and `engine_shortcuts`, tested native and under wasm. The workflow's counts go from 4 to 6 native tests and from 6 to 8 wasm tests. - **Quantum Studio:** - **Always-on critique.** It shows the measures, each with its change since the last run, a Clifford badge and the modelled fidelity. Smells are listed with their lines and flagged on the diagram, where each gate's tooltip names its smell. Show selects the lines and marks the gates. Fix applies the engine's rewrite and says how it was checked; Undo restores the lines. - **Alternatives.** Improve offers the same circuit, cheaper: the engine's rewrites and the model's, each checked. One that is not the same circuit is listed with the reason and not offered. Explore takes an aim and asks the model for different circuits; the engine reads, measures and compares each. An atlas plots two-qubit gates against depth, and Apply puts one in the editor. - **Predict first** (opt-in). The reader names the outcome they expect and its share of the shots before the run. The counts are set against it, with a tally kept on the device. - **The classical cost, on request.** Under the critique, each route is priced and the cheapest named. Thorough adds the contraction search. A check is marked stale once the program changes. - **The assistant asks questions first, and speaks only when asked.** The stance can be set to ask questions first (the default), suggest changes, or write programs. The assistant speaks only when asked (the default), or can offer a hint, which it never sends itself, after a long-standing problem or two refused runs. New quick asks are "Ask me a question" and "Hint". New tools are `critique_qasm`, `check_equivalent` and `classical_shortcuts`. - **Desktop app:** native `critique`, `equivalent`, `variants` and `shortcuts` commands, the last off the window's thread. - **wai-quantum-cli (0.1.1, released as 0.1.2):** - `critique`; - `equivalent a b`, which exits 0 for the same circuit, 1 for different and 2 for unchecked; - `improve`, which prints the program to stdout and what changed to stderr; - `shortcuts [--thorough] [--json]`; - MCP tools `critique_qasm`, `check_equivalent`, `improve_qasm` and `classical_shortcuts`, all covered by smoke.sh. - `examples/cutrank_qasm` gains `probs`: the exact `2^n·p` of given bit strings and their linear XEB. ## Tested, on the build host Run through `rb` on the build host, as each workflow runs them, on this branch at current main: - **wai-quantum:** `cargo test --features full --lib -- engine:: qasm:: quantum_tn::` passes. It includes: - the lens's seven tests, among them the bond bound held against the true Schmidt rank at every cut of 20 random circuits; - the sweep tests: the qubit sweep's boundary on a deep line, seeds never ending dearer than given, the plan's amplitude against the state vector, and a malformed seed ignored. `tests/bit_identity.rs` passes with its pins unchanged. Clippy finds nothing in the changed files. - **wai-web:** the engine's native tests pass 6 of 6, and its wasm tests under `wasm-bindgen-test-runner` pass 8 of 8, the workflow's new counts. - **Quantum Studio:** `test/studio.test.mjs` passes 58 of 58 checks in Chrome, against the engine package built as CI builds it. They cover: - the critique, the smells, Show, Fix and Undo; - the classical cost; - Improve and Explore, with and without a model; - predict first; - the assistant's defaults, tools and hint; - no "null" written out. - **wai-quantum-cli:** tests pass, clippy passes with and without default features, and `smoke.sh` holds for `critique`, `improve`, `equivalent`, `shortcuts` and the MCP tools. - **wai-quantum-service:** tests pass and clippy passes. `smoke.sh` holds against a service started on the build host, covering the four checks, the refused thorough search and the nine MCP tools. - **Desktop app:** tests pass, including the new commands, and clippy passes. - Every lockfile resolves with `--locked` at 0.6.14. - Name, comparative-prose, vanity-metric, tests-in-CI and orphan-source checks pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
wai-quantum 0.6.14: design critique, equivalence, alternatives and classical shortcuts across every surface; contraction trees that sweep along the line
All checks were successful
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Successful in 6m54s
wai-pack / wai-pack · linux-arm64 (pull_request) Successful in 1m14s
wai-pack / wai-pack · the floor through a media prober (pull_request) Successful in 24s
wai-pack / wai-pack · dependency licences (pull_request) Successful in 1m18s
wai-quantum HIP member / member · HIP absent (linux-arm64) (pull_request) Successful in 25s
joule-moq-web browser client / joule-moq-web · browser end-to-end (macos) (pull_request) Successful in 6m16s
wai-quantum npu-cores member / member · npu-cores absent (linux-arm64) (pull_request) Successful in 23s
wai-quantum tensor-engine member / member · tensor engine absent (linux-arm64) (pull_request) Successful in 19s
wai-pack / wai-pack · independent verifier (Python) (pull_request) Successful in 4m8s
WAI conformance / independent verifiers · claims, JWP, key discovery and integer payloads (Python) (pull_request) Successful in 35m22s
standards workspaces build + test / macOS energy backends (pull_request) Successful in 8m33s
WAI conformance / cargo-class corpora · macos (pull_request) Successful in 14m16s
WAI conformance / cross-arch byte-equality · macos (pull_request) Successful in 23s
WAI conformance / codec wrappers · fuzz smoke, text decode limits, C entry points, provenance, the semantic path (pull_request) Successful in 54s
WAI energy receipts / energy receipts · macos (pull_request) Successful in 6m14s
wai-ops-gpu integer operators on GPUs / Metal GPU and browser WebGPU (macos) (pull_request) Successful in 3m12s
wai-pack / wai-pack · macos (pull_request) Successful in 1m3s
wai-quantum command line / command line · macos (pull_request) Successful in 28s
wai-quantum dataflow member / member · dataflow device absent (macos) (pull_request) Successful in 14s
wai-quantum FPGA member / member · FPGA datapath, simulated (macos) (pull_request) Successful in 1m13s
wai-quantum Metal member / member · Metal (macos) (pull_request) Successful in 29s
wai-quantum neural-processor member / member · neural processor (macos) (pull_request) Successful in 5m49s
wai-quantum OpenCL member / member · OpenCL GPU (macos) (pull_request) Successful in 29s
wai-quantum service / service · macos (pull_request) Successful in 44s
wai-quantum matrix-extension member / member · matrix extension absent (macos) (pull_request) Successful in 9s
wai-quantum studio and desktop / desktop app · macos (pull_request) Successful in 2m12s
wai-quantum CPU vector units / member · vector unit absent (macos) (pull_request) Successful in 13s
wai-quantum portable tensor program / tensor program · Metal and the arm64 CPU (macos) (pull_request) Successful in 15s
wai-quantum WebGPU member / member · Metal (macos) (pull_request) Successful in 4m26s
wai-quantum WebGPU member / member · browser WebGPU (macos) (pull_request) Successful in 1m43s
7cef125325
This carries 0.6.13, which was not published on its own, and 0.6.14.

## 0.6.13

The engine is the microscope and the judge, a local model is a muse that waits to be
asked, and the reader is the author. Every figure is the engine's. Nothing changes the
reader's program until they apply a change.

engine::critique gives a program's measures before it runs:
- gates by kind; one-, two- and three-qubit gates; T gates; gates off the Clifford
  angles;
- depth and two-qubit depth, and whether it is a Clifford circuit;
- a fidelity at reference error rates, named as a model.
It also gives the program's smells, each with its lines and operations: gates that
cancel, rotations that merge or do nothing, idle qubits, and qubits never measured.
critique::variants rewrites the program's own text with the smells fixed, all of them
to a fixed point and each one alone. Each candidate carries its measures and the
equivalence verdict; one the check finds different is never offered.

engine::equiv compares two programs up to a global phase:
- by tableau for Clifford circuits, at any size;
- otherwise on every basis state, to 8 qubits;
- otherwise on random product states, to 22 qubits, which is evidence, not proof;
- otherwise unchecked, with the reason.
qasm::parse_lines gives each operation's line, and draw::layout each gate's operation
index.

engine::shortcuts lists every exact classical route the engine knows, priced on the
program, and names the cheapest for each question:
- the stabilizer tableau;
- the cut-rank sum;
- an exact matrix product state, at a bond bounded by the operator Schmidt ranks of
  the gates crossing each cut. The bound is held by a test against the true Schmidt
  ranks of random circuits;
- the light cone;
- a tensor-network contraction, when asked to be thorough;
- the state vector.
A cheap route proves a design classically easy; none being cheap proves nothing. On
the 70-qubit random graph-state circuit the quick check finds the cut-rank sum (widest
cut 30) in under 2 s. The thorough one finds widest cut 29 in about 4 minutes.

Quantum Studio gains:
- the critique, always on under the diagram, with the smells flagged on it, Show and
  Fix;
- the classical cost, on request;
- Alternatives: Improve (the engine's rewrites and the model's, each checked) and
  Explore (the model's different circuits, each measured and compared), with an atlas
  and Apply;
- Predict first, which sets the reader's expected outcome against the run;
- an assistant that asks questions first and speaks only when asked, offering (never
  sending) a hint when allowed. Its new tools are critique_qasm, check_equivalent and
  classical_shortcuts.
wai-web exports the four engine calls. The desktop app answers them natively.
wai-quantum-cli 0.1.1 adds critique, equivalent (exit 0/1/2), improve and shortcuts,
with four MCP tools.

examples/cutrank_qasm gains probs: the exact 2^n·p of given bit strings, with their
linear cross-entropy.

## 0.6.14

A deep circuit on a line, contracted qubit by qubit along time, keeps a boundary of
only the bonds between two neighbouring qubits: about half the depth for a
controlled-Z brickwork. The contraction search rarely found that tree on its own.

- Network::amplitude_split_placed builds the same network as amplitude_split, index
  for index, with each index's place in the circuit: a qubit and a time.
- tensor_places, sweep_orders and sweep_path turn the places into the trees that sweep
  qubit by qubit, or time by time.
- find_path_seeded and find_path_restarts_seeded score such trees beside the trials and
  polish the best of them all alike. A seed that is not a tree of the network is
  ignored.
- The engine's tensor_network method and the thorough shortcut lens take both sweeps as
  seeds.

On the 70-qubit random graph-state circuit, one amplitude's largest intermediate falls
from 2^48 to 2^36, and its multiply-adds from 2^56.1 to 2^48.7, in the thorough lens.
With 16 trials and no seeds the search finds 2^59. The pinned plans in
tests/bit_identity.rs call find_path itself and are unchanged.

The job service answers four design checks: POST /v1/critique, /v1/equivalent,
/v1/improve and /v1/shortcuts, with the matching MCP tools. They run in its own process
within bounds:
- each counts against the client's submissions;
- at most two run at once, and one that waits ten seconds is refused with a 503;
- equivalence work past 4e9 gate amplitudes, and a thorough search, are refused with a
  422 naming the local command.
The smoke script checks each one. It now follows a job that outlasts /v1/run's wait,
as a client does, instead of failing on a loaded host.

wai-quantum-cli 0.1.2 carries the faster contraction.

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!427
No description provided.