open-standards/wai/quantum-conformance/receipts/jobs/crafted-contract-currency-other.json
Transaction Science 2778ddd525 wai-quantum: the planner under a contract, its reasoning sealed, a provider's answer shadowed
Re-landed from PR #668 (branch wai/quantum-planner-contract, merged with main
495651ddd at 37350335b) as one commit on main, under the land-it model. Five
review rounds; round 5's findings (two high: workers that died as PID 1) were
fixed on the branch, and its CI reds were traced and fixed before landing.

A job may carry a contract (deadline, energy ceiling, cost, accuracy); the
planner chooses a route that meets it or refuses with every route's reason,
and its reasoning is sealed in the receipt. Under #676's reading child the
contract job is planned in the child from the per-method timings the parent
sends, bounded as a job naming its chosen method plus its reasoning, kept
across a restart. Both verifiers (Rust and receipt_verify.py) check the
planner statement beside wasmQ's; the receipts corpus is regenerated with
both kinds (268 crafted receipts, 14 plants caught). The views page carries
its engine raw-deflated and stays under its 1 MiB limit (669,484 bytes).

Passed before the push (Framework, linux; M3, macOS): every repository
check, receipts conformance, breaking, corpora, catalogue, the qpu clients,
energy (wai-rs, wai-quantum full, serve), the CLI tests and clippy, writer,
smoke, cross-simulator corpus, job receipts, wasmQ tests and vectors, the
engine with and without receipts under -D warnings, the docs pages, and the
service suite with clippy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 17:42:46 -05:00

450 lines
14 KiB
JSON

