wai-quantum 0.6.6: Clifford circuits measured in a product basis, exactly, by cut-rank #340
Merged
dcharlot
merged 5 commits from 2026-10-19 20:26:27 -04:00
wai/quantum-cutrank-0.6.6 into main 2026-10-19
wai-quantum cutrank: clippy's is_multiple_of and an enumerated loop
All checks were successful
wai-quantum portable tensor program / tensor program · CPU, mutants, GPU builds (pull_request) Successful in 32s
wai-quantum CPU vector units / member · vector unit, rvv 1024-bit (riscv64, emulated) (pull_request) Successful in 17s
wai-quantum CPU vector units / member · vector unit, sve 128-bit (aarch64, emulated) (pull_request) Successful in 26s
wai-quantum CPU vector units / member · vector unit, rvv 128-bit (riscv64, emulated) (pull_request) Successful in 12s
wai-quantum CPU vector units / member · vector unit, sve 2048-bit (aarch64, emulated) (pull_request) Successful in 10s
wai-quantum signal processor / processor and member · signal processor, emulated (pull_request) Successful in 13m59s
wai-quantum CPU vector units / member · vector unit, avx2 (x86_64 silicon) (pull_request) Successful in 13s
wai-quantum CPU vector units / member · vector unit, sve 512-bit (aarch64, emulated) (pull_request) Successful in 13s
wai-quantum WebGPU member / member · software Vulkan (linux) (pull_request) Successful in 2m8s
wai-quantum WebGPU member / shader checks · browser build · wasip2 inertness · MSRV (pull_request) Successful in 3m8s
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Successful in 3m15s
WAI conformance / cargo-class corpora · macos (pull_request) Successful in 12m23s
WAI conformance / cross-arch byte-equality · macos (pull_request) Successful in 18s
WAI mbt2018_mean integer decode (regenerated vectors) / regenerate mbt2018_mean integer vectors → Rust decode, required (pull_request) Successful in 5m16s
WAI conformance / codec wrappers · fuzz smoke, text decode limits, C entry points, provenance, the semantic path (pull_request) Successful in 42s
wai-web reach builds / wai-web reach builds · the package of record, every output as recorded (pull_request) Successful in 2m44s
wai-pack / wai-pack · macos (pull_request) Successful in 1m1s
wai-quantum dataflow member / member · dataflow device absent (macos) (pull_request) Successful in 13s
wai-quantum FPGA member / member · FPGA datapath, simulated (macos) (pull_request) Successful in 1m5s
wai-quantum Metal member / member · Metal (macos) (pull_request) Successful in 28s
wai-web reach builds / wai-web reach builds · this tree's wai-web, every rung on its engine line (pull_request) Successful in 4m4s
wai-quantum neural-processor member / member · neural processor (macos) (pull_request) Successful in 5m32s
wai-quantum OpenCL member / member · OpenCL GPU (macos) (pull_request) Successful in 20s
wai-quantum service / service · macos (pull_request) Successful in 29s
wai-quantum matrix-extension member / member · matrix extension absent (macos) (pull_request) Successful in 10s
wai-quantum portable tensor program / tensor program · Metal and the arm64 CPU (macos) (pull_request) Successful in 14s
wai-quantum CPU vector units / member · vector unit absent (macos) (pull_request) Successful in 13s
wai-quantum WebGPU member / member · Metal (macos) (pull_request) Successful in 2m18s
wai-quantum WebGPU member / member · browser WebGPU (macos) (pull_request) Successful in 1m33s
joule-moq-web browser client / joule-moq-web · browser end-to-end (macos) (pull_request) Successful in 3m51s
Co-Authored-By: Claude Opus 5.5 <[email protected]>
wai-quantum 0.6.6: the cut-rank engine in the README and changelog
A feature row and a section for quantum_cutrank; the changelog entry; the version in every lockfile that pins it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
wai-quantum examples: patched cross-entropy benchmarking from shots (patch_xeb) and one amplitude's contraction cost (tn_cost)
patch_xeb simulates each patch of a patched circuit exactly on the dense state vector and scores the measured shots (normalised linear XEB per patch, the product, its error). On a published 61-qubit experiment's release it reproduces the released per-circuit fidelities to 5e-7 (their JSON's rounding). tn_cost prints log10 of one amplitude's contraction cost as find_path sees it, with the largest intermediate and the slices. Co-Authored-By: Claude Opus 5.5 <[email protected]>
wai-quantum cutrank: the steps planned once, tables stored at a chosen precision, and orders annealed for less work
- The table operations (coordinate swaps, kernel merges, doublings, XOR sums, the sign masks) depend on the graph and the order alone, so they are planned once per state; an amplitude or a sample only runs passes. - Precision::Single stores the table in f32 (arithmetic stays f64): half the memory and traffic, amplitudes within 1e-5 of the double ones (test). - A merge followed by a doubling is one pass; a doubling no longer zero-fills. Every pass is cut into fixed chunks, so reductions do not depend on the threads. - work() = Σ 2^cut, passes() tallies the passes by kind, and anneal_order(moves, seed) searches orders by simulated annealing, never returning a worse one (test: lower work, same amplitudes). On the tracker's 70-qubit random graph-state instance (build host): natural order, max cut 32: amplitude 6.2 s (f64) / 4.7 s (f32), sample 7.5 s (f32). Annealed order (seed 3, 20 000 moves): max cut 29, work 6.5× less, largest table 4 GiB in f32: amplitude 0.53 s, exact sample 1.49 s, amplitudes agreeing with the natural order's double ones to 1e-7. Co-Authored-By: Claude Opus 5.5 <[email protected]>
wai-quantum: exact amplitudes and samples of a Clifford circuit measured in a product basis, by cut-rank elimination
Tableau::graph_form writes the state as local Cliffords on a graph state.
quantum_cutrank (feature quantum_cutrank, in full) then sums
⟨x|⊗V_q|ψ⟩ = 2^{-n/2} Σ_z ∏ W_q[x_q][z_q] (−1)^{Σ_{a~b} z_a z_b} one qubit at a
time along an order, in a table of 2^{cut-rank} entries: each qubit is an
in-place pass (a merge where the boundary space loses a dimension, the
qubit's signed terms, a doubling or an XOR-shifted sum for its edges
ahead). By Parseval the table's norm is the prefix probability, so the same
passes sample exactly. Reductions are summed in fixed chunks.
Tests: the graph form rebuilds the state (40 random circuits); amplitudes
equal the state vector's in probability and relative phase (30 circuits up
to 12 qubits); forward, reverse and shuffled orders agree (24–54 qubits, at
least 30 comparisons); samples follow the exact law (60k shots) and are
seeded; cut-ranks of GHZ and product states. Mutants caught: merge signs,
the sampling choice, the graph form without its S, the doubling's sign.
examples/cutrank_qasm reads an OpenQASM 2 Clifford bulk with a closing
single-qubit layer. On the tracker's 70-qubit random graph-state instance
(max cut 32 bits, matching an independent tableau): an exact amplitude in
about 7.6 s and an exact sample in about 14 s on the build host, 69 GB peak
in f64.
Co-Authored-By: Claude Opus 5.5 <[email protected]>