Skip to main content

WAI Extension: Quantum-Operations Attestation (wai.quantum.calibration · wai.quantum.job · wai.quantum.mitigate · wai.quantum.decode · wai.quantum.compile · wai.quantum.rearrange)

Mirrored from the canonical text at commit 498e6b88 ().

Status: Draft. Engine: wai-quantum/src/quantum_ops.rs (feature quantum_ops, which wai-rs forwards under the same name and re-exports as wai::quantum_ops), with the energy forms of wai-quantum/src/quantum_energy.rs. The verify-half of WAI (wai.asset.provenance’s lineage, specialized) applied to the operations around a quantum processor.

0. What this extension adds

A calibration run or a job on a quantum processor leaves a dataset, a state snapshot and a log; so does each classical step around it: the mitigation of its counts, the decoding of a syndrome, the compilation of a circuit, the rearrangement of a neutral-atom register. This extension adds a receipt over each operation with two properties:

  1. cryptographic signature + portability: a record a third party verifies from the bytes alone, by the rules of §3, which are complete: a verifier written from them alone agrees with the reference on every vector of the corpus (§4);
  2. joules, or a statement that nobody measured them: the energy of the operation with its acquisition class, or the unmetered form with its reason (§3.5), and never a figure of zero joules for a run nobody read.

Version capture of the software that ran, bills of materials and hash-chained audit traces exist elsewhere; the receipt here is signed, content-addressed and grant-bounded. It is not a control system and runs no hardware: the operation is performed by the sink’s control stack, exactly as WAI dispatches a decode to a sink’s codec. WAI owns the receipt.

1. The records

Six records, one per operation, each sealed the same way (§3): a payload of fixed binary framing, signed with Ed25519, whose content hashes are bound by a BLAKE3 Merkle root. Each carries a grant (§2), an optional parent_receipt_hash (the identity, §3.4, of the receipt this one follows: a signed lineage), its signer’s key and label, and its energy (§3.5).

1.1 Calibration (wai.quantum.calibration)

A signed record of one bring-up or tune-up run (CalibrationReceipt; the calibration engines of quantum_cal, quantum_control and quantum_noise produce what it binds):

1.2 Jobs (wai.quantum.job)

A signed record of one dispatched circuit (JobReceipt):

1.3 Mitigation (wai.quantum.mitigate)

A signed record of one classical error-mitigation step (MitigationReceipt): the raw data and the optional noise model that went in, the estimate that came out.

1.4 Decoding (wai.quantum.decode)

A signed record of one error-correction decode (DecodeReceipt): code_id, decoder, check_matrix_hash, syndrome_hash, correction_hash, converged (the correction reproduces the syndrome), rounds (a u32), work_messages (the messages passed), and joules_micro, grant, parent_receipt_hash. Whether a correction leaves a logical error is not a member: a decoder that sees only a syndrome cannot know it.

1.5 Compilation (wai.quantum.compile)

A signed record that a compiled circuit is equivalent to its source (CompileReceipt): source_hash, target_hash (the routed circuit and its final map), coupling_hash, method ("clifford-tableau"), equivalent, swaps (a u32), work, and joules_micro, grant, parent_receipt_hash.

1.6 Register preparation (wai.quantum.rearrange)

A signed record of a neutral-atom rearrangement plan (RearrangeReceipt): initial_hash (the loaded occupancy), target_hash (the target sites), plan_hash (the moves), method ("hungarian-lsap"), success (every target site filled), atoms_moved (a u32), total_distance, and joules_micro, grant, parent_receipt_hash.

2. The grant

GrantRef = capability ⊗ joule ceiling (⊗ an optional funds ceiling, JCP §4.8 dual ceiling). The full grant lives in the JCP layer; the receipt binds its content hash (grant_hash), its capability, joule_ceiling_micro and funds_ceiling.

The joule ceiling is checked inside verification (§3.6): a receipt whose joules_micro exceeds its grant’s ceiling is not valid, so an operation that blew its energy grant cannot produce a passing receipt. A ceiling of 2^64 − 1 is no ceiling. An unmetered run (§3.5) has no figure to hold to the ceiling: the check passes, since its sealed figure is 0, and a verifier states that the ceiling was not checked, because the run was not metered.

3. Encoding and verification

This section is complete: it is what the reference does, and a verifier written from it alone gives every receipt of the corpus its verdict (§4). The reference’s own words are seal, to_json, from_json, verify and receipt_hash of each type, and quantum_energy::MaybeLabelled for a receipt in any form.

3.1 Primitives

3.2 Reading a receipt