{
"status": "done",
"method": "provider",
"why": "on priced, reference:line-5 (wai.quantum.provider/1): compiled exactly to rzsxxcz on its qubits and checked by simulation here before it was sent",
"request": {
"qasm": "OPENQASM 3.0;\ninclude \"stdgates.inc\";\nqubit[2] q;\nbit[2] c;\nh q[0];\ncx q[0], q[1];\nc = measure q;\n",
"shots": 300,
"seed": 4,
"contract": {
"max_cost": {
"amount": "1",
"currency": "EUR"
},
"providers": "allowed"
},
"provider": "priced"
},
"result": {
"method": "provider",
"qubits": 2,
"gates": 2,
"accuracy": {
"class": "simulated",
"note": "counts from the provider's simulator or emulator, as provider.provenance names it, not measured on any device: classical software's sample of the program, read as counts_source says; they show what that software gives, under whatever noise it models, not what a device would"
},
"shots": 300,
"provider": {
"name": "priced",
"kind": "process",
"protocol": "wai.quantum.provider/1",
"device": "reference:line-5",
"provenance": "simulator:the wai-quantum exact simulator: the state vector in fixed point, sampled with the seed given",
"qubits": 5,
"basis": "rzsxxcz",
"describe": "c7626c0d9f68fe8e420df9cfe19f635427160bfe4902af2cc12c480b28d3b439"
},
"calibration": "reference-f2d9fe570421",
"compiled": {
"basis": "rzsxxcz",
"program": "b96b3d2e44387bac1dab89e43e29706788b0b6ed721f88d5c0f64be293c72df9",
"hash": "BLAKE3 of the program's OpenQASM 3 text, qasm3",
"qasm3": "OPENQASM 3.0;\ninclude \"stdgates.inc\";\nbit[2] c;\nrz(pi/2) $0;\nsx $0;\nrz(pi/2) $1;\nsx $1;\ncz $0, $1;\nrz(pi) $1;\nsx $1;\nrz(pi/2) $0;\nrz(pi/2) $1;\nc[0] = measure $0;\nc[1] = measure $1;\n",
"native_gates": 9,
"two_qubit_gates": 1,
"swaps": 0,
"layout": [
0,
1
],
"final_layout": [
0,
1
],
"checked": "the compiled program's final state equals the circuit's, each logical qubit on the physical qubit it ends on, by the bit-exact simulator here; nothing has been sent",
"placement": {
"chosen": "the compiler's own layout, the fewest swaps: the description states no errors"
}
},
"job": {
"id": "ref-1",
"polls": 1
},
"ideal": {
"computed": true,
"method": "exact",
"total_variation_distance": 0.03666666666666665,
"hellinger_fidelity": 0.998653743148044,
"sampling_tvd_expected": 0.023032943298089033,
"ideal_outcomes": 2,
"note": "the circuit's exact distribution over its classical bits, by the bit-exact state vector here, against the provider's counts: the total variation distance, the Hellinger fidelity, and the distance this many shots of the exact distribution would leave on average (by the normal approximation); a distance well above that is the device's or the simulator's error, or a program not run as sent"
},
"cost": {
"free": false,
"estimate": {
"free": false,
"amount": "0.09",
"currency": "USD",
"unit": "shot",
"seconds": 0.0
},
"charged": {
"amount": "0.09",
"currency": "USD"
},
"confirmed": true
},
"energy": {
"unmetered": "the work ran at the provider; this host's meter would read only the wait"
},
"counts_source": "shots",
"execution": {
"stated_by": "provider",
"mitigation": "none",
"twirling": "none",
"decoupling": "none",
"remapping": "none",
"optimisation": "none",
"verbatim": true,
"note": "the reference simulates the program's gates as written, on the qubits named, and corrects nothing"
},
"counts": {
"11": 161,
"00": 139
},
"distinct_outcomes": 2,
"omitted_shots": 0,
"engine": {
"name": "wai-quantum",
"version": "0.8.1"
},
"schema": "wai.quantum.job-result/1",
"planner": {
"format": "wai.quantum.planner/1",
"wanted": "simulated",
"wanted_from": "named",
"named": "provider:priced",
"question": "counts",
"auto": null,
"host": {
"job_bytes": 17179869184,
"providers": [
"priced"
]
},
"routes": [
{
"route": "method:exact",
"kind": "local",
"method": "exact",
"class": "bit-exact",
"host_dependent": false,
"auto_rank": 20,
"price": null,
"outcome": "rejected",
"rejected": {
"code": "not_named",
"why": "the job names another route"
}
},
{
"route": "method:statevector",
"kind": "local",
"method": "statevector",
"class": "exact",
"host_dependent": false,
"auto_rank": 30,
"price": null,
"outcome": "rejected",
"rejected": {
"code": "not_named",
"why": "the job names another route"
}
},
{
"route": "method:statevector_single",
"kind": "local",
"method": "statevector_single",
"class": "single",
"host_dependent": true,
"auto_rank": 40,
"price": null,
"outcome": "rejected",
"rejected": {
"code": "not_named",
"why": "the job names another route"
}
},
{
"route": "method:stabilizer",
"kind": "local",
"method": "stabilizer",
"class": "exact",
"host_dependent": false,
"auto_rank": 10,
"price": null,
"outcome": "rejected",
"rejected": {
"code": "not_named",
"why": "the job names another route"
}
},
{
"route": "method:pauli",
"kind": "local",
"method": "pauli",
"class": "bounded",
"host_dependent": false,
"auto_rank": null,
"price": null,
"outcome": "rejected",
"rejected": {
"code": "not_named",
"why": "the job names another route"
}
},
{
"route": "method:mps",
"kind": "local",
"method": "mps",
"class": "heuristic",
"host_dependent": false,
"auto_rank": 60,
"price": null,
"outcome": "rejected",
"rejected": {
"code": "not_named",
"why": "the job names another route"
}
},
{
"route": "method:stabilizer_rank",
"kind": "local",
"method": "stabilizer_rank",
"class": "exact",
"host_dependent": false,
"auto_rank": null,
"price": null,
"outcome": "rejected",
"rejected": {
"code": "not_named",
"why": "the job names another route"
}
},
{
"route": "method:tensor_network",
"kind": "local",
"method": "tensor_network",
"class": "exact",
"host_dependent": false,
"auto_rank": null,
"price": null,
"outcome": "rejected",
"rejected": {
"code": "not_named",
"why": "the job names another route"
}
},
{
"route": "method:cutrank",
"kind": "local",
"method": "cutrank",
"class": "exact",
"host_dependent": false,
"auto_rank": 50,
"price": null,
"outcome": "rejected",
"rejected": {
"code": "not_named",
"why": "the job names another route"
}
},
{
"route": "method:cutrank_single",
"kind": "local",
"method": "cutrank_single",
"class": "single",
"host_dependent": true,
"auto_rank": null,
"price": null,
"outcome": "rejected",
"rejected": {
"code": "not_named",
"why": "the job names another route"
}
},
{
"route": "method:density_matrix",
"kind": "local",
"method": "density_matrix",
"class": "exact",
"host_dependent": false,
"auto_rank": null,
"price": null,
"outcome": "rejected",
"rejected": {
"code": "not_named",
"why": "the job names another route"
}
},
{
"route": "method:trajectories",
"kind": "local",
"method": "trajectories",
"class": "estimate",
"host_dependent": false,
"auto_rank": null,
"price": null,
"outcome": "rejected",
"rejected": {
"code": "not_named",
"why": "the job names another route"
}
},
{
"route": "method:pulse",
"kind": "local",
"method": "pulse",
"class": "bounded",
"host_dependent": false,
"auto_rank": null,
"price": null,
"outcome": "rejected",
"rejected": {
"code": "not_named",
"why": "the job names another route"
}
},
{
"route": "provider:priced",
"kind": "provider",
"provider": "priced",
"class": "simulated",
"host_dependent": true,
"price": {
"money": {
"free": false,
"amount": "0.09",
"currency": "USD",
"unit": "shot"
},
"time": {
"seconds": 0.0,
"basis": "provider"
},
"memory_bytes": null,
"work": null,
"energy": {
"joules": null,
"why": "no provider states a job's energy before it runs"
},
"leaves_out": [
"energy",
"mitigation",
"decoder",
"charged"
],
"program": {
"shots": 300,
"native_gates": 9,
"two_qubit_gates": 1,
"swaps": 0
}
},
"device": "reference:line-5",
"provenance": "simulator:the wai-quantum exact simulator: the state vector in fixed point, sampled with the seed given",
"outcome": "chosen"
}
],
"choice": "provider:priced",
"why": "the route the job names, which meets its contract (1 of 14 routes)",
"stable": {
"scope": "digest: what each route that depends on nothing of the host costs, the same for this request and job memory on every host of one engine; choice: whether the route chosen is one of those whatever the host",
"routes": [
"method:exact",
"method:statevector",
"method:stabilizer",
"method:pauli",
"method:mps",
"method:stabilizer_rank",
"method:tensor_network",
"method:cutrank",
"method:density_matrix",
"method:trajectories",
"method:pulse"
],
"digest": "42dab8b20f638eeb9c1d46fd7a0890b574c641a1e11d1306da2abc201ca84c5f",
"choice": false
},
"shadow": {
"route": "method:exact",
"class": "bit-exact",
"request": {
"qasm": "OPENQASM 3.0;\ninclude \"stdgates.inc\";\nqubit[2] q;\nbit[2] c;\nh q[0];\ncx q[0], q[1];\nc = measure q;\n",
"shots": 300,
"seed": 4294967300,
"method": "exact"
},
"budget_seconds": 300.0,
"price": {
"money": {
"free": true
},
"time": {
"seconds": 4e-08,
"basis": "nominal"
},
"memory_bytes": 134217920,
"work": 8,
"energy": {
"joules": null,
"why": "this host estimates no job's energy before it runs"
},
"leaves_out": []
}
},
"kept": {
"cost": {
"max_cost": {
"amount": "1",
"currency": "USD"
},
"charged": {
"amount": "0.09",
"currency": "USD"
},
"kept": true
}
}
},
"shadow": {
"ran": true,
"route": "method:exact",
"accuracy": {
"class": "bit-exact"
},
"request": {
"qasm": "OPENQASM 3.0;\ninclude \"stdgates.inc\";\nqubit[2] q;\nbit[2] c;\nh q[0];\ncx q[0], q[1];\nc = measure q;\n",
"shots": 300,
"seed": 4294967300,
"method": "exact"
},
"shots": 300,
"counts": {
"00": 161,
"11": 139
},
"distinct_outcomes": 2,
"omitted_shots": 0,
"distance": {
"computed": true,
"numerator": 44,
"denominator": 600,
"total_variation": 0.07333333333333333,
"hellinger_fidelity": 0.9946222222222221,
"sampling_tvd_bound": 0.04602751441903442
},
"elapsed_ms": 0
},
"receipt": {
"alg": "ed25519",
"canon": "rfc8785",
"key": "197f6b23e16c8532c6abc838facd5ea789be0c76b2920334039bfa8b3d368d61",
"digest": "6addfa40b6f4b7c0a2e9138143e62fcfc82e8c1dbc696e279b615c1978936c63",
"signature": "3d7c4c8bf556f0a0cd5449e2f8c440931f98cb6dec1b65932349ff78985e6af65c6992fa971f331ed9550fb4d5cb6cb114c29a9d0ddf203839b37bd05484f206"
}
},
"id": "pj-e158396f1fd8f81d",
"submitted_ms": 1794033072602,
"finished_ms": 1794033072605
}