open-standards/wai/extensions/quantum-ops.md
Transaction Science d009db9087
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
wai: on-chip counters and calibrated instruments are separate energy classes, and every joule-carrying receipt can say which
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]>
2026-09-29 01:27:37 -04:00

125 lines
6.7 KiB
Markdown

# WAI Extension: Quantum-Operations Attestation (`wai.quantum.calibration` · `wai.quantum.job`)
Status: **Draft.** Engine: `wai-rs/src/quantum_ops.rs` (feature `quantum_ops`).
The **verify-half** of WAI (`wai.asset.provenance`'s lineage, specialized) applied
to the quantum processing industry.
## 0. The gap this closes
Every quantum-control stack in the field — Q-CTRL, QuantrolOx, Qruise, Quantum
Machines, Qblox, Zurich Instruments, OrangeQS, QuEL, Origin, Conductor, Classiq —
emits the same three **unsigned** things: an HDF5 dataset, a JSON state snapshot,
and a dashboard/log. Not one **signs**, **content-addresses**, **ports**, or
**meters the joules** of a single operation. The industry already reaches for
reproducibility (QM's `__package_versions__`, QBOM bills-of-materials, QCIVET
hash-chained audit traces, "Vibe Calibration" internal audit records) but stops
exactly short of two axes:
1. **cryptographic signature + portability** — a receipt a *third party* verifies,
not a mutable vendor-cloud dashboard;
2. **measured joules** — every stack sits on a kW-scale dilution fridge + control
racks, yet none emits joules-per-calibration or joules-per-job.
This extension is those two axes. It is not a control system and **runs no
hardware**: the calibration/job is performed by the sink's control stack, exactly
as WAI dispatches a decode to a sink's codec. WAI owns the **receipt**.
## 1. Two receipts, cross-linked
### `wai.quantum.calibration` — `CalibrationReceipt`
A signed record of one bring-up / tune-up run:
- `device_id`, `target` (`"q3"`, `"cz(q3,q4)"`, `"readout:q3"`)
- `config_hash` — content hash of the applied pulse/gate config
- `evidence[]` — each an `{kind, blob_hash, summary}`: a benchmark outcome
(RB / T1·T2 / Rabi / readout-GMM) **content-addressed to its raw dataset bytes**,
so a fidelity *claim* binds to the exact bytes that produced it
(`evidence_matches()`) — checkable, not asserted
- `joules_micro` — measured energy of the run (attested), with its acquisition
class as an optional signed label: `quantum_energy::Labelled` wraps any
receipt here and re-signs it with the class inside the signature, and
`LabelledQbom` labels a bill of materials per entry
([energy-measurement](energy-measurement.md) §2.8). An unlabelled receipt
keeps its legacy bytes.
- `grant` — the authorization (below)
- `parent_receipt_hash` — the prior device state this supersedes: the signed
"digital twin" lineage vendors keep only as mutable, unsigned data
`merkle_root` covers `[config_hash] ++ evidence leaves`; one Ed25519 signature
covers the whole payload.
### `wai.quantum.job` — `JobReceipt`
A signed record of one dispatched circuit:
- `backend_id` — which QPU/sim actually ran it (`"ionq:aria-1"`, `"wai.quantum.circuit"`)
- `circuit_hash`, `result_hash` (counts histogram / statevector), `shots`
- **`calibration_ref`** — the `CalibrationReceipt::receipt_hash` of the device
state the job ran under. `verify_against_calibration(cal)` confirms the job
names *that* calibration and both verify — the QCIVET **"the claimed calibration
was actually in effect"** property, signed. `None` for a simulator.
- `joules_micro`, `grant`, `parent_receipt_hash`
## 2. The grant — gate ⊗ meter ⊗ receipt in one object
`GrantRef` = **capability ⊗ joule-ceiling** (⊗ optional funds-ceiling, JCP §4.8
dual ceiling). The full grant lives in the JCP layer; the receipt binds its content
hash plus the ceilings it enforces.
The enforcement is the sharp part: **the joule ceiling is checked inside
`verify()`.** A receipt whose measured `joules_micro` exceeds its grant ceiling is
**not valid** — an operation that blew its energy grant *cannot produce a passing
receipt*. This is the whole portfolio thesis (gate, meter, receipt) collapsed into
a single verifiable object. `honors_budget()` exposes the check on its own; a
grant with `joule_ceiling_micro = u64::MAX` opts out (still signs everything else).
## 3. Conformance
- A **conforming producer** (a control stack, or an adapter over one — see §5)
MUST seal a `CalibrationReceipt` per calibration run and a `JobReceipt` per
dispatched job, with `joules_micro` a **measured** figure (never fabricated;
`0`/unbounded if genuinely unmetered) and every hash the real content hash.
- A **conforming verifier** MUST accept a receipt iff `verify()` passes — Merkle
root recomputes, joules within the grant ceiling, signature valid — and, for a
job that claims a calibration state, `verify_against_calibration()` passes.
- Receipts are **portable**: JSON with hex hashes (`to_json`/`from_json`),
verifiable with only the public key. No vendor cloud required.
## 4. What this is NOT
- **Not a control system, not a simulator, not a calibration ML.** It attests
operations others perform. The physical control electronics and the ML tuning
models are the dispatched **backend** — WAI's founding "don't reinvent, dispatch"
philosophy (SPEC Appendix B), applied to quantum control.
- **Not a reconstruction.** `joules_micro` and the result are *attested* (only the
signer can vouch for their own silicon's energy draw); the hashes, Merkle root,
grant ceiling, and cross-link are *verifiable* by anyone. The receipt states
plainly which half is which.
## 5. Integration (where it attaches)
The natural attach point is the **control-system → cloud boundary**: the moment a
calibration node or a job completes, the control system already holds everything a
receipt needs (config, evidence datasets, result, timing, backend identity), and
the power rails are already instrumented — so adding a signature + a joule figure
is *incremental*. Ranked open-source insertion points:
1. **Quantify** (`quantify-core`) — one HDF5-write chokepoint, co-owned by Qblox +
OrangeQS: one adapter covers two vendors (Phase 1 target).
2. **OrangeQS Juice** — open lab-OS whose Task-Management + DB layer is a natural
control plane; production chip-testing, where a signed pass/fail has direct
commercial value.
3. **QUAlibrate/QUAM** — largest install base; the per-node boundary + the existing
`__package_versions__` hook upgrade cleanly to a signed, metered receipt.
4. **Qubex/qube-calib** (QuEL) — fully open, clean `CalibrationNote` artifact.
Adoptability is openness-first: Japan (QuEL/OQTOPUS), India (NQM), Korea (SDT/
NVQLink, Norma/PQC), and the Western merchant vendors (receipt as an anti-lock-in
feature). Sovereign closed champions are parallel, not addressable.
## 6. The unclaimed metric
"Joules per verified calibration" and "joules per QPU job" are unmeasured and
unclaimed across the entire field. This extension is the object that carries them —
signed, portable, content-addressed, and grant-bounded.