A receipt is JSON (RFC 8259), its text UTF-8, its value an object. The reference writes its members in the order of the table below, with no space, but the order and the spacing are not read. The receipt does not read when any of these holds; the reason is §3.6’s:

  1. the text is not UTF-8, not JSON, or its value is not an object; or a string in it has an escape that is no Unicode scalar value (a lone surrogate); or an object in it names a member twice, two names being the same when their escapes read as the same characters ("a" and "a") (unreadable);
  2. kind is absent, or is not the kind’s string below (kind);
  3. a member the kind requires is absent, or not of its form (member):
    • a digest is a string of exactly 64 lower-case hex digits (0–9, a–f); sig is one of 128, and signer_pubkey one of 64;
    • a count is a JSON number written as an integer: digits only, with no sign, fraction or exponent, of value 0 to 2^64 − 1 (1.0, 1e0, -0 and +1 are not counts); a u32 count (rounds, swaps, atoms_moved) is a count of at most 2^32 − 1, and one past it does not read (it is never read as its low bits);
    • a signed integer (raw_estimate_fx, mitigated_estimate_fx, error_bar_fx) is a JSON number written as an integer, an optional - then digits, of value −2^63 to 2^63 − 1, and not -0;
    • a string is a JSON string; a boolean is true or false;
    • an optional digest (parent_receipt_hash, calibration_ref, noise_model_hash) is absent or null for none, or a digest; any other value does not read;
    • grant is an object with grant_hash (a digest), capability (a string), joule_ceiling_micro (a count) and funds_ceiling, absent or null for none or a count, any other value not reading;
    • evidence is an array, each entry an object with kind (a string), blob_hash (a digest) and summary (a string);
  4. the energy members break §3.5’s reading (energy_form).
kindrecordmembers it requires, beside kind, grant, joules_micro, parent_receipt_hash, sig, signer_id, signer_pubkey
quantum-calibration§1.1config_hash, device_id, evidence, merkle_root, target
quantum-job§1.2backend_id, calibration_ref (optional), circuit_hash, merkle_root, result_hash, shots
quantum-mitigate§1.3backend_id, error_bar_fx, input_hash, merkle_root, method, mitigated_estimate_fx, noise_model_hash (optional), observable, raw_estimate_fx, shots
quantum-decode§1.4check_matrix_hash, code_id, converged, correction_hash, decoder, rounds, syndrome_hash, work_messages
quantum-compile§1.5coupling_hash, equivalent, method, source_hash, swaps, target_hash, work
quantum-rearrange§1.6atoms_moved, initial_hash, method, plan_hash, success, target_hash, total_distance

What is read and decides nothing. These are not sealed, and a verifier does not read them:

3.3 The payloads

Each kind’s payload, in its form (§3.5). M(l) is the Merkle root of the list of hashes l: each hash h becomes the leaf H("moq-jwp:merkle-leaf" ‖ 0x01 ‖ h); while a level holds more than one node, an odd level repeats its last node, and each pair a, b becomes H("moq-jwp:merkle-node" ‖ 0x01 ‖ a ‖ b); one node is the root. (The lists here are never empty.)

kinddomain Dpayload
calibrationwai:quantum-calibrationD' ‖ str(device_id) ‖ str(target) ‖ config_hash ‖ merkle_root ‖ u64(number of evidence entries) ‖ u64(joules_micro) ‖ E ‖ tail
jobwai:quantum-jobD' ‖ str(backend_id) ‖ circuit_hash ‖ result_hash ‖ opt(calibration_ref) ‖ u64(shots) ‖ merkle_root ‖ u64(joules_micro) ‖ E ‖ tail
mitigatewai:quantum-mitigateD' ‖ str(backend_id) ‖ str(method) ‖ str(observable) ‖ input_hash ‖ opt(noise_model_hash) ‖ i64(raw_estimate_fx) ‖ i64(mitigated_estimate_fx) ‖ i64(error_bar_fx) ‖ u64(shots) ‖ merkle_root ‖ u64(joules_micro) ‖ E ‖ tail
decodewai:quantum-decodeD' ‖ str(code_id) ‖ str(decoder) ‖ check_matrix_hash ‖ syndrome_hash ‖ correction_hash ‖ u8(converged) ‖ u32(rounds) ‖ u64(work_messages) ‖ M([check_matrix_hash, syndrome_hash, correction_hash]) ‖ u64(joules_micro) ‖ E ‖ tail
compilewai:quantum-compileD' ‖ source_hash ‖ target_hash ‖ coupling_hash ‖ str(method) ‖ u8(equivalent) ‖ u32(swaps) ‖ u64(work) ‖ M([source_hash, target_hash, coupling_hash]) ‖ u64(joules_micro) ‖ E ‖ tail
rearrangewai:quantum-rearrangeD' ‖ initial_hash ‖ target_hash ‖ plan_hash ‖ str(method) ‖ u8(success) ‖ u32(atoms_moved) ‖ u64(total_distance) ‖ M([initial_hash, target_hash, plan_hash]) ‖ u64(joules_micro) ‖ E ‖ tail

