open-standards/wai/quantum-conformance/answers/manifest.json
Transaction Science 6a18101d12 wai-quantum: the answer view layer, its codes and conformance set, and correctness records
engine::answer reads wai.quantum.answer/1: view statements over an
OpenQASM 3 program (Histogram, Verdict, Equivalence, Bloch, Estimate,
Receipt and the rest, fourteen in all), each view's numbers bound to an
engine call written with @ (@Sample, @Check, @Seal, eleven in all), so a
model's answer shows numbers the engine computed. One statement a line,
the program in a named qasm fence, root first, forward references, and a
later declaration standing as the edit. The reader streams: a snapshot
says what is ready, pending or dropped, and the finished answer is the
whole text's at every split (tested at every split point). Every problem
has a stable code: a program's keep the reader's Q codes, a statement's
are the new J100 to J112, each dropped, defaulted or warned, and only the
dropped ones are errors a model is sent back. eval carries the calls out
on the engine (a run's time left out), seals what @Seal names in a job's
form, and checks a stored answer's receipt marker by running it again.

The conformance set (quantum-conformance/answers/, 20 cases, every code)
passes natively, under wasm32-wasip2 and in the browser, where the stored
case written natively verifies to the same bytes. wai-web gains
AnswerStream and the answer and telemetry calls (pins 24 native, 16 wasm32).

engine::telemetry defines the correctness record (codes, verdict level,
repairs, the person's accept or reject, the receipt) and turns the failures
among records into an eval corpus in the conformance format.

The specification (extensions/quantum-answers.md) is a draft whose token
comparison is still to come.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 08:42:54 -04:00

451 lines
10 KiB
JSON

{
"format": "wai.quantum-answer-conformance/1",
"about": "Answers in the answer view layer (wai/extensions/quantum-answers.md), each with what the layer must make of it: the codes of its errors (the problems a model is sent back) and of its warnings, in the order of their lines; its root; the order its views are drawn in; and, run on the engine, what its views show. A stored answer's receipt is checked by running the answer again. bell-stored is bell with the marker its seal gives under the key whose seed is 32 bytes of 3, and bell-stored-changed the same with one sample's shots changed; a test writes both from bell.",
"expect": {
"errors": "the codes of the diagnostics whose outcome is dropped or refused, in line order",
"warnings": "the codes of the others (defaulted, warned, or a program's warning), in line order",
"root": "the root statement's name, or null",
"order": "the statements drawn, in order",
"run": "for a statement: total (the counts' sum), outcomes (the only outcomes seen), level and holds (a verdict), verdict (an equivalence), expectations (each value), bloch_x, sealed (the names a seal covers)",
"same_as": "the case whose answer this one must equal, its digest included",
"stored": "whether the receipt its marker carries verifies when the answer is run again"
},
"cases": [
{
"name": "bell",
"file": "cases/bell.wqa",
"covers": [
"a well-formed answer: a program, a sample, a verdict and a seal"
],
"expect": {
"errors": [],
"warnings": [],
"root": "root",
"order": [
"bell",
"counts",
"check",
"seal"
],
"run": {
"counts": {
"total": 1000,
"outcomes": [
"00",
"11"
]
},
"check": {
"level": "proof",
"holds": true
},
"seal": {
"sealed": [
"bell",
"counts",
"check"
]
}
}
}
},
{
"name": "bell-crlf",
"file": "cases/bell-crlf.wqa",
"covers": [
"CRLF line ends read as LF: the same answer and the same digest"
],
"expect": {
"errors": [],
"warnings": [],
"root": "root",
"order": [
"bell",
"counts",
"check",
"seal"
],
"same_as": "bell"
}
},
{
"name": "ghz-prepares",
"file": "cases/ghz-prepares.wqa",
"covers": [
"an intent named by a reference program whose state it must prepare"
],
"expect": {
"errors": [],
"warnings": [],
"root": "root",
"order": [
"ghz",
"check"
],
"run": {
"check": {
"level": "proof",
"holds": true
}
}
}
},
{
"name": "grover-equivalent",
"file": "cases/grover-equivalent.wqa",
"covers": [
"the equivalence ladder, and a distribution of one outcome"
],
"expect": {
"errors": [],
"warnings": [],
"root": "root",
"order": [
"same",
"check"
],
"run": {
"same": {
"verdict": "equivalent"
},
"check": {
"level": "proof",
"holds": true
}
}
}
},
{
"name": "wrong-distribution",
"file": "cases/wrong-distribution.wqa",
"covers": [
"an intent that fails, decided by proof"
],
"expect": {
"errors": [],
"warnings": [],
"root": "root",
"order": [
"check"
],
"run": {
"check": {
"level": "proof",
"holds": false
}
}
}
},
{
"name": "state-views",
"file": "cases/state-views.wqa",
"covers": [
"a circuit, expectation values, amplitudes and a Bloch vector, each the engine's"
],
"expect": {
"errors": [],
"warnings": [],
"root": "root",
"order": [
"circ",
"z",
"amps",
"plus"
],
"run": {
"z": {
"expectations": [
1.0,
1.0
]
},
"plus": {
"bloch_x": 1.0
}
}
}
},
{
"name": "calls-named-apart",
"file": "cases/calls-named-apart.wqa",
"covers": [
"an engine call as a statement of its own, named by the view; a forward reference; a value no view uses"
],
"expect": {
"errors": [],
"warnings": [
"J112"
],
"root": "root",
"order": [
"counts",
"check"
],
"run": {
"counts": {
"total": 200,
"outcomes": [
"00",
"11"
]
}
}
}
},
{
"name": "no-root",
"file": "cases/no-root.wqa",
"covers": [
"no root: the views in the order written"
],
"expect": {
"errors": [],
"warnings": [
"J107"
],
"root": null,
"order": [
"circ",
"counts"
]
}
},
{
"name": "number-in-a-view",
"file": "cases/number-in-a-view.wqa",
"covers": [
"a number where a view takes the engine's call"
],
"expect": {
"errors": [
"J106",
"J104"
],
"warnings": [
"J112"
],
"root": "root",
"order": []
}
},
{
"name": "unknown-view-and-call",
"file": "cases/unknown-view-and-call.wqa",
"covers": [
"a view and engine calls the layer does not have; the root listing an engine call, which it does not take, leaves it out"
],
"expect": {
"errors": [
"J104",
"J106",
"J101",
"J102",
"J102"
],
"warnings": [
"J112"
],
"root": "root",
"order": []
}
},
{
"name": "missing-and-extra-arguments",
"file": "cases/missing-and-extra-arguments.wqa",
"covers": [
"an argument missing, and one too many"
],
"expect": {
"errors": [
"J106",
"J103"
],
"warnings": [
"J105"
],
"root": "root",
"order": [
"b"
]
}
},
{
"name": "a-program-that-does-not-read",
"file": "cases/a-program-that-does-not-read.wqa",
"covers": [
"the reader's refusal keeps its code; what names the program falls with it; a name nothing declares"
],
"expect": {
"errors": [
"J106",
"Q103",
"J106",
"J106"
],
"warnings": [],
"root": "root",
"order": []
}
},
{
"name": "truncated-program",
"file": "cases/truncated-program.wqa",
"covers": [
"the text ends inside a program"
],
"expect": {
"errors": [
"J106",
"J106",
"J108"
],
"warnings": [],
"root": "root",
"order": []
}
},
{
"name": "truncated-statement",
"file": "cases/truncated-statement.wqa",
"covers": [
"the text ends inside a statement"
],
"expect": {
"errors": [
"J106",
"J108"
],
"warnings": [],
"root": "root",
"order": [
"bell"
]
}
},
{
"name": "cycle",
"file": "cases/cycle.wqa",
"covers": [
"statements that name each other"
],
"expect": {
"errors": [
"J106",
"J109",
"J109"
],
"warnings": [
"J112"
],
"root": "root",
"order": []
}
},
{
"name": "edit-by-redeclaring",
"file": "cases/edit-by-redeclaring.wqa",
"covers": [
"a later declaration stands: an edit"
],
"expect": {
"errors": [],
"warnings": [
"J110"
],
"root": "root",
"order": [
"counts"
],
"run": {
"counts": {
"total": 500,
"outcomes": [
"00",
"11"
]
}
}
}
},
{
"name": "prose-and-unused",
"file": "cases/prose-and-unused.wqa",
"covers": [
"a number in prose, and a view the root does not reach"
],
"expect": {
"errors": [],
"warnings": [
"J111",
"J112"
],
"root": "root",
"order": [
"note",
"circ"
]
}
},
{
"name": "lines-that-are-not-statements",
"file": "cases/lines-that-are-not-statements.wqa",
"covers": [
"prose, a fence that opens no program, and a marker this layer does not read"
],
"expect": {
"errors": [
"J100",
"J100",
"J100"
],
"warnings": [],
"root": "root",
"order": [
"circ"
]
}
},
{
"name": "bell-stored",
"file": "cases/bell-stored.wqa",
"covers": [
"a stored answer with its receipt marker: run again, the receipt verifies"
],
"expect": {
"errors": [],
"warnings": [],
"root": "root",
"order": [
"bell",
"counts",
"check",
"seal"
],
"stored": {
"valid": true
}
}
},
{
"name": "bell-stored-changed",
"file": "cases/bell-stored-changed.wqa",
"covers": [
"the stored answer with a statement changed: the receipt does not verify"
],
"expect": {
"errors": [],
"warnings": [],
"root": "root",
"order": [
"bell",
"counts",
"check",
"seal"
],
"stored": {
"valid": false
}
}
}
]
}