wai-quantum 0.6.6: Clifford circuits measured in a product basis, exactly, by cut-rank #340
Loading…
Reference in a new issue
No description provided.
Delete branch "wai/quantum-cutrank-0.6.6"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
wai-quantum 0.6.6. Exact amplitudes, probabilities and samples of a Clifford circuit followed by one layer of single-qubit gates at any angles. The cost is set by the state's cut-rank along an order of its qubits, not by the number of qubits.
What it does
Tableau::graph_formwrites a stabilizer state as local Cliffords (H^h S^s Z^zper qubit) on a graph state.quantum_cutrank(a new feature, infull) sums⟨x| ⊗ V_q |ψ⟩ = 2^{-n/2} Σ_z ∏_q W_q[x_q][z_q] (−1)^{Σ_{a~b} z_a z_b}one qubit at a time along an order, in a table of2^{cut-rank}entries.Precision::Singlestores the table inf32withf64arithmetic.anneal_ordersearches orders for less work (Σ 2^cut) and never returns a worse one.cutrank_qasm: cut-ranks, annealed orders, amplitudes and exact samples from an OpenQASM 2 Clifford bulk with a closing single-qubit layer.patch_xeb: patched cross-entropy from measured shots, each patch on the dense state vector.tn_cost: one amplitude's contraction cost asfind_pathfinds it.Evidence
f32;scripts/check-lockfiles.sh;cargo check --no-default-features --features quantum_cutrank --examples;cargo test --release --features full --lib quantum_cutrank(7 passed) and-- quantum_tableau(10 passed);-D warningsreports nothing in the files this PR touches. The rest of the library's test code has lints of its own, which CI does not check.🤖 Generated with Claude Code
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]>