wai-quantum-service: the cutrank method, exact samples of a Clifford circuit measured in a product basis #342
Merged
dcharlot
merged 1 commit from 2026-10-19 21:23:11 -04:00
wai/quantum-service-cutrank-pr into main 2026-10-19
wai-quantum-service: the cutrank method, exact samples of a Clifford circuit measured in a product basis
All checks were successful
standards workspaces build + test / which workspaces this change touches (pull_request) Successful in 1m26s
wai-quantum service / does this change touch it (pull_request) Successful in 31s
wai-quantum service / service · linux (pull_request) Successful in 49s
repository checks / lockfiles, tests in CI, workflow hygiene, spec and section references, public text (pull_request) Successful in 4m2s
standards workspaces build + test / joule-code-rs (joule-code/joule-code-rs, joule-code-rs, linux-arm64, true) (pull_request) Successful in 9m51s
standards workspaces build + test / macOS energy backends (pull_request) Successful in 9m16s
wai-quantum service / service · macos (pull_request) Successful in 47s
A Clifford circuit followed, on each qubit, by one-qubit gates at any angles (qasm::Program::product_measured splits it: each qubit's gates from its first non-Clifford one on, multiplied into one matrix; a gate on several qubits after that is refused). The planner takes the graph form, searches orders for narrower cuts with a move budget of about a second, and admits the job by its largest table (double precision when it fits, single otherwise) and by the entries its passes touch. The run rebuilds the same order. Answers: counts, exact samples; amplitudes, exact up to one phase shared by the job's amplitudes, which the result's global_phase says (a tableau does not fix a state's global phase). Expectation values are refused. auto tries it for counts after the state vectors and before mps. Tests: amplitudes equal the state vector's times one phase (6, 9 and 11 qubits, 24 amplitudes each); counts follow the exact distribution (40 000 shots) and repeat with their seed; auto samples a 40-qubit ring with chords by cutrank; refusals name the gate. Mutants caught: the tail multiplied in the wrong order, samples mapped to the wrong qubits. smoke.sh samples a 60-qubit instance (max cut 10 bits). Co-Authored-By: Claude Opus 5.5 <[email protected]>