A boolean is u8 1 for true and 0 for false. The merkle_root a calibration, job or mitigation receipt writes is the one its payload holds, and it must be the root of its leaves:

3.4 The identity

A receipt’s identity, its receipt_hash, is H(I ‖ payload ‖ sig), with I the kind’s identity domain (wai:quantum-calibration-id, wai:quantum-job-id, wai:quantum-mitigate-id, wai:quantum-decode-id, wai:quantum-compile-id, wai:quantum-rearrange-id, each followed by 0x01 in every form) and payload the payload of the form it is in (§3.5). Another receipt names this one by its identity: a parent_receipt_hash, or a job’s calibration_ref.

3.5 Energy: a figure, or unmetered, never zero for a run nobody read

A receipt is in one of three forms, which its JSON decides:

formits JSONE (§3.1) and D'
a figure, unlabelled (the legacy form)joules_micro a count; no energy_ membernothing; D
a figure, labelled (energy-measurement §2.8)joules_micro a count of at least 1; energy_provenance and its evidence (energy-measurement §2.7)the class’s signed encoding (energy-measurement §2.7); D with 0x02
unmeteredjoules_micro null; energy_unmetered, the reason, a stringu8(0) ‖ u32(byte length of the reason) ‖ the reason in UTF-8; D with 0x02

The labelled form’s class is ModelBased (tag 2), Estimator (3), OnChipCounter (4, then u32(relative_ppm) ‖ u64(window_us) ‖ u8(filtering), filtering 0 Unknown, 1 Off, 2 On) or CalibratedInstrument (5, then u32(relative_ppm) ‖ u64(window_us) ‖ u32(byte length of the reference) ‖ the reference in UTF-8). The unmetered form seals its figure as 0 and its tag as energy-measurement §2.7’s tag 0, no class, followed by the reason.

Reading the energy members (§3.2, energy_form). Of energy_provenance, energy_uncertainty, energy_counter_filtering and energy_calibration_ref, one whose value is null is read as absent.

What each form says, and how a 0 is read.

The reference reads either unmetered form through MaybeLabelled::unmetered() (the reason, or that the receipt is of the legacy form) and gives a figure only through MaybeLabelled::joules_micro(), which is never Some(0).

3.6 What a verifier checks

A verifier reads the receipt (§3.2, §3.5) and then checks, in its form:

reasonwhen
unreadable, kind, member, energy_formthe receipt does not read (§3.2). Reported alone: nothing else is checked
string_nula string str() frames (§3.1) holds U+0000: device_id, target, an evidence entry’s kind, backend_id, method, observable, code_id, decoder, or the grant’s capability. Such a string could be read as two, so that two receipts would sign the same bytes
merkle_roota calibration, job or mitigation receipt’s merkle_root is not the root of its leaves (§3.3)
ceilingjoules_micro is more than the grant’s joule_ceiling_micro (§2)
energythe labelled form’s figure is 0 (a class beside no figure), or its declared uncertainty is below the resolution floor, joules_micro × relative_ppm < 288 676 (energy-measurement §2.3); or the unmetered form’s reason is empty or more than 4096 bytes
bad_keysigner_pubkey is refused by the strict rule’s checks of the key (§3.1). The signature is then not checked
bad_signaturethe signature over the payload of the receipt’s form does not hold, strictly

The receipt is valid exactly when there is no reason. The reference’s verify() (of each type, of Labelled, of Unmetered, and of MaybeLabelled) is true exactly then, and its from_json gives None exactly when the receipt does not read. A receipt whose label or reason was added, stripped or restated after it was sealed fails bad_signature: the form is inside the signature through D' and E.

Beside a receipt’s own validity, a verifier given more checks more:

4. Conformance

5. What this is NOT

6. 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 (configuration, evidence datasets, result, backend identity), and its power rails are already instrumented, so adding a signature and a joule figure is incremental. In an open calibration framework, three points do it: the one place a node writes its dataset, which covers every node; the per-node boundary where the framework records the versions of the packages that ran; and, in a lab’s task and database layer, the point where a production test records its pass or fail.

7. The metric

This extension carries joules per verified calibration, per job, per mitigation, per decode, per compile and per rearrangement as signed, portable, content-addressed, grant-bounded records, and says so where nobody measured them.

8. What is not part of this extension

Two more records the reference seals are not part of the standard: their labels are not registered, no text specifies their encoding, and no verifier other than the reference’s is held to them.

A later revision may register either with a text and vectors of its own.