| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
Some checks failed
no-vanity-metrics / Scan committed Markdown for vanity metrics (pull_request) Successful in 3s
standards workspaces build + test / eoc-rs (pull_request) Successful in 1m48s
standards workspaces build + test / jcp-rs (pull_request) Successful in 1m17s
standards workspaces build + test / proof-rs (pull_request) Successful in 1m16s
standards workspaces build + test / sandbox-rs (pull_request) Successful in 2m7s
standards workspaces build + test / smart-byte-rs (pull_request) Successful in 2m29s
wai cross-architecture byte-equality / linux-x86_64 (pull_request) Successful in 22s
WAI conformance / cargo-class corpora · linux (pull_request) Successful in 2m7s
WAI conformance / cross-arch byte-equality · linux (pull_request) Successful in 22s
WAI conformance / C2PA manifest emission · signed, read back, validated (pull_request) Successful in 42s
WAI energy receipts / energy receipts · linux (pull_request) Successful in 39s
wai formal verification (integer core) / kani (pull_request) Successful in 4m59s
WAI JPEG-AI whole decode (pinned inputs, required) / fetch pinned JPEG-AI inputs → whole decode + pixel hash, required (pull_request) Successful in 52s
WAI neural decoders end-to-end / synthetic fixtures → Rust decode → reference (±4) (pull_request) Failing after 1m7s
standards workspaces build + test / jouleclaw-rs (pull_request) Successful in 6m49s
WAI neural sink gates / model-free refusals of the neural sink (pull_request) Successful in 24s
WAI mbt2018_mean integer decode (regenerated vectors) / regenerate mbt2018_mean integer vectors → Rust decode, required (pull_request) Successful in 2m28s
standards workspaces build + test / aac-rs (pull_request) Successful in 3m25s
standards workspaces build + test / joule-code-rs (pull_request) Successful in 3m46s
standards workspaces build + test / joulecontract-rs (pull_request) Successful in 1m22s
standards workspaces build + test / map-rs (pull_request) Successful in 2m16s
standards workspaces build + test / mesh-rs (pull_request) Successful in 2m3s
standards workspaces build + test / openpay (pull_request) Successful in 18m29s
wai cross-architecture byte-equality / linux-aarch64 (pull_request) Successful in 1m58s
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Failing after 7s
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Failing after 7s
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Failing after 8s
standards workspaces build + test / arl-rs (pull_request) Successful in 3m49s
standards workspaces build + test / joule-ui-rs (pull_request) Successful in 3m19s
standards workspaces build + test / jouledesk-rs (pull_request) Successful in 3m45s
standards workspaces build + test / joulehook-rs (pull_request) Successful in 3m17s
standards workspaces build + test / sense-rs (pull_request) Successful in 4m0s
standards workspaces build + test / macOS energy backend (jcp-energy) (pull_request) Successful in 3m42s
wai cross-architecture byte-equality / macos-arm64 (reference) (pull_request) Successful in 27s
WAI conformance / cargo-class corpora · macos (pull_request) Successful in 2m43s
WAI conformance / cross-arch byte-equality · macos (pull_request) Successful in 28s
WAI energy receipts / energy receipts · macos (pull_request) Successful in 1m14s
wai cross-architecture byte-equality / windows-x86_64 (pull_request) Has been cancelled
WAI conformance / cargo-class corpora · windows (pull_request) Has been cancelled
WAI conformance / cross-arch byte-equality · windows (pull_request) Has been cancelled
The single `HwShunt` acquisition class covered both an on-chip vendor counter (RAPL, NVML, SMC, IOReport) and an external calibrated shunt. They are different evidence: a calibrated instrument's uncertainty is traceable to a calibration, while a counter is a vendor's reading whose error the vendor states (RAPL readings are deliberately noised when SGX or TDX is enabled, per security advisory INTEL-SA-00389). - extensions/energy-measurement.md §2 splits hardware evidence into `OnChipCounter` and `CalibratedInstrument`, each with a required declared uncertainty (relative error and integration window). IOReport is an on-chip counter, like RAPL and NVML. `HwShunt` stays readable as the legacy class, ranked below both, and is not sealed into a new WAI receipt. - Every receipt family that carries joules — video, world, film, reel, haptic, score, splat4d, audio scene, ternary, provenance and the wai-quantum receipts — can carry its class. The label is additive: every committed signed vector still verifies, and the signed bytes of unlabelled and legacy-labelled receipts are pinned by tests. A sealed figure declares its 1 µJ resolution, and the floor is stated as the rule verified (0.5/√3 µJ). - The acquisition rules are scoped to the receipt profiles WAI defines, and the text says what enforces each one. - Meters open their window from rest, report an all-zero power reader as unusable rather than clean, and state the running-window count model as conservative. - oer-receipts.md maps OER's evidential grade onto the refined classes. The rule that a producer must not grade `measured` a figure whose class is `Estimator` is kept as settled on main. - wai-quantum verifies a receipt in either form on every in-tree verify path, including wai-quantum-serve's POST /verify. - CI: wai-energy-receipts.yml runs the energy-class, label and legacy-pin tests for wai-rs, wai-quantum and wai-quantum-serve, which no workflow enabled before. Co-Authored-By: Claude Opus 5.5 <[email protected]> |
||
| .. | ||
| examples | ||
| src | ||
| Cargo.lock | ||
| Cargo.toml | ||
| README.md | ||
wai-quantum
A deterministic quantum stack in pure Rust. Byte-exact circuit simulation, the operational layer around it, and signed energy-accounted receipts binding every stage.
No QPU, no cloud service, no vendor SDK, and no system libraries — so the same source runs natively, in the browser via wasm, and as a WASI component at the edge, producing byte-identical results and receipts on all three.
[dependencies]
wai-quantum = "0.3"
use wai_quantum::quantum::Circuit;
use wai_quantum::quantum_toolchain as qt;
let mut c = Circuit::new(3);
c.h(0).cx(0, 1).cx(1, 2); // GHZ
let sv = c.simulate().unwrap();
println!("{:?}", qt::top_outcomes(&sv, 2)); // |000> 0.5, |111> 0.5
// a portable identity for the reconstruction — same on every machine
let h: [u8; 32] = sv.statevector_hash();
What's in it
| Feature | What it gives you |
|---|
Cross-architecture reproducibility is tested, not asserted. The full test
suite passes under wasm32-wasip2 on wasmtime as well as natively, and the
floating-point results — entropy, the Holevo bound — are pinned to their exact
IEEE-754 bits, so a platform that computes something different fails the suite
instead of quietly returning a different number:
CARGO_TARGET_WASM32_WASIP2_RUNNER=wasmtime cargo test --release --target wasm32-wasip2 --features full
The same binary answers what a state carries, not only what a circuit does:
wai-quantum entropy bell --keep 0 # half a Bell pair: 1 bit, invisible to a state vector
wai-quantum channel depolarizing --prob 0.5
wai-quantum bb84 --eavesdrop # interception shows up in the error rate
wai-quantum chsh # 2 sqrt(2), exactly, not sampled
wai-quantum qutrit # d = 3, not just qubits
channel prints the Holevo bound before and after, and it can only fall: noise
never creates information.
| quantum | byte-exact statevector simulation (dyadic Clifford+T+P(k)) |
| quantum_toolchain | algorithm library, backend recommendation, OpenQASM 2/3 ingest of what the mainstream toolchains actually export — both register and both measurement spellings, rx/ry/rz/sx/u/u2/u3/crz, and exact rational-multiple-of-pi angles (non-dyadic angles are refused, never rounded) — Bloch / entanglement / purity analysis |
| quantum_stabilizer | stabilizer (CHP) tableau — O(n²), scales far past statevector |
| quantum_mps | tensor-network (matrix-product-state) backend |
| quantum_pauli | sparse-Pauli / Heisenberg observable propagation |
| quantum_receipt | signed, energy-accounted receipt over a reconstruction |
| quantum_ops | the operations/attestation layer |
| quantum_cal, quantum_control, quantum_noise | calibration, filter-function robust control, DD noise spectroscopy, Cycle-Benchmarking noise learning |
| quantum_mitigate | zero-noise extrapolation, readout M3, classical shadows |
| quantum_qec | CSS codes (distance verified by exhaustive search, not asserted) — rotated surface [[d²,1,d]], toric, bivariate-bicycle, and the [[7,1,3]] colour code, whose self-duality buys a transversal logical Hadamard — one round, no ancillas, no surgery — verified on the simulator, with the surface code shown failing the same move — with two decoders: union-find (weighted matching, single-shot, space-time with faulty measurement, and circuit-level with hook errors; imports and exports Stim-syntax detector error models, so other tools' noise models decode here and ours decode there) and Relay-BP (for qLDPC) |
| quantum_compile | Clifford routing + stabilizer-tableau equivalence proof |
| quantum_atom | neutral-atom register preparation (Hungarian / LSAP) |
| quantum_qir | QIR export + ingest — emit and parse QIR (the QIR Alliance's LLVM-based IR); emitted modules validated with llvm-as, and 9 of 10 catalog algorithms re-ingest to a bit-identical statevector |
| quantum_comm | key distribution and security: BB84 with an intercept-resend eavesdropper (a quiet channel gives a perfect key; interception costs a quarter of it), and the no-cloning theorem priced |
| quantum_qudit | qubits and qutrits: the Weyl–Heisenberg group, the Fourier gate over Z_d, the controlled sum — exact for d = 2 and 3 |
| quantum_info | mixed states: density matrices, the partial trace, purity, exact Pauli expectations, and CHSH against the classical and Tsirelson bounds |
| quantum_source | the limits on encoding and transport: von Neumann entropy, the Schumacher limit, and the Holevo bound — which says n qubits carry at most n classical bits, so quantum does not compress classical media |
| quantum_channel | transport itself: Kraus channels (bit flip, dephasing, depolarizing, amplitude damping), and linear-inversion tomography to see what actually arrived — with the law that a channel can only lose information, never create it |
| quantum_qbom | Quantum Bill of Materials — stage receipts into one manifest |
| quantum_vml, quantum_phasor, quantum_qfhrr, quantum_kernel, quantum_qdata, quantum_phasor_meter | the interference / phasor ML layer |
| full | everything |
Default features are quantum, quantum_toolchain, quantum_receipt.
Speed
Byte-exactness is the contract, so the simulator is optimised only in ways that
cannot move a single amplitude: identity does nothing, a diagonal gate phases half
the state with one multiply rather than four, and X — so CX — is a swap with no
arithmetic at all. fxmul(ONE, x) == x exactly in this fixed point, which is what
makes those paths provably identical rather than merely close, and they are checked
against the previous implementation amplitude by amplitude.
An all-real matrix — H, and any real rotation — halves its multiplies too, since
the imaginary cross terms are multiplications by exactly zero.
At 20 qubits that is 8.9x on Z, 7.1x on X, 4.6x on CZ, 4.3x on CX, 3.4x on
T, 1.9x on Y and 1.8x on H.
Determinism
Simulation is byte-exact: amplitudes are dyadic fixed-point, so a circuit
reconstructs to the same statevector_hash on every machine and every target.
The approximate methods (MPS truncation, the phasor/ML layer) are
reproducible f64 — IEEE-754-strict, identical given the same inputs and seed —
and are documented as such rather than claimed byte-exact.
A receipt separates the two halves of a cost honestly: work is
portable-exact (n_ops · 2^n amplitude updates, recomputed by the verifier, so a
sink cannot inflate it) and energy is measured-attested (only the signer can
vouch for its own silicon). Signatures travel between substrates because the
computation is reproducible — not because two runtimes agreed to trust each other.
An energy figure is only comparable with another when it says how it was
acquired — read from the silicon's own counter, from a calibrated instrument,
from a model, or a constant. quantum_energy::Labelled seals that acquisition
class, with its declared uncertainty, inside the receipt's signature, and
LabelledQbom does the same per entry of a bill of materials. A receipt sealed
without a label keeps exactly the bytes it always had. MaybeLabelled parses
and verifies a receipt in whichever form it arrives, and checks a job's link to
its calibration in either form. A label's declared uncertainty must be at
least the 0.5/√3 µJ (≈ 0.289 µJ) that rounding the figure to whole
microjoules adds: joules_micro × relative_ppm of at least 288 676.
Also available
- A CLI (
wai-quantumin thewaicrate) — run circuits, emit OpenQASM, seal and verify receipts, native or underwasmtime. - A WASI-HTTP component serving the stack as an ordinary HTTP handler.
- Browser demos and a course: https://wai.transaction.science/quantum-ide
License
Apache-2.0