wai-quantum 0.6.9: cut-rank amplitudes with the circuit's own global phase #350

Merged
dcharlot merged 1 commit from wai/quantum-exact-phase into main 2026-10-20 04:49:01 -04:00
Owner

wai-quantum 0.6.9. The service's cutrank amplitudes now carry the circuit's own global phase, so they equal the state vector's exactly rather than up to a shared phase.

What changes

  • PhasedTableau (quantum_tableau) is a stabilizer tableau with its global phase.
    • It tracks one basis state r of the support and its exact amplitude ⟨r|ψ⟩ = 2^{-k/2} e^{iπm/4}.
    • Paulis, phase gates, CX, CY, CZ and SWAP move r and the phase directly.
    • For a Hadamard on qubit a, the amplitude of r ⊕ e_a is c · ⟨r|ψ⟩, with c read from the stabilizer whose X part is exactly e_a. That stabilizer is found by reducing the stabilizers, about n³/64 word operations; c = 0 when there is none.
    • √X = H S H exactly.
  • ProductMeasured::with_last (same graph form, order and steps; other closing gates) and ProductMeasured::scale (every amplitude times a factor, folded into one qubit's weights).
  • The service scales cutrank amplitudes by e^{iΘ} a/b:
    • e^{iΘ} is the phase the lowering to Clifford gates drops, read gate by gate from each gate's matrix against its lowering's;
    • a is the tracked amplitude;
    • b is the graph form's amplitude at the same basis state, with identity closing gates.
    • Past about a minute of tracking (counted from the Hadamards), the result says global_phase is not fixed, as before.
    • auto now tries cutrank for amplitudes, before tensor_network.

Evidence

  • The reference amplitude equals the dense state vector's after every gate of 40 random Clifford circuits (2 to 8 qubits, over 2,000 checks, phase included).
  • with_last and scale agree with fresh builds.
  • Service amplitudes equal the state vector's directly, with no phase aligned, on random Clifford-then-layer circuits of 6, 9 and 11 qubits. They also do on a circuit whose Clifford part uses rz, rx, ry, u, p, cp, rzz, rxx, iswap, sx, sxdg, cy, swap, crz and cu at Clifford angles.
  • Mutants caught: a wrong phase in the Hadamard update, the lowering phase dropped, and the tracked amplitude ignored.
  • Checked on the build host:
    • --lib quantum_tableau (11), quantum_cutrank (8), --test bit_identity (23);
    • the service's tests (64), clippy, and the full smoke.sh against a local server;
    • check-lockfiles.
  • The public-text checks are clean.

🤖 Generated with Claude Code

**wai-quantum 0.6.9.** The service's `cutrank` amplitudes now carry the circuit's own global phase, so they equal the state vector's exactly rather than up to a shared phase. ### What changes - **`PhasedTableau`** (`quantum_tableau`) is a stabilizer tableau with its global phase. - It tracks one basis state `r` of the support and its exact amplitude `⟨r|ψ⟩ = 2^{-k/2} e^{iπm/4}`. - Paulis, phase gates, CX, CY, CZ and SWAP move `r` and the phase directly. - For a Hadamard on qubit `a`, the amplitude of `r ⊕ e_a` is `c · ⟨r|ψ⟩`, with `c` read from the stabilizer whose X part is exactly `e_a`. That stabilizer is found by reducing the stabilizers, about `n³/64` word operations; `c = 0` when there is none. - `√X = H S H` exactly. - **`ProductMeasured::with_last`** (same graph form, order and steps; other closing gates) and **`ProductMeasured::scale`** (every amplitude times a factor, folded into one qubit's weights). - **The service** scales `cutrank` amplitudes by `e^{iΘ} a/b`: - `e^{iΘ}` is the phase the lowering to Clifford gates drops, read gate by gate from each gate's matrix against its lowering's; - `a` is the tracked amplitude; - `b` is the graph form's amplitude at the same basis state, with identity closing gates. - Past about a minute of tracking (counted from the Hadamards), the result says `global_phase` is not fixed, as before. - `auto` now tries `cutrank` for amplitudes, before `tensor_network`. ### Evidence - **The reference amplitude** equals the dense state vector's after every gate of 40 random Clifford circuits (2 to 8 qubits, over 2,000 checks, phase included). - **`with_last` and `scale`** agree with fresh builds. - **Service amplitudes equal the state vector's directly**, with no phase aligned, on random Clifford-then-layer circuits of 6, 9 and 11 qubits. They also do on a circuit whose Clifford part uses `rz`, `rx`, `ry`, `u`, `p`, `cp`, `rzz`, `rxx`, `iswap`, `sx`, `sxdg`, `cy`, `swap`, `crz` and `cu` at Clifford angles. - **Mutants caught:** a wrong phase in the Hadamard update, the lowering phase dropped, and the tracked amplitude ignored. - **Checked on the build host:** - `--lib quantum_tableau` (11), `quantum_cutrank` (8), `--test bit_identity` (23); - the service's tests (64), clippy, and the full `smoke.sh` against a local server; - `check-lockfiles`. - The public-text checks are clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
wai-quantum 0.6.9: cut-rank amplitudes with the circuit's own global phase
All checks were successful
wai-quantum matrix-extension member / member · matrix extension, emulated (aarch64 Linux) (pull_request) Successful in 20s
standards workspaces build + test / macOS energy backends (pull_request) Successful in 8m9s
WAI energy receipts / energy receipts · macos (pull_request) Successful in 7m10s
wai-quantum tensor-engine member / member · tensor engine, the kernel toolchain's simulator (linux) (pull_request) Successful in 8m58s
wai-pack / wai-pack · macos (pull_request) Successful in 1m16s
wai-quantum portable tensor program / tensor program · CPU, mutants, GPU builds (pull_request) Successful in 31s
wai-quantum dataflow member / member · dataflow device absent (macos) (pull_request) Successful in 18s
wai-quantum CPU vector units / member · vector unit, rvv 1024-bit (riscv64, emulated) (pull_request) Successful in 19s
wai-quantum CPU vector units / member · vector unit, sve 128-bit (aarch64, emulated) (pull_request) Successful in 29s
wai-quantum signal processor / processor and member · signal processor, emulated (pull_request) Successful in 14m50s
wai-quantum CPU vector units / member · vector unit, rvv 128-bit (riscv64, emulated) (pull_request) Successful in 14s
wai-quantum CPU vector units / member · vector unit, sve 2048-bit (aarch64, emulated) (pull_request) Successful in 13s
wai-quantum CPU vector units / member · vector unit, avx2 (x86_64 silicon) (pull_request) Successful in 18s
wai-quantum FPGA member / member · FPGA datapath, simulated (macos) (pull_request) Successful in 1m22s
wai-quantum CPU vector units / member · vector unit, sve 512-bit (aarch64, emulated) (pull_request) Successful in 20s
wai-quantum Metal member / member · Metal (macos) (pull_request) Successful in 31s
wai-quantum WebGPU member / member · software Vulkan (linux) (pull_request) Successful in 2m20s
wai-quantum WebGPU member / shader checks · browser build · wasip2 inertness · MSRV (pull_request) Successful in 3m16s
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Successful in 3m9s
wai-quantum neural-processor member / member · neural processor (macos) (pull_request) Successful in 5m57s
wai-quantum OpenCL member / member · OpenCL GPU (macos) (pull_request) Successful in 24s
wai-quantum service / service · macos (pull_request) Successful in 47s
wai-quantum matrix-extension member / member · matrix extension absent (macos) (pull_request) Successful in 12s
WAI mbt2018_mean integer decode (regenerated vectors) / regenerate mbt2018_mean integer vectors → Rust decode, required (pull_request) Successful in 5m39s
wai-quantum portable tensor program / tensor program · Metal and the arm64 CPU (macos) (pull_request) Successful in 19s
wai-quantum CPU vector units / member · vector unit absent (macos) (pull_request) Successful in 14s
wai-web reach builds / wai-web reach builds · the package of record, every output as recorded (pull_request) Successful in 3m4s
wai-quantum WebGPU member / member · Metal (macos) (pull_request) Successful in 2m50s
wai-web reach builds / wai-web reach builds · this tree's wai-web, every rung on its engine line (pull_request) Successful in 4m46s
wai-quantum WebGPU member / member · browser WebGPU (macos) (pull_request) Successful in 2m2s
cfa797f856
PhasedTableau tracks one basis state of a stabilizer state's support and its
exact amplitude (2^{-k/2} e^{iπm/4}) through every gate; a Hadamard reads the
stabilizer whose X part is the one qubit. ProductMeasured gains with_last and
scale. The service's cutrank method scales its amplitudes by e^{iΘ} a/b (the
lowering's dropped phase, the tracked amplitude, the graph form's at the same
basis state), so they carry the circuit's own global phase; auto tries cutrank
for amplitudes. Tests against the dense state vector, phase included; three
mutants caught. Version 0.6.9 in every lockfile that pins it.

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