{ "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 } } } ] }