wai-quantum: jobs placed on certified GPU members or split over several, byte for byte the CPU's; Clifford+T as sums of stabilizer states #557
Loading…
Reference in a new issue
No description provided.
Delete branch "wai/quantum-scale-out"
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?
A job can now say where its state vector runs: on the CPU, on a GPU member found on the host, or split over several. Only a member certified bit-exact against the CPU is used, so a placed job's answers are the CPU's byte for byte, and its receipt names where it ran. Clifford+T circuits gain a method of their own,
stabilizer_rank: a sum of stabilizer states, exact or sampled with a stated bound. With nothing asked for, every plan and result is what it was.What it adds
Placement (
engine::fabric, featurequantum_fabric)fabricisauto(the default),cpu,accelerator, a member's id or key, or a list of members whose length is a power of two.SV_DEFAULT). Only a member certified bit-exact is placed. OpenCL devices without binary64 are listed as refused.autoplaces on the CPU on every host and looks for no member. With per-gate launches and the state copied to the device and back, a whole job measured about as fast, or slower, on the fleet's GPUs (22 qubits on the laptop GPU: 159 ms on the CPU, 202 ms placed), and a planner must not route by default to a path that is not better.acceleratortakes the first certified member that holds the state, and one that fails during the run hands the job to the next. The receipt lists each that failed (fell_back_from, each with how it failed). When every one fails, the job is refused. A member named by id or key is used alone.J013, never made elsewhere. Asking for a member putsautoontostatevector; other methods, mid-circuit programs and device targets refuse one.quantum_fabric(the desktop app, the browser engine, the contract's build) reads everyfabricand refuses all butauto(J013), with a test of its own.Several devices on one node
sv64::run_splitsplits the state by its top qubits, one partition on each member. Each partition runs the CPU's own launches. A gate on a partition qubit first has that qubit exchanged with a local one through the host's copy, so the joined state is bit-identical to the CPU's.max_qubits); a state or partition past it is refused at plan time.The receipt. A placed result, or one that asked for a placement, carries
fabric: the kernel, what was asked, the member, its key and class, the implementation, the parity tier, the certificate's digest, the corpus, and the energy (unmetered, with the reason). The job's receipt seals it, and the provenance'scomputer.fabricnames the members.Stabilizer-rank Clifford+T (
quantum_stabrank, methodstabilizer_rank)PhasedTableau::amplitudesgives every amplitude of a stabilizer state exactly from one reduction of the stabilizers.ExactSum). The sum does not depend on how the branches are split between threads, and is evaluated once in double precision.terms, orepsilon, atconfidence): branches drawn uniformly, seeded, each from a stream of its own. The estimate is unbiased with mean squared distance (sec²(π/8)^t − 1)/terms, and the bound computed from t, terms and confidence is stated beside each value.Program::clifford_tlowerst,tdg,p/rz/rx/ryat odd multiples of π/4,cpat odd multiples of π/2,cczandccx, with the global phase kept exactly.autochooses it by T count, for amplitudes or expectation values past the dense state vector, within one job's work: 2×10¹² tableau word operations, calibrated at about 4×10¹⁰ a second on a 16-core host (t = 12: 0.03 s; t = 16: 0.3 s; t = 18: 1.06 s).Surfaces
run --fabric, andwai-quantum fabric [--json], which lists the members with their limits and states theautorule. New featurescuda,hipandopencl.fabricin the job tools, andlist_fabricon the command line's server.fabric, and places only on its CPU.fabric_membersin the tools schema. The optionalt_count,terms,boundandconfidencein the result schema.wai-quantum-cuda.ymlandwai-quantum-hip.yml, which ask foracceleratorand check thatautonames nothing, and absent-device steps. The CUDA absent job runs the CPU-partition and fabric tests by name in a container. The new library tests also run inwai-energy-receipts.ymlon linux, linux-arm64 and macos.Checked
--features full --lib --tests: 1075 passed, every test binary ok,fabric_placement5 passed. Without the fabric (contract set),engine::schema:: engine::fabric::: 11 passed. CLI: 69 + 5 + 5 + 2 + 2 + 1 passed; clippy-D warningsclean by default, with--no-default-featuresand with--features cuda,hip,opencl. Service: 37 + 1;mcp::14. CLI and service smoke: every check held. Breaking gate: only new items, no unacknowledged break. Repository checks: every line ok.fabric_placementwith CUDA and OpenCL: 5 passed, membersgpu-cuda-sm89,opencl-cpu-8086,opencl-gpu-10de. One state split four ways (gpu-cuda-sm89,opencl-gpu-10de,opencl-cpu-8086and the CPU) gives the CPU's answers byte for byte.cuda_svandopencl_sv: 3 and 3 passed, digests pinned, mutants killed. The placement step, replayed afterautomoved to the CPU: 5 passed.hip_sv: 3 passed.fabric_placementwith HIP and OpenCL: 5 passed, the splitgpu-hip-gfx1151+opencl-gpu-1002byte for byte. The placement step, replayed afterautomoved to the CPU: 5 passed.hardware,telemetryandlocales: every check passed.build-views --check: ok.studio.test.mjstwice with the bundled browser: every check passed.build-views --check: the committed page is built from its 49 sources. Servicemcp::: 14 passed. CLI: 72 passed (bin) and every integration target; clippy withcuda,hip,openclclean. Service: 37 + 1. wai-web native: 29 passed. Engine--features full: 1148 lib tests passed and every test binary (engine::fabric5,variational11,pulse7,formats24,quantum_stabrank4). The contract feature sets' fabric and schema tests: 12 and 11 passed. CLI and service smoke: every check held. Breaking gate: no unacknowledged break. Repository checks: all 10 lines ok.check_schemas.py: 29 tools valid, 47 tool answers follow their schemas.hardware,telemetry,updateandlocales: every check passed.studio.test.mjstwice: every check passed.886eec584wai-conformance.yml. Every changed line is main's, and no crate this PR changes compiles them (none depends onwai-rs), so nothing was run again by hand; this PR's CI runs every leg.stabilizer_rank(bda065b52adds its line).wai-quantum-py/ci/check.sh: 78 passed, 5 of 5 notebooks ran and matched (36 code cells), smoke passed.The views page was rebuilt (
005584ee5) withwai/wai-quantum-views/build.shincatthehacker/ubuntu:act-22.04with Rust 1.98.0, as the views workflow rebuilds it: the Studio's method names feed it, and it carries this branch's engine.Not done
auto.Breaking
None. The breaking gate lists only new items, and the changelog acknowledges no break.
🤖 Generated with Claude Code
A T gate is (e^{iπ/8} I + e^{−iπ/8} S) / (2 cos π/8), and T† its conjugate, so a circuit with t of them is a sum of 2^t Clifford circuits of equal weight. quantum_stabrank walks every branch on the phased tableau, whose new PhasedTableau::amplitudes gives every amplitude of a stabilizer state exactly from one reduction of the stabilizers (d = x ⊕ r in the X span, the phase read off the product of pivot rows). Every term is a power of 1/√2 at a whole number of sixteenths of a turn, counted as a whole number (ExactSum), so the sum does not depend on how the branches are split between threads and is evaluated once in double precision. An expectation value is the amplitude ⟨0|U†PU|0⟩ of one circuit with twice the T gates. Exact mode: terms grow as 2^t (4^t for an expectation value). Sampled mode (terms, or epsilon, at confidence): branches drawn uniformly, seeded, each from a stream of its own; the estimate is unbiased with mean squared distance (sec²(π/8)^t − 1)/terms, so each value is within sqrt((sec²(π/8)^t − 1)/(terms·(1 − confidence))) with the stated probability, computed from t, terms and confidence and stated beside each value. Program::clifford_t lowers t, tdg, p/rz/rx/ry at odd multiples of π/4, cp at odd multiples of π/2, ccz and ccx, with the global phase kept exactly. Ground truth first: every amplitude of random Clifford+T circuits (up to 7 qubits, 10 T gates) and of random programs through the job engine equals the dense state vector's, phase and all, within 1e-12, by fidelity; expectation values likewise; the sampled bound holds in at least its stated fraction of seeds, measured on the whole state. The planner names stabilizer_rank and auto chooses it by T count (amplitudes or expectation values past the dense state vector, its branches within one job's work, calibrated at about 4e10 tableau word operations a second on a 16-core host). Optional t_count, terms, bound and confidence in the result schema; the methods list, both MCP servers, the service and the docs name it. Co-Authored-By: Claude Opus 5.5 <[email protected]>