{ "versions_meta": "science.transaction.wai/versions", "tools": [ { "name": "run_quantum_circuit", "title": "Run a quantum program here", "description": "Run an OpenQASM program on this machine, planned as the quantum job service plans it: measurement counts, Pauli expectation values and/or amplitudes, the method chosen and why, its accuracy class, and a receipt signed with this user's key. Give `intent` (an exact distribution, or a reference program it must equal or whose state it must prepare) and the engine checks it with the run. Every answer carries `verdict`: the level the engine checked to (proof, evidence, executed, parsed, refused), whether the intent holds and a plain statement, sealed in the receipt. Quote the verdict and the numbers; do not estimate them or claim more.", "inputSchema": { "type": "object", "required": [ "qasm" ], "properties": { "qasm": { "type": "string", "description": "The program, OpenQASM 3 or 2: registers and broadcast over them, the standard gates, ctrl/negctrl modifiers, gate definitions, measurement and reset anywhere, if on measured bits, and generators (integer input, const and for loops, one program for a family of circuits; give the inputs' values in \"inputs\"). while, inv and pow are refused with their line." }, "inputs": { "type": "object", "additionalProperties": { "type": "integer" }, "description": "Values for a generator's integer inputs, as {\"n\": 5}: the program is read as its family's circuit at those values." }, "shots": { "type": "integer", "minimum": 0, "description": "Shots to sample; 1024 when nothing else is asked." }, "seed": { "type": "integer", "minimum": 0, "description": "The sampling seed (default 1)." }, "method": { "type": "string", "description": "auto (the default: the strongest method the program admits), or one of list_methods' names." }, "observables": { "type": "array", "items": { "type": "string" }, "description": "Pauli observables, as \"Z0 Z1\" or \"0.5 X2\"." }, "amplitudes": { "type": "array", "items": { "type": "string" }, "description": "Basis states whose amplitudes to return, as bit strings with the highest qubit first." }, "noise": { "type": "object", "description": "Channel probabilities", "properties": { "depolarizing_1q": { "type": "number", "minimum": 0, "maximum": 1 }, "depolarizing_2q": { "type": "number", "minimum": 0, "maximum": 1 }, "amplitude_damping": { "type": "number", "minimum": 0, "maximum": 1 }, "dephasing": { "type": "number", "minimum": 0, "maximum": 1 }, "readout": { "type": "number", "minimum": 0, "maximum": 1 } }, "additionalProperties": false }, "options": { "type": "object", "description": "Method options: max_bond, fusion, trajectories, threshold, memory_gb." }, "compile": { "type": "object", "description": "Compile the program first (as compile_qasm does) and run the compiled circuit: with basis clifford_t it runs bit-exact, and the result's \"compiled\" states its distance from the program.", "properties": { "epsilon": { "type": "number", "exclusiveMinimum": 0, "description": "The most the output may differ from the program in the operator norm, up to a global phase, shared by its rotations (default 1e-6)." }, "level": { "type": "integer", "minimum": 0, "maximum": 2, "description": "0: lower and approximate; 1 (default): also checked rewrites and phase folding; 2: also one- and two-qubit resynthesis." }, "basis": { "type": "string", "enum": [ "clifford_t", "standard" ], "description": "clifford_t (default): every rotation off the multiples of π/4 written as a Clifford+T word; standard: nothing approximated." }, "twirl": { "description": "Twirl each two-qubit Clifford gate with Paulis from a seeded stream: true, or {\"seed\": N}. One seed is one instance, checked to be the same circuit." }, "dd": { "type": "string", "enum": [ "xx", "xy4" ], "description": "Dynamical decoupling in each window where a qubit idles long enough, checked to change nothing without noise." } } }, "target": { "description": "A device target: its name (list_targets) or a target document (wai.quantum.target/1). The program is then compiled to the target's gates, placed where it is most likely to succeed and simulated under the target's noise, the target's hash in the receipt; noise may not be given beside it." }, "intent": { "description": "What the program must do, checked by the engine with the run: the result's \"verdict\" states how far it checked (proof, evidence, executed, parsed, refused) and whether the intent holds, sealed by the receipt.", "anyOf": [ { "type": "object", "description": "One of distribution, equivalent, prepares or sampled; with note, name, and \"require\": \"proof\" (evidence then counts as unchecked).", "properties": { "distribution": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 }, "description": "The exact distribution of the measured bits, keyed by the classical bits with the highest bit first, as {\"00\": 0.5, \"11\": 0.5}." }, "tolerance": { "type": "number", "minimum": 0, "maximum": 1, "description": "For a distribution: the total variation distance it is held within (default 1e-9)." }, "equivalent": { "type": "string", "description": "A reference program's text: the same circuit up to a global phase, by the equivalence ladder." }, "prepares": { "type": "string", "description": "A reference program's text: the same state from |0…0⟩, the same qubits measured into the same bits." }, "sampled": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 }, "description": "A distribution the program's samples are held to: the program run as the job runs it for `shots` at `seed`, and the counts tested by `test` at the significance level `alpha` (all three required). Evidence, never proof." }, "test": { "enum": [ "chi_squared", "g_test" ], "description": "For a sampled intent: Pearson's chi-squared test, or the G-test (the likelihood ratio)." }, "alpha": { "type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 1, "description": "For a sampled intent: the significance level, as 0.01." }, "shots": { "type": "integer", "minimum": 1, "description": "For a sampled intent: the samples the test takes." }, "seed": { "type": "integer", "minimum": 0, "description": "For a sampled intent: the sampling seed (default: the job's)." }, "require": { "const": "proof" }, "note": { "type": "string" }, "name": { "type": "string" } } }, { "type": "array", "items": { "type": "object", "description": "One of distribution, equivalent, prepares or sampled; with note, name, and \"require\": \"proof\" (evidence then counts as unchecked).", "properties": { "distribution": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 }, "description": "The exact distribution of the measured bits, keyed by the classical bits with the highest bit first, as {\"00\": 0.5, \"11\": 0.5}." }, "tolerance": { "type": "number", "minimum": 0, "maximum": 1, "description": "For a distribution: the total variation distance it is held within (default 1e-9)." }, "equivalent": { "type": "string", "description": "A reference program's text: the same circuit up to a global phase, by the equivalence ladder." }, "prepares": { "type": "string", "description": "A reference program's text: the same state from |0…0⟩, the same qubits measured into the same bits." }, "sampled": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 }, "description": "A distribution the program's samples are held to: the program run as the job runs it for `shots` at `seed`, and the counts tested by `test` at the significance level `alpha` (all three required). Evidence, never proof." }, "test": { "enum": [ "chi_squared", "g_test" ], "description": "For a sampled intent: Pearson's chi-squared test, or the G-test (the likelihood ratio)." }, "alpha": { "type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 1, "description": "For a sampled intent: the significance level, as 0.01." }, "shots": { "type": "integer", "minimum": 1, "description": "For a sampled intent: the samples the test takes." }, "seed": { "type": "integer", "minimum": 0, "description": "For a sampled intent: the sampling seed (default: the job's)." }, "require": { "const": "proof" }, "note": { "type": "string" }, "name": { "type": "string" } } }, "minItems": 1 } ] }, "repair": { "description": "Repair the program first, on the lines its diagnostics flag alone (as repair_qasm does): true, or the choices {\"max_iterations\": N, \"dyadic_bits\": K, \"sizes\": {\"q\": 3}}. The result's \"repaired\" holds the program that ran and each repair." }, "mitigate": { "description": "Mitigate the job's expectation values (or, for readout, its counts) under its own noise: zne (the whole program folded U(U†U)^k and extrapolated), pea (the noise learned as a sparse Pauli–Lindblad model and amplified), pec (the learned channels inverted and sampled), cdr (a line fitted over near-Clifford training circuits), vd (two copies), readout (the counts' flips inverted). Needs noise and observables (shots for readout), at most 8 qubits. The result's `mitigation` gives raw and mitigated values with standard errors, the ideal value (known because this is a simulation), the method's bias and variance assumptions and its cost. A method's name, or an object.", "anyOf": [ { "type": "string", "enum": [ "zne", "pea", "pec", "cdr", "vd", "readout" ] }, { "type": "object", "required": [ "method" ], "properties": { "method": { "type": "string", "enum": [ "zne", "pea", "pec", "cdr", "vd", "readout" ] }, "shots": { "type": "integer", "minimum": 1, "maximum": 1000000, "description": "Shots per circuit (default 10000; 2000 per sampled circuit for pec)." }, "seed": { "type": "integer", "minimum": 0 }, "factors": { "type": "array", "items": { "type": "number" }, "description": "zne: odd whole numbers (default 1, 3, 5); pea: factors from 1 to 10 (default 1, 1.5, 2)." }, "extrapolation": { "type": "string", "enum": [ "richardson", "linear", "exponential" ] }, "samples": { "type": "integer", "minimum": 2, "description": "pec: sampled circuits (default 200)." }, "training": { "type": "integer", "minimum": 3, "description": "cdr: training circuits (default 16)." }, "keep": { "type": "integer", "minimum": 0, "description": "cdr: non-Clifford gates each training circuit keeps (default 2, and always one fewer than the program has)." }, "learn_shots": { "type": "integer", "minimum": 100, "description": "pea, pec: shots per depth of the cycle benchmarking that learns the noise (default 60000)." } } } ] } } }, "outputSchema": { "$id": "wai-quantum://schemas/run_quantum_circuit/1", "type": "object", "description": "A job as a host returns it: its status, the method its plan chose and why, the request as submitted, and, once it is done, the result with its receipt: a job's result, or for a set (a request with programs or a sweep, its method set) the set's result. The command line's run --json, the local MCP server's run_quantum_circuit and a run on the person's own provider give a finished job; the job service also gives its id and times, and a job still queued or running, or failed with its error. A job's receipt verifies from this document alone: request and result.", "anyOf": [ { "title": "wai.quantum.job/1", "description": "A job as a host returns it: its status, the method its plan chose and why, the request as submitted, and, once it is done, the result with its receipt: a job's result, or for a set (a request with programs or a sweep, its method set) the set's result. The command line's run --json, the local MCP server's run_quantum_circuit and a run on the person's own provider give a finished job; the job service also gives its id and times, and a job still queued or running, or failed with its error. A job's receipt verifies from this document alone: request and result.", "type": "object", "required": [ "status", "request" ], "properties": { "id": { "type": "string", "description": "The job service's id for the job." }, "status": { "enum": [ "queued", "running", "done", "failed", "cancelled" ] }, "method": { "type": "string", "description": "The method the plan chose; set for a set." }, "why": { "type": "string", "description": "Why the plan chose the method." }, "estimate": { "type": "object", "description": "What the plan admitted the job with.", "required": [ "memory_bytes", "work" ], "properties": { "memory_bytes": { "type": "integer", "minimum": 0 }, "work": { "type": "integer", "minimum": 0, "description": "In the method's own unit." } } }, "request": { "title": "wai.quantum.job-request/1", "description": "A job as a client submits it: a program and what is asked of it, or a set: many programs (programs), or one over a grid of its inputs (sweep), run as one job. The command line, both MCP servers, the job service, the desktop app and the Studio read it alike, and a receipt seals it as it was given. A member the engine does not read is ignored, and sealed with the rest.", "type": "object", "anyOf": [ { "required": [ "qasm" ] }, { "required": [ "programs" ] } ], "properties": { "qasm": { "type": "string", "description": "The program, in OpenQASM 3 or the OpenQASM 2 forms in common use." }, "shots": { "type": "integer", "minimum": 0, "maximum": 1000000, "description": "Measurement shots; 1024 when no observables or amplitudes are asked for, otherwise 0." }, "seed": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "The sampling seed (1 when not given): the same job and seed give the same counts." }, "method": { "type": "string", "description": "auto (the default: the strongest method the program admits), or a method by its name as the methods list names it." }, "observables": { "type": "array", "maxItems": 256, "description": "Pauli observables to take the expectation values of.", "items": { "anyOf": [ { "type": "string", "description": "A Pauli string, as \"Z0 Z1\"; qubits count from 0." }, { "type": "object", "required": [ "pauli" ], "properties": { "pauli": { "type": "string", "description": "A Pauli string, as \"X3\"." }, "coeff": { "type": "number", "description": "Its coefficient (1 when not given)." } } } ] } }, "amplitudes": { "type": "array", "maxItems": 64, "description": "Basis states whose amplitudes to return: one 0 or 1 per qubit, qubit n-1 first.", "items": { "type": "string" } }, "noise": { "type": "object", "description": "A noise model, each channel a probability. A channel not listed here is refused.", "additionalProperties": false, "properties": { "depolarizing_1q": { "type": "number", "minimum": 0, "maximum": 1 }, "depolarizing_2q": { "type": "number", "minimum": 0, "maximum": 1 }, "amplitude_damping": { "type": "number", "minimum": 0, "maximum": 1 }, "dephasing": { "type": "number", "minimum": 0, "maximum": 1 }, "readout": { "type": "number", "minimum": 0, "maximum": 1 } } }, "options": { "type": "object", "description": "Options of the method that runs the job, as the methods list names them (max_bond, cutoff, fusion, trajectories, threshold, max_weight, ladder, max_terms, path_restarts), and memory_gb." }, "compile": { "type": "object", "description": "What a compile is asked for, each optional: the most the output may differ from the program (epsilon, in the operator norm up to a global phase), the level (0 lowers and approximates; 1 also rewrites and folds phases; 2 also resynthesises), the basis, the gate set it writes the program in (clifford_t: every rotation off the multiples of π/4 a Clifford+T word; standard: nothing approximated), whether to give the circuit after each pass (stages), and the twirl and dd passes, last (twirl, with its seed; dd, with its sequence).", "properties": { "epsilon": { "type": "number", "exclusiveMinimum": 0 }, "level": { "type": "integer", "minimum": 0, "maximum": 2 }, "basis": { "enum": [ "clifford_t", "standard" ] }, "stages": { "type": "boolean" }, "twirl": { "description": "Twirl each two-qubit Clifford gate with Paulis drawn from a seeded stream: true (seed 1), or {\"seed\": N}. One seed is one instance, checked to be the same circuit.", "anyOf": [ { "type": "boolean" }, { "type": "object", "required": [ "seed" ], "properties": { "seed": { "type": "integer", "minimum": 0 } } } ] }, "dd": { "description": "Dynamical decoupling in each window where a qubit idles long enough: xx or xy4 (or {\"sequence\": …}), checked to change nothing without noise.", "anyOf": [ { "enum": [ "xx", "xy4" ] }, { "type": "boolean" }, { "type": "object", "properties": { "sequence": { "enum": [ "xx", "xy4" ] } } } ] } } }, "intent": { "description": "What the program must do, checked with the run: one intent or a list. The result's verdict says how far it was checked.", "anyOf": [ { "type": "object", "description": "One of distribution, equivalent, prepares or sampled, with its options.", "properties": { "distribution": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 } }, "tolerance": { "type": "number", "minimum": 0, "maximum": 1 }, "equivalent": { "type": "string" }, "prepares": { "type": "string" }, "sampled": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 } }, "test": { "enum": [ "chi_squared", "g_test" ] }, "alpha": { "type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 1 }, "shots": { "type": "integer", "minimum": 1 }, "seed": { "type": "integer", "minimum": 0 }, "require": { "const": "proof" }, "note": { "type": "string" }, "name": { "type": "string" } } }, { "type": "array", "minItems": 1, "items": { "type": "object", "description": "One of distribution, equivalent, prepares or sampled, with its options.", "properties": { "distribution": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 } }, "tolerance": { "type": "number", "minimum": 0, "maximum": 1 }, "equivalent": { "type": "string" }, "prepares": { "type": "string" }, "sampled": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 } }, "test": { "enum": [ "chi_squared", "g_test" ] }, "alpha": { "type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 1 }, "shots": { "type": "integer", "minimum": 1 }, "seed": { "type": "integer", "minimum": 0 }, "require": { "const": "proof" }, "note": { "type": "string" }, "name": { "type": "string" } } } } ] }, "verdict": { "type": "boolean", "description": "true: the result carries a verdict even with no intent." }, "target": { "description": "A device target: a built-in target's name, or a target document. The program is compiled to it, placed and simulated under its noise; noise may not be given beside it.", "anyOf": [ { "type": "string" }, { "title": "wai.quantum.target/1", "description": "A device target: its qubits, the pairs it couples, its native gates with their errors and durations, and the calibration snapshot they come from. A value not known is left out, never written as zero. Every field but format, name, source, qubits, gates and coupling is optional, and a field the format does not name is refused, so a misspelt one never reads as absent. Its canonical text is its RFC 8785 form, and the BLAKE3 of that text, the target's hash, names the snapshot in a receipt.", "type": "object", "required": [ "format", "name", "source", "qubits", "gates", "coupling" ], "additionalProperties": false, "properties": { "format": { "const": "wai.quantum.target/1" }, "name": { "type": "string", "minLength": 1, "maxLength": 200 }, "source": { "type": "object", "required": [ "format" ], "additionalProperties": false, "properties": { "format": { "type": "string", "description": "The format the target was read from (wai-quantum targets import --help lists them)." }, "note": { "type": "string", "maxLength": 400 } } }, "calibration": { "type": "object", "additionalProperties": false, "properties": { "id": { "type": "string", "maxLength": 400, "description": "The calibration snapshot's id, as the source names it, or a content id of the snapshot read." }, "timestamp": { "type": "string", "maxLength": 400, "description": "When the snapshot was taken, as the source writes it." } } }, "qubits": { "type": "array", "minItems": 1, "maxItems": 2048, "description": "Every qubit, in order.", "items": { "type": "object", "required": [ "qubit" ], "additionalProperties": false, "properties": { "qubit": { "type": "integer", "minimum": 0, "description": "Its index: its place in the list." }, "label": { "type": "string", "description": "The source's own name for it, when that is not its index." }, "t1_us": { "type": "number", "minimum": 0, "description": "T1, microseconds." }, "t2_us": { "type": "number", "minimum": 0, "description": "T2 (the echo or Ramsey time the source reports), microseconds." }, "frequency_ghz": { "type": "number", "minimum": 0, "description": "Its frequency, gigahertz." }, "readout": { "type": "object", "required": [ "p01", "p10" ], "additionalProperties": false, "properties": { "p01": { "type": "number", "minimum": 0, "maximum": 1, "description": "P(reads 1 | holds 0)." }, "p10": { "type": "number", "minimum": 0, "maximum": 1, "description": "P(reads 0 | holds 1)." } } }, "measure_ns": { "type": "number", "minimum": 0, "description": "The measurement's duration, nanoseconds." } } } }, "gates": { "type": "array", "maxItems": 262144, "description": "Each native gate where the device runs it, sorted by gate then qubits.", "items": { "type": "object", "required": [ "gate", "qubits" ], "additionalProperties": false, "properties": { "gate": { "type": "string", "pattern": "^[a-z0-9_]{1,40}$" }, "qubits": { "type": "array", "minItems": 1, "maxItems": 2, "items": { "type": "integer", "minimum": 0 } }, "error": { "type": "number", "minimum": 0, "maximum": 1, "description": "The average gate infidelity." }, "duration_ns": { "type": "number", "minimum": 0, "description": "Nanoseconds." } } } }, "coupling": { "type": "array", "description": "The pairs a two-qubit gate may act on, each once, the lower qubit first, sorted.", "items": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "type": "integer", "minimum": 0 } } } } } ] }, "repair": { "description": "Repair the program first on its flagged lines: true, or the choices.", "anyOf": [ { "type": "boolean" }, { "type": "object", "properties": { "max_iterations": { "type": "integer", "minimum": 1 }, "dyadic_bits": { "type": "integer", "minimum": 1, "maximum": 32 }, "sizes": { "type": "object", "additionalProperties": { "type": "integer", "minimum": 1 } } } } ] }, "history": { "type": "object", "description": "The program's history's account of the version the job runs: its digest, and the gates and lines in each hand. The receipt binds it; a history recomputes and checks it." }, "provider": { "type": "string", "description": "The person's own provider to run on, by the name their registry gives it. Only a host that holds their credentials runs such a job; every other host refuses it." }, "programs": { "type": "array", "minItems": 1, "items": { "anyOf": [ { "type": "string", "description": "A program's text." }, { "type": "object", "required": [ "qasm" ], "description": "A job of its own, read as a job request is (no programs or sweep in it); each item of the set's result holds its request in full." } ] }, "description": "A set (engine::sets): the programs to run as one job, each a program's text or a job of its own; the request's other fields apply to every item that does not set them itself." }, "sweep": { "type": "object", "additionalProperties": { "type": "array", "minItems": 1, "items": { "type": "number" } }, "description": "A set over the request's own qasm: values for each of the program's inputs (integer, float or angle), every combination run, the names in sorted order and the first varying slowest." }, "dry_run": { "type": "boolean", "description": "With true: what the host would do with the job or set, running nothing." }, "mitigate": { "description": "Mitigate the job's expectation values (or, for readout, its counts) under its noise (engine::mitigate): zne, pea, pec, cdr, vd or readout, or {\"method\", …} with its options. The result's mitigation gives each value raw and mitigated.", "anyOf": [ { "enum": [ "zne", "pea", "pec", "cdr", "vd", "readout" ] }, { "type": "object", "required": [ "method" ] } ] } } }, "result": { "anyOf": [ { "title": "wai.quantum.job-result/1", "description": "A job's result as the engine gives it, on every host: what was asked of the program, computed by the method its plan chose, with that method's accuracy class. The receipt seals the result without its receipt member, beside the request. A result names the engine that made it and this schema (engine and schema); results made before results carried them have neither and follow this schema all the same.", "type": "object", "required": [ "method", "qubits", "gates", "accuracy" ], "properties": { "engine": { "type": "object", "description": "The engine that made the result: the wai-quantum crate's name and version.", "required": [ "name", "version" ], "properties": { "name": { "const": "wai-quantum" }, "version": { "type": "string", "description": "Its semantic version, as MAJOR.MINOR.PATCH." } } }, "schema": { "const": "wai.quantum.job-result/1", "description": "The schema the result follows." }, "method": { "type": "string", "description": "The method that ran the job (provider for a run on the person's own provider)." }, "qubits": { "type": "integer", "minimum": 0 }, "gates": { "type": "integer", "minimum": 0 }, "accuracy": { "type": "object", "description": "What the method promises of the numbers it gave.", "required": [ "class" ], "properties": { "class": { "enum": [ "bit-exact", "exact", "single", "bounded", "estimate", "heuristic", "measured" ], "description": "bit-exact: the same bits on every machine; exact: no approximation beyond double-precision rounding; single: single-precision arithmetic; bounded: a rigorous bound beside each value; estimate: a statistical estimate with its standard error; heuristic: an approximation with an estimate of its error, not a bound; measured: counts a device returned, not reproducible by recomputation." }, "note": { "type": "string" }, "fusion": { "type": "integer" }, "device": { "type": "string" }, "threshold": { "type": "number" }, "max_weight": { "type": [ "integer", "null" ] }, "max_bond": { "type": "integer" }, "max_bond_used": { "type": "integer" }, "discarded_weight": { "type": "number" }, "fidelity_estimate": { "type": "number" }, "truncations": { "type": "integer" }, "shots": { "type": "integer" }, "trajectories": { "type": "integer" }, "histories": { "type": "integer" }, "gate_applications": { "type": "integer" }, "max_cut": { "type": "integer" }, "order_work": { "type": "number" }, "batch": { "type": "integer" } } }, "state_hash": { "type": "string", "description": "The bit-exact method's statevector hash (BLAKE3, hex): the same on every machine." }, "counts": { "type": "object", "description": "Outcomes and their counts, keyed by the program's classical bits, the highest bit first. At most 65536 outcomes are listed; omitted_shots holds the rest.", "additionalProperties": { "type": "integer", "minimum": 0 } }, "distinct_outcomes": { "type": "integer", "minimum": 0 }, "omitted_shots": { "type": "integer", "minimum": 0 }, "outcome_dimension": { "type": "integer", "minimum": 0, "description": "The stabilizer method: the dimension of the measured outcomes' affine space." }, "shots": { "type": "integer", "minimum": 0, "description": "The shots, where the method names them in the result (trajectories, provider)." }, "expectations": { "type": "array", "items": { "type": "object", "required": [ "observable", "coeff", "value" ], "properties": { "observable": { "type": "string" }, "coeff": { "type": "number" }, "value": { "type": "number", "description": "The coefficient times the expectation value." }, "stderr": { "type": "number", "description": "The standard error, for an estimate." }, "bound": { "type": "number", "description": "A rigorous bound on |exact − value|, for the bounded class." }, "peak_terms": { "type": "integer" }, "threshold_reached": { "type": "number" }, "max_terms": { "type": "integer" }, "ladder": { "type": "array", "description": "The value at thresholds a decade apart, the asked one last.", "items": { "type": "object", "required": [ "threshold", "value", "bound" ], "properties": { "threshold": { "type": "number" }, "value": { "type": "number" }, "bound": { "type": "number" }, "peak_terms": { "type": "integer" }, "threshold_reached": { "type": "number" } } } } } } }, "amplitudes": { "type": "array", "items": { "type": "object", "required": [ "bits", "re", "im" ], "properties": { "bits": { "type": "string", "description": "One 0 or 1 per qubit, qubit n-1 first." }, "re": { "type": "number" }, "im": { "type": "number" } } } }, "global_phase": { "type": "string", "description": "Why the amplitudes' global phase is not fixed, when it is not." }, "warning": { "type": "string" }, "contraction_flops": { "type": "number", "description": "The tensor network's contraction cost." }, "dynamic": { "type": "object", "description": "A program that measures in the middle, resets or branches on a measured bit: how it ran.", "properties": { "measurements_and_resets": { "type": "integer", "minimum": 0 }, "branches_run": { "type": "integer", "minimum": 0 }, "states_at_once": { "type": "integer", "minimum": 0 }, "branches_weighed": { "type": "integer", "minimum": 0 } } }, "outputs": { "type": "array", "description": "The program's output declarations: each its name and type, and its value, or the places of its bits in each outcome.", "items": { "type": "object", "required": [ "name", "type" ], "properties": { "name": { "type": "string" }, "type": { "type": "string" }, "bits": { "type": "array", "items": { "type": "integer", "minimum": 0 } }, "value": { "description": "A number, a boolean, a bit string, a duration's text, {\"re\", \"im\"}, or an array of them." } } } }, "timing": { "type": "object", "description": "A program that states durations (delay, box, stretch) the method does not apply: said so, with the reader's code.", "required": [ "applied", "why" ], "properties": { "applied": { "type": "boolean" }, "code": { "type": "string" }, "why": { "type": "string" } } }, "diagnostics": { "type": "array", "description": "The reader's warnings and notes on the program, each with its code.", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "compiled": { "description": "How the program was compiled before it ran: on the person's own provider, to the device's gates; or, asked with compile, to a basis within a budget. Either way, basis is the gate set it was compiled to.", "anyOf": [ { "type": "object", "description": "A provider job: the program sent, compiled exactly to the device's own gates: its basis (the device's gate set), the BLAKE3 of its OpenQASM 3 text, its counts of gates and swaps, its layouts, and the check it passed before it was sent.", "required": [ "basis", "program" ], "properties": { "basis": { "type": "string" }, "program": { "type": "string" }, "hash": { "type": "string" }, "native_gates": { "type": "integer" }, "two_qubit_gates": { "type": "integer" }, "swaps": { "type": "integer" }, "layout": { "type": "array", "items": { "type": "integer" } }, "final_layout": { "type": "array", "items": { "type": "integer" } }, "checked": { "type": "string" }, "placement": { "type": "object", "description": "Where the program was placed on the device's qubits, and why." } } }, { "type": "object", "description": "A job asked to compile its program first: what ran is the compiled circuit, within distance of the program in the operator norm up to a global phase.", "required": [ "basis", "verdict" ], "properties": { "basis": { "enum": [ "clifford_t", "standard" ], "description": "The gate set the program was compiled to." }, "level": { "type": "integer", "minimum": 0 }, "epsilon": { "type": "number", "description": "The budget asked for." }, "distance": { "type": [ "number", "null" ], "description": "The bound the passes' distances add to." }, "verdict": { "type": "string" }, "source": { "type": "object", "description": "A circuit's counts, as the compiler counts them.", "properties": { "gates": { "type": "integer", "minimum": 0 }, "one_qubit": { "type": "integer", "minimum": 0 }, "two_qubit": { "type": "integer", "minimum": 0 }, "three_qubit": { "type": "integer", "minimum": 0 }, "cnots": { "type": "integer", "minimum": 0 }, "t_count": { "type": "integer", "minimum": 0 }, "rotations": { "type": "integer", "minimum": 0 }, "depth": { "type": "integer", "minimum": 0 } } }, "output": { "type": "object", "description": "A circuit's counts, as the compiler counts them.", "properties": { "gates": { "type": "integer", "minimum": 0 }, "one_qubit": { "type": "integer", "minimum": 0 }, "two_qubit": { "type": "integer", "minimum": 0 }, "three_qubit": { "type": "integer", "minimum": 0 }, "cnots": { "type": "integer", "minimum": 0 }, "t_count": { "type": "integer", "minimum": 0 }, "rotations": { "type": "integer", "minimum": 0 }, "depth": { "type": "integer", "minimum": 0 } } }, "certificate": { "type": [ "string", "null" ], "description": "The BLAKE3 of the compile certificate's RFC 8785 text, in hex." }, "note": { "type": "string" } } } ] }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } }, "target": { "type": "object", "description": "A run on a device target: which target (its hash, as its receipt binds it), its calibration snapshot, where the program was placed and why, and the noise derived from the target.", "required": [ "name", "hash" ], "properties": { "name": { "type": "string" }, "hash": { "type": "string" }, "hash_is": { "type": "string" }, "calibration": { "type": "object", "properties": { "id": { "type": "string" }, "timestamp": { "type": "string" } } }, "source": { "type": "object", "properties": { "format": { "type": "string" }, "note": { "type": "string" } } }, "placement": { "type": "object", "description": "The native gate set, the layout and routes chosen, the swaps, the expected success beside the fewest-swaps layout's, and the check of the compiled program." }, "noise": { "type": "object", "description": "The noise model derived from the target's calibration: its channels, durations and idling, and each qubit's readout." } } }, "repaired": { "type": "object", "description": "A job asked to repair its program first: the program that ran, each repair, and what needs a person.", "properties": { "qasm": { "type": "string" }, "repairs": { "type": "array", "items": { "type": "object", "required": [ "code", "by", "edits" ], "properties": { "code": { "type": "string" }, "rule": { "type": "string" }, "by": { "enum": [ "engine", "proposal" ] }, "flagged": { "type": "array", "items": { "type": "integer" } }, "edits": { "type": "array", "items": { "type": "object", "properties": { "line": { "type": "integer" }, "before": { "type": [ "string", "null" ] }, "after": { "type": [ "string", "null" ] } } } } } } }, "needs_person": { "type": "array", "items": { "type": "object" } } } }, "elapsed_ms": { "type": "integer", "minimum": 0, "description": "Wall time of the run, where the host has a clock (not in a browser tab)." }, "energy": { "description": "The CPU energy of the job's process as the kernel counts it, with its uncertainty and what it leaves out, or unmetered with the reason.", "anyOf": [ { "type": "object", "required": [ "unmetered" ], "properties": { "unmetered": { "type": "string" }, "service_kwh": { "type": "number", "description": "A provider job: the provider's own figure." }, "service_kwh_is": { "type": "string" } } }, { "type": "object", "required": [ "joules_micro", "energy_provenance", "coverage" ], "properties": { "joules_micro": { "type": "integer", "minimum": 1 }, "energy_provenance": { "type": "string" }, "energy_uncertainty": { "type": "object", "properties": { "relative_ppm": { "type": "integer" }, "window_us": { "type": "integer" } } }, "energy_counter_filtering": { "type": "string" }, "coverage": { "enum": [ "whole", "partial" ] }, "covers": { "type": "string" }, "excludes": { "type": "array", "items": { "type": "string" } }, "cpu_ms": { "type": "integer" }, "source": { "type": "string" }, "attribution": { "enum": [ "process", "none" ], "description": "Whose energy it is: the job's worker process, or none (the processor packages' over the job's window, every process on the host in it)." }, "packages": { "type": "integer", "minimum": 1, "description": "The processor packages read." }, "concurrent_jobs": { "type": "integer", "minimum": 0, "description": "Other jobs that ran on the host during the window." }, "counter": { "type": "object", "description": "The package counter as seen: the longest it went between updates, and the smallest step it took.", "properties": { "update_us": { "type": "integer", "minimum": 0 }, "step_uj": { "type": "integer", "minimum": 0 } } }, "declared": { "type": "string", "description": "What the stated uncertainty covers, and what it does not." } } } ] }, "receipt": { "anyOf": [ { "title": "wai.quantum.receipt/2", "description": "A result's receipt: an Ed25519 signature, by the key it names, over digest = BLAKE3(\"wai:quantum-service-receipt\\x02\" ‖ len ‖ request ‖ len ‖ result), each of request and result in its RFC 8785 canonical text (the result without its receipt member), each length 8 bytes big-endian. Whatever members the request and the result hold are sealed, the result's engine and schema among them. The first receipts (no canon member, $defs/first) signed serde_json's own text under the domain ending \\x01; they still verify.", "type": "object", "required": [ "alg", "canon", "key", "digest", "signature" ], "properties": { "alg": { "const": "ed25519" }, "canon": { "const": "rfc8785", "description": "The canonical form the digest is taken over." }, "key": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The signing key, 32 bytes in hex." }, "digest": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The digest signed, 32 bytes in hex." }, "signature": { "type": "string", "minLength": 128, "maxLength": 128, "description": "The signature, 64 bytes in hex." } } }, { "description": "The first form, before canon: the digest is over serde_json's own text of each, under the domain ending \\x01. Never written now; still verified.", "type": "object", "required": [ "alg", "key", "digest", "signature" ], "properties": { "alg": { "const": "ed25519" }, "key": { "type": "string", "minLength": 64, "maxLength": 64 }, "digest": { "type": "string", "minLength": 64, "maxLength": 64 }, "signature": { "type": "string", "minLength": 128, "maxLength": 128 } } } ] }, "provider": { "type": "object", "description": "A provider job: the provider's name, kind and protocol, the device, its provenance, and the hash of its description." }, "calibration": { "type": [ "string", "null" ], "description": "A provider job: the calibration snapshot it ran under." }, "job": { "type": "object", "description": "A provider job: the provider's job id and its status checks." }, "ideal": { "description": "A provider job: the circuit's exact distribution set beside the measured counts.", "anyOf": [ { "type": "object", "required": [ "computed", "total_variation_distance", "hellinger_fidelity" ], "properties": { "computed": { "const": true }, "method": { "type": "string" }, "total_variation_distance": { "type": "number" }, "hellinger_fidelity": { "type": "number" }, "sampling_tvd_expected": { "type": "number" }, "ideal_outcomes": { "type": "integer" }, "note": { "type": "string" } } }, { "type": "object", "required": [ "computed", "why" ], "properties": { "computed": { "const": false }, "why": { "type": "string" } } } ] }, "cost": { "type": "object", "description": "A provider job: the estimate shown before it was sent, what the provider says it charged, and whether the person confirmed a run that was not free." }, "provenance": { "title": "wai.quantum.provenance/1", "description": "What a result came from, under the five categories cross-platform provenance surveys use: the circuit, the computer, the compilation, the execution and the software. A host adds it to the results it seals (the job service does, and each item of a set); a result without it reads as it always did. wai-quantum-service/docs/provenance.md maps every field to where it is and whether the receipt seals it.", "type": "object", "required": [ "schema", "circuit", "computer", "compilation", "execution", "software" ], "properties": { "schema": { "const": "wai.quantum.provenance/1" }, "circuit": { "type": "object", "description": "The program: the BLAKE3 digest of its text as given, its qubits and its gates.", "required": [ "program" ], "properties": { "program": { "type": "string", "description": "BLAKE3 of the program's text, in hex." }, "qubits": { "type": "integer", "minimum": 0 }, "gates": { "type": [ "integer", "null" ] } } }, "computer": { "type": "object", "description": "What ran it: a classical simulator, the method and its accuracy class, and a device target's hash when the job named one.", "required": [ "kind", "method" ], "properties": { "kind": { "const": "simulator" }, "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "target": { "type": "string", "description": "The device target's hash; its layout, routes and noise are in the result's own target." } } }, "compilation": { "type": "object", "description": "Whether the job asked to be compiled; if it did, each pass in order with its check's verdict, the certificate's digest, the gate set compiled to (its basis), the level, the ε budget and the distance the result carries, and that no pass draws a random number.", "required": [ "asked" ], "properties": { "asked": { "type": "boolean" }, "passes": { "type": [ "array", "null" ], "items": { "type": "object", "properties": { "pass": { "type": "string" }, "verdict": { "type": [ "string", "null" ] } } } }, "certificate": { "type": [ "string", "null" ] }, "basis": { "type": [ "string", "null" ], "description": "The gate set compiled to: clifford_t or standard." }, "level": { "type": [ "integer", "null" ] }, "epsilon": { "type": [ "number", "null" ] }, "distance": { "type": [ "number", "null" ] }, "seeded": { "const": false }, "device": { "type": "string", "description": "A job on a device target, compiled exactly to its gates: where its layout and routes are." }, "status": { "const": "not-applicable" }, "why": { "type": "string" } } }, "execution": { "type": "object", "description": "The shots, the seed and the plan the job ran under; its identifier and times are the host's, outside the result.", "required": [ "plan" ], "properties": { "shots": { "type": [ "integer", "null" ] }, "seed": { "type": [ "integer", "null" ] }, "plan": { "type": "object", "properties": { "method": { "type": "string" }, "why": { "type": "string" }, "memory_bytes": { "type": "integer", "minimum": 0 }, "work": { "type": "integer", "minimum": 0 } } } } }, "software": { "type": "object", "description": "The engine's name and version, and the host's.", "required": [ "engine", "host" ], "properties": { "engine": { "type": "string" }, "host": { "type": "string" } } } } }, "mitigation": { "title": "wai.quantum.mitigation/1", "description": "A job's mitigation (its request's mitigate, engine::mitigate), in its result: the method and the options it ran with, its bias and variance assumptions, each observable raw and mitigated with a standard error each and the ideal value (or, for readout, the counts inverted as a quasi-distribution), the method's own details and what it spent. docs/qec.md describes each method.", "type": "object", "required": [ "method", "options", "assumptions" ], "properties": { "method": { "enum": [ "zne", "pea", "pec", "cdr", "vd", "readout" ] }, "options": { "type": "object", "description": "The options it ran with, the defaults filled in.", "properties": { "method": { "type": "string" }, "shots": { "type": "integer" }, "seed": { "type": "integer" }, "factors": { "type": "array", "items": { "type": "number" } }, "extrapolation": { "enum": [ "richardson", "linear", "exponential" ] }, "samples": { "type": "integer" }, "training": { "type": "integer" }, "keep": { "type": "integer" }, "learn_shots": { "type": "integer" } } }, "assumptions": { "type": "object", "properties": { "bias": { "type": "string" }, "variance": { "type": "string" } } }, "noise": { "type": "string", "description": "How the job's noise model is read for the method." }, "note": { "type": "string" }, "observables": { "type": "array", "items": { "type": "object", "description": "One observable: its raw value and the mitigated one, each with its standard error, and the ideal value a simulation knows.", "properties": { "observable": { "type": "string" }, "coeff": { "type": "number" }, "raw": { "type": "number" }, "raw_stderr": { "type": "number" }, "mitigated": { "type": "number" }, "stderr": { "type": "number" }, "ideal": { "type": "number" } } } }, "distribution": { "type": "array", "description": "readout: each outcome's raw share and its mitigated quasi-probability, with its standard error.", "items": { "type": "object", "properties": { "bits": { "type": "string" }, "raw": { "type": "number" }, "mitigated": { "type": "number" }, "stderr": { "type": "number" } } } }, "details": { "type": "object", "description": "The method's own: the folded scales and the folding check (zne), the learned model and the amplified values (pea), the quasi-probability and the value it converges to (pec), the training fits (cdr), the purity (vd), the flip and its amplification (readout).", "additionalProperties": true }, "cost": { "type": "object", "description": "The circuits and shots it spent beyond the job's own.", "properties": { "circuits": { "type": "integer", "minimum": 0 }, "shots": { "type": "integer", "minimum": 0 }, "note": { "type": "string" } } } } } } }, { "title": "wai.quantum.set/1", "description": "A set's result: many programs, or one program over a grid of its inputs, run as one job (engine::sets). Its head holds the count, how many items finished and failed, the Merkle root over the items' leaves, the set's energy and time; the set's receipt seals the set's request and its head. Each item is a plain job with its own receipt, its index, its point in a sweep, and its path to the root, so it is shown sealed by the set alone. A result names the engine that made it and this schema (engine and schema).", "type": "object", "required": [ "format", "count", "done", "failed", "root", "items" ], "properties": { "engine": { "type": "object", "description": "The engine that made the result: the wai-quantum crate's name and version.", "required": [ "name", "version" ], "properties": { "name": { "const": "wai-quantum" }, "version": { "type": "string" } } }, "schema": { "const": "wai.quantum.set/1" }, "format": { "const": "wai.quantum.set/1" }, "count": { "type": "integer", "minimum": 1 }, "done": { "type": "integer", "minimum": 0 }, "failed": { "type": "integer", "minimum": 0 }, "root": { "type": "string", "description": "The Merkle root of the items' leaves, in hex (domains moq-jwp:merkle-leaf and moq-jwp:merkle-node, version 1)." }, "energy": { "description": "The CPU energy of the job's process as the kernel counts it, with its uncertainty and what it leaves out, or unmetered with the reason.", "anyOf": [ { "type": "object", "required": [ "unmetered" ], "properties": { "unmetered": { "type": "string" }, "service_kwh": { "type": "number", "description": "A provider job: the provider's own figure." }, "service_kwh_is": { "type": "string" } } }, { "type": "object", "required": [ "joules_micro", "energy_provenance", "coverage" ], "properties": { "joules_micro": { "type": "integer", "minimum": 1 }, "energy_provenance": { "type": "string" }, "energy_uncertainty": { "type": "object", "properties": { "relative_ppm": { "type": "integer" }, "window_us": { "type": "integer" } } }, "energy_counter_filtering": { "type": "string" }, "coverage": { "enum": [ "whole", "partial" ] }, "covers": { "type": "string" }, "excludes": { "type": "array", "items": { "type": "string" } }, "cpu_ms": { "type": "integer" }, "source": { "type": "string" }, "attribution": { "enum": [ "process", "none" ], "description": "Whose energy it is: the job's worker process, or none (the processor packages' over the job's window, every process on the host in it)." }, "packages": { "type": "integer", "minimum": 1, "description": "The processor packages read." }, "concurrent_jobs": { "type": "integer", "minimum": 0, "description": "Other jobs that ran on the host during the window." }, "counter": { "type": "object", "description": "The package counter as seen: the longest it went between updates, and the smallest step it took.", "properties": { "update_us": { "type": "integer", "minimum": 0 }, "step_uj": { "type": "integer", "minimum": 0 } } }, "declared": { "type": "string", "description": "What the stated uncertainty covers, and what it does not." } } } ] }, "elapsed_ms": { "type": "integer", "minimum": 0 }, "receipt": { "title": "wai.quantum.receipt/2", "description": "A result's receipt: an Ed25519 signature, by the key it names, over digest = BLAKE3(\"wai:quantum-service-receipt\\x02\" ‖ len ‖ request ‖ len ‖ result), each of request and result in its RFC 8785 canonical text (the result without its receipt member), each length 8 bytes big-endian. Whatever members the request and the result hold are sealed, the result's engine and schema among them. The first receipts (no canon member, $defs/first) signed serde_json's own text under the domain ending \\x01; they still verify.", "type": "object", "required": [ "alg", "canon", "key", "digest", "signature" ], "properties": { "alg": { "const": "ed25519" }, "canon": { "const": "rfc8785", "description": "The canonical form the digest is taken over." }, "key": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The signing key, 32 bytes in hex." }, "digest": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The digest signed, 32 bytes in hex." }, "signature": { "type": "string", "minLength": 128, "maxLength": 128, "description": "The signature, 64 bytes in hex." } } }, "items": { "type": "array", "items": { "type": "object", "description": "One item: its index, its point in a sweep, its request (a plain job, complete in itself), and its result with its own receipt, or why it failed; and its path to the set's root.", "required": [ "index", "request", "status", "path" ], "properties": { "index": { "type": "integer", "minimum": 0 }, "point": { "type": "object", "description": "A sweep's item: the value of each input it was run at." }, "status": { "enum": [ "done", "failed" ] }, "method": { "type": "string" }, "why": { "type": "string" }, "request": { "title": "wai.quantum.job-request/1", "description": "A job as a client submits it: a program and what is asked of it, or a set: many programs (programs), or one over a grid of its inputs (sweep), run as one job. The command line, both MCP servers, the job service, the desktop app and the Studio read it alike, and a receipt seals it as it was given. A member the engine does not read is ignored, and sealed with the rest.", "type": "object", "anyOf": [ { "required": [ "qasm" ] }, { "required": [ "programs" ] } ], "properties": { "qasm": { "type": "string", "description": "The program, in OpenQASM 3 or the OpenQASM 2 forms in common use." }, "shots": { "type": "integer", "minimum": 0, "maximum": 1000000, "description": "Measurement shots; 1024 when no observables or amplitudes are asked for, otherwise 0." }, "seed": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "The sampling seed (1 when not given): the same job and seed give the same counts." }, "method": { "type": "string", "description": "auto (the default: the strongest method the program admits), or a method by its name as the methods list names it." }, "observables": { "type": "array", "maxItems": 256, "description": "Pauli observables to take the expectation values of.", "items": { "anyOf": [ { "type": "string", "description": "A Pauli string, as \"Z0 Z1\"; qubits count from 0." }, { "type": "object", "required": [ "pauli" ], "properties": { "pauli": { "type": "string", "description": "A Pauli string, as \"X3\"." }, "coeff": { "type": "number", "description": "Its coefficient (1 when not given)." } } } ] } }, "amplitudes": { "type": "array", "maxItems": 64, "description": "Basis states whose amplitudes to return: one 0 or 1 per qubit, qubit n-1 first.", "items": { "type": "string" } }, "noise": { "type": "object", "description": "A noise model, each channel a probability. A channel not listed here is refused.", "additionalProperties": false, "properties": { "depolarizing_1q": { "type": "number", "minimum": 0, "maximum": 1 }, "depolarizing_2q": { "type": "number", "minimum": 0, "maximum": 1 }, "amplitude_damping": { "type": "number", "minimum": 0, "maximum": 1 }, "dephasing": { "type": "number", "minimum": 0, "maximum": 1 }, "readout": { "type": "number", "minimum": 0, "maximum": 1 } } }, "options": { "type": "object", "description": "Options of the method that runs the job, as the methods list names them (max_bond, cutoff, fusion, trajectories, threshold, max_weight, ladder, max_terms, path_restarts), and memory_gb." }, "compile": { "type": "object", "description": "What a compile is asked for, each optional: the most the output may differ from the program (epsilon, in the operator norm up to a global phase), the level (0 lowers and approximates; 1 also rewrites and folds phases; 2 also resynthesises), the basis, the gate set it writes the program in (clifford_t: every rotation off the multiples of π/4 a Clifford+T word; standard: nothing approximated), whether to give the circuit after each pass (stages), and the twirl and dd passes, last (twirl, with its seed; dd, with its sequence).", "properties": { "epsilon": { "type": "number", "exclusiveMinimum": 0 }, "level": { "type": "integer", "minimum": 0, "maximum": 2 }, "basis": { "enum": [ "clifford_t", "standard" ] }, "stages": { "type": "boolean" }, "twirl": { "description": "Twirl each two-qubit Clifford gate with Paulis drawn from a seeded stream: true (seed 1), or {\"seed\": N}. One seed is one instance, checked to be the same circuit.", "anyOf": [ { "type": "boolean" }, { "type": "object", "required": [ "seed" ], "properties": { "seed": { "type": "integer", "minimum": 0 } } } ] }, "dd": { "description": "Dynamical decoupling in each window where a qubit idles long enough: xx or xy4 (or {\"sequence\": …}), checked to change nothing without noise.", "anyOf": [ { "enum": [ "xx", "xy4" ] }, { "type": "boolean" }, { "type": "object", "properties": { "sequence": { "enum": [ "xx", "xy4" ] } } } ] } } }, "intent": { "description": "What the program must do, checked with the run: one intent or a list. The result's verdict says how far it was checked.", "anyOf": [ { "type": "object", "description": "One of distribution, equivalent, prepares or sampled, with its options.", "properties": { "distribution": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 } }, "tolerance": { "type": "number", "minimum": 0, "maximum": 1 }, "equivalent": { "type": "string" }, "prepares": { "type": "string" }, "sampled": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 } }, "test": { "enum": [ "chi_squared", "g_test" ] }, "alpha": { "type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 1 }, "shots": { "type": "integer", "minimum": 1 }, "seed": { "type": "integer", "minimum": 0 }, "require": { "const": "proof" }, "note": { "type": "string" }, "name": { "type": "string" } } }, { "type": "array", "minItems": 1, "items": { "type": "object", "description": "One of distribution, equivalent, prepares or sampled, with its options.", "properties": { "distribution": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 } }, "tolerance": { "type": "number", "minimum": 0, "maximum": 1 }, "equivalent": { "type": "string" }, "prepares": { "type": "string" }, "sampled": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 } }, "test": { "enum": [ "chi_squared", "g_test" ] }, "alpha": { "type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 1 }, "shots": { "type": "integer", "minimum": 1 }, "seed": { "type": "integer", "minimum": 0 }, "require": { "const": "proof" }, "note": { "type": "string" }, "name": { "type": "string" } } } } ] }, "verdict": { "type": "boolean", "description": "true: the result carries a verdict even with no intent." }, "target": { "description": "A device target: a built-in target's name, or a target document. The program is compiled to it, placed and simulated under its noise; noise may not be given beside it.", "anyOf": [ { "type": "string" }, { "title": "wai.quantum.target/1", "description": "A device target: its qubits, the pairs it couples, its native gates with their errors and durations, and the calibration snapshot they come from. A value not known is left out, never written as zero. Every field but format, name, source, qubits, gates and coupling is optional, and a field the format does not name is refused, so a misspelt one never reads as absent. Its canonical text is its RFC 8785 form, and the BLAKE3 of that text, the target's hash, names the snapshot in a receipt.", "type": "object", "required": [ "format", "name", "source", "qubits", "gates", "coupling" ], "additionalProperties": false, "properties": { "format": { "const": "wai.quantum.target/1" }, "name": { "type": "string", "minLength": 1, "maxLength": 200 }, "source": { "type": "object", "required": [ "format" ], "additionalProperties": false, "properties": { "format": { "type": "string", "description": "The format the target was read from (wai-quantum targets import --help lists them)." }, "note": { "type": "string", "maxLength": 400 } } }, "calibration": { "type": "object", "additionalProperties": false, "properties": { "id": { "type": "string", "maxLength": 400, "description": "The calibration snapshot's id, as the source names it, or a content id of the snapshot read." }, "timestamp": { "type": "string", "maxLength": 400, "description": "When the snapshot was taken, as the source writes it." } } }, "qubits": { "type": "array", "minItems": 1, "maxItems": 2048, "description": "Every qubit, in order.", "items": { "type": "object", "required": [ "qubit" ], "additionalProperties": false, "properties": { "qubit": { "type": "integer", "minimum": 0, "description": "Its index: its place in the list." }, "label": { "type": "string", "description": "The source's own name for it, when that is not its index." }, "t1_us": { "type": "number", "minimum": 0, "description": "T1, microseconds." }, "t2_us": { "type": "number", "minimum": 0, "description": "T2 (the echo or Ramsey time the source reports), microseconds." }, "frequency_ghz": { "type": "number", "minimum": 0, "description": "Its frequency, gigahertz." }, "readout": { "type": "object", "required": [ "p01", "p10" ], "additionalProperties": false, "properties": { "p01": { "type": "number", "minimum": 0, "maximum": 1, "description": "P(reads 1 | holds 0)." }, "p10": { "type": "number", "minimum": 0, "maximum": 1, "description": "P(reads 0 | holds 1)." } } }, "measure_ns": { "type": "number", "minimum": 0, "description": "The measurement's duration, nanoseconds." } } } }, "gates": { "type": "array", "maxItems": 262144, "description": "Each native gate where the device runs it, sorted by gate then qubits.", "items": { "type": "object", "required": [ "gate", "qubits" ], "additionalProperties": false, "properties": { "gate": { "type": "string", "pattern": "^[a-z0-9_]{1,40}$" }, "qubits": { "type": "array", "minItems": 1, "maxItems": 2, "items": { "type": "integer", "minimum": 0 } }, "error": { "type": "number", "minimum": 0, "maximum": 1, "description": "The average gate infidelity." }, "duration_ns": { "type": "number", "minimum": 0, "description": "Nanoseconds." } } } }, "coupling": { "type": "array", "description": "The pairs a two-qubit gate may act on, each once, the lower qubit first, sorted.", "items": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "type": "integer", "minimum": 0 } } } } } ] }, "repair": { "description": "Repair the program first on its flagged lines: true, or the choices.", "anyOf": [ { "type": "boolean" }, { "type": "object", "properties": { "max_iterations": { "type": "integer", "minimum": 1 }, "dyadic_bits": { "type": "integer", "minimum": 1, "maximum": 32 }, "sizes": { "type": "object", "additionalProperties": { "type": "integer", "minimum": 1 } } } } ] }, "history": { "type": "object", "description": "The program's history's account of the version the job runs: its digest, and the gates and lines in each hand. The receipt binds it; a history recomputes and checks it." }, "provider": { "type": "string", "description": "The person's own provider to run on, by the name their registry gives it. Only a host that holds their credentials runs such a job; every other host refuses it." }, "programs": { "type": "array", "minItems": 1, "items": { "anyOf": [ { "type": "string", "description": "A program's text." }, { "type": "object", "required": [ "qasm" ], "description": "A job of its own, read as a job request is (no programs or sweep in it); each item of the set's result holds its request in full." } ] }, "description": "A set (engine::sets): the programs to run as one job, each a program's text or a job of its own; the request's other fields apply to every item that does not set them itself." }, "sweep": { "type": "object", "additionalProperties": { "type": "array", "minItems": 1, "items": { "type": "number" } }, "description": "A set over the request's own qasm: values for each of the program's inputs (integer, float or angle), every combination run, the names in sorted order and the first varying slowest." }, "dry_run": { "type": "boolean", "description": "With true: what the host would do with the job or set, running nothing." }, "mitigate": { "description": "Mitigate the job's expectation values (or, for readout, its counts) under its noise (engine::mitigate): zne, pea, pec, cdr, vd or readout, or {\"method\", …} with its options. The result's mitigation gives each value raw and mitigated.", "anyOf": [ { "enum": [ "zne", "pea", "pec", "cdr", "vd", "readout" ] }, { "type": "object", "required": [ "method" ] } ] } } }, "result": { "title": "wai.quantum.job-result/1", "description": "A job's result as the engine gives it, on every host: what was asked of the program, computed by the method its plan chose, with that method's accuracy class. The receipt seals the result without its receipt member, beside the request. A result names the engine that made it and this schema (engine and schema); results made before results carried them have neither and follow this schema all the same.", "type": "object", "required": [ "method", "qubits", "gates", "accuracy" ], "properties": { "engine": { "type": "object", "description": "The engine that made the result: the wai-quantum crate's name and version.", "required": [ "name", "version" ], "properties": { "name": { "const": "wai-quantum" }, "version": { "type": "string", "description": "Its semantic version, as MAJOR.MINOR.PATCH." } } }, "schema": { "const": "wai.quantum.job-result/1", "description": "The schema the result follows." }, "method": { "type": "string", "description": "The method that ran the job (provider for a run on the person's own provider)." }, "qubits": { "type": "integer", "minimum": 0 }, "gates": { "type": "integer", "minimum": 0 }, "accuracy": { "type": "object", "description": "What the method promises of the numbers it gave.", "required": [ "class" ], "properties": { "class": { "enum": [ "bit-exact", "exact", "single", "bounded", "estimate", "heuristic", "measured" ], "description": "bit-exact: the same bits on every machine; exact: no approximation beyond double-precision rounding; single: single-precision arithmetic; bounded: a rigorous bound beside each value; estimate: a statistical estimate with its standard error; heuristic: an approximation with an estimate of its error, not a bound; measured: counts a device returned, not reproducible by recomputation." }, "note": { "type": "string" }, "fusion": { "type": "integer" }, "device": { "type": "string" }, "threshold": { "type": "number" }, "max_weight": { "type": [ "integer", "null" ] }, "max_bond": { "type": "integer" }, "max_bond_used": { "type": "integer" }, "discarded_weight": { "type": "number" }, "fidelity_estimate": { "type": "number" }, "truncations": { "type": "integer" }, "shots": { "type": "integer" }, "trajectories": { "type": "integer" }, "histories": { "type": "integer" }, "gate_applications": { "type": "integer" }, "max_cut": { "type": "integer" }, "order_work": { "type": "number" }, "batch": { "type": "integer" } } }, "state_hash": { "type": "string", "description": "The bit-exact method's statevector hash (BLAKE3, hex): the same on every machine." }, "counts": { "type": "object", "description": "Outcomes and their counts, keyed by the program's classical bits, the highest bit first. At most 65536 outcomes are listed; omitted_shots holds the rest.", "additionalProperties": { "type": "integer", "minimum": 0 } }, "distinct_outcomes": { "type": "integer", "minimum": 0 }, "omitted_shots": { "type": "integer", "minimum": 0 }, "outcome_dimension": { "type": "integer", "minimum": 0, "description": "The stabilizer method: the dimension of the measured outcomes' affine space." }, "shots": { "type": "integer", "minimum": 0, "description": "The shots, where the method names them in the result (trajectories, provider)." }, "expectations": { "type": "array", "items": { "type": "object", "required": [ "observable", "coeff", "value" ], "properties": { "observable": { "type": "string" }, "coeff": { "type": "number" }, "value": { "type": "number", "description": "The coefficient times the expectation value." }, "stderr": { "type": "number", "description": "The standard error, for an estimate." }, "bound": { "type": "number", "description": "A rigorous bound on |exact − value|, for the bounded class." }, "peak_terms": { "type": "integer" }, "threshold_reached": { "type": "number" }, "max_terms": { "type": "integer" }, "ladder": { "type": "array", "description": "The value at thresholds a decade apart, the asked one last.", "items": { "type": "object", "required": [ "threshold", "value", "bound" ], "properties": { "threshold": { "type": "number" }, "value": { "type": "number" }, "bound": { "type": "number" }, "peak_terms": { "type": "integer" }, "threshold_reached": { "type": "number" } } } } } } }, "amplitudes": { "type": "array", "items": { "type": "object", "required": [ "bits", "re", "im" ], "properties": { "bits": { "type": "string", "description": "One 0 or 1 per qubit, qubit n-1 first." }, "re": { "type": "number" }, "im": { "type": "number" } } } }, "global_phase": { "type": "string", "description": "Why the amplitudes' global phase is not fixed, when it is not." }, "warning": { "type": "string" }, "contraction_flops": { "type": "number", "description": "The tensor network's contraction cost." }, "dynamic": { "type": "object", "description": "A program that measures in the middle, resets or branches on a measured bit: how it ran.", "properties": { "measurements_and_resets": { "type": "integer", "minimum": 0 }, "branches_run": { "type": "integer", "minimum": 0 }, "states_at_once": { "type": "integer", "minimum": 0 }, "branches_weighed": { "type": "integer", "minimum": 0 } } }, "outputs": { "type": "array", "description": "The program's output declarations: each its name and type, and its value, or the places of its bits in each outcome.", "items": { "type": "object", "required": [ "name", "type" ], "properties": { "name": { "type": "string" }, "type": { "type": "string" }, "bits": { "type": "array", "items": { "type": "integer", "minimum": 0 } }, "value": { "description": "A number, a boolean, a bit string, a duration's text, {\"re\", \"im\"}, or an array of them." } } } }, "timing": { "type": "object", "description": "A program that states durations (delay, box, stretch) the method does not apply: said so, with the reader's code.", "required": [ "applied", "why" ], "properties": { "applied": { "type": "boolean" }, "code": { "type": "string" }, "why": { "type": "string" } } }, "diagnostics": { "type": "array", "description": "The reader's warnings and notes on the program, each with its code.", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "compiled": { "description": "How the program was compiled before it ran: on the person's own provider, to the device's gates; or, asked with compile, to a basis within a budget. Either way, basis is the gate set it was compiled to.", "anyOf": [ { "type": "object", "description": "A provider job: the program sent, compiled exactly to the device's own gates: its basis (the device's gate set), the BLAKE3 of its OpenQASM 3 text, its counts of gates and swaps, its layouts, and the check it passed before it was sent.", "required": [ "basis", "program" ], "properties": { "basis": { "type": "string" }, "program": { "type": "string" }, "hash": { "type": "string" }, "native_gates": { "type": "integer" }, "two_qubit_gates": { "type": "integer" }, "swaps": { "type": "integer" }, "layout": { "type": "array", "items": { "type": "integer" } }, "final_layout": { "type": "array", "items": { "type": "integer" } }, "checked": { "type": "string" }, "placement": { "type": "object", "description": "Where the program was placed on the device's qubits, and why." } } }, { "type": "object", "description": "A job asked to compile its program first: what ran is the compiled circuit, within distance of the program in the operator norm up to a global phase.", "required": [ "basis", "verdict" ], "properties": { "basis": { "enum": [ "clifford_t", "standard" ], "description": "The gate set the program was compiled to." }, "level": { "type": "integer", "minimum": 0 }, "epsilon": { "type": "number", "description": "The budget asked for." }, "distance": { "type": [ "number", "null" ], "description": "The bound the passes' distances add to." }, "verdict": { "type": "string" }, "source": { "type": "object", "description": "A circuit's counts, as the compiler counts them.", "properties": { "gates": { "type": "integer", "minimum": 0 }, "one_qubit": { "type": "integer", "minimum": 0 }, "two_qubit": { "type": "integer", "minimum": 0 }, "three_qubit": { "type": "integer", "minimum": 0 }, "cnots": { "type": "integer", "minimum": 0 }, "t_count": { "type": "integer", "minimum": 0 }, "rotations": { "type": "integer", "minimum": 0 }, "depth": { "type": "integer", "minimum": 0 } } }, "output": { "type": "object", "description": "A circuit's counts, as the compiler counts them.", "properties": { "gates": { "type": "integer", "minimum": 0 }, "one_qubit": { "type": "integer", "minimum": 0 }, "two_qubit": { "type": "integer", "minimum": 0 }, "three_qubit": { "type": "integer", "minimum": 0 }, "cnots": { "type": "integer", "minimum": 0 }, "t_count": { "type": "integer", "minimum": 0 }, "rotations": { "type": "integer", "minimum": 0 }, "depth": { "type": "integer", "minimum": 0 } } }, "certificate": { "type": [ "string", "null" ], "description": "The BLAKE3 of the compile certificate's RFC 8785 text, in hex." }, "note": { "type": "string" } } } ] }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } }, "target": { "type": "object", "description": "A run on a device target: which target (its hash, as its receipt binds it), its calibration snapshot, where the program was placed and why, and the noise derived from the target.", "required": [ "name", "hash" ], "properties": { "name": { "type": "string" }, "hash": { "type": "string" }, "hash_is": { "type": "string" }, "calibration": { "type": "object", "properties": { "id": { "type": "string" }, "timestamp": { "type": "string" } } }, "source": { "type": "object", "properties": { "format": { "type": "string" }, "note": { "type": "string" } } }, "placement": { "type": "object", "description": "The native gate set, the layout and routes chosen, the swaps, the expected success beside the fewest-swaps layout's, and the check of the compiled program." }, "noise": { "type": "object", "description": "The noise model derived from the target's calibration: its channels, durations and idling, and each qubit's readout." } } }, "repaired": { "type": "object", "description": "A job asked to repair its program first: the program that ran, each repair, and what needs a person.", "properties": { "qasm": { "type": "string" }, "repairs": { "type": "array", "items": { "type": "object", "required": [ "code", "by", "edits" ], "properties": { "code": { "type": "string" }, "rule": { "type": "string" }, "by": { "enum": [ "engine", "proposal" ] }, "flagged": { "type": "array", "items": { "type": "integer" } }, "edits": { "type": "array", "items": { "type": "object", "properties": { "line": { "type": "integer" }, "before": { "type": [ "string", "null" ] }, "after": { "type": [ "string", "null" ] } } } } } } }, "needs_person": { "type": "array", "items": { "type": "object" } } } }, "elapsed_ms": { "type": "integer", "minimum": 0, "description": "Wall time of the run, where the host has a clock (not in a browser tab)." }, "energy": { "description": "The CPU energy of the job's process as the kernel counts it, with its uncertainty and what it leaves out, or unmetered with the reason.", "anyOf": [ { "type": "object", "required": [ "unmetered" ], "properties": { "unmetered": { "type": "string" }, "service_kwh": { "type": "number", "description": "A provider job: the provider's own figure." }, "service_kwh_is": { "type": "string" } } }, { "type": "object", "required": [ "joules_micro", "energy_provenance", "coverage" ], "properties": { "joules_micro": { "type": "integer", "minimum": 1 }, "energy_provenance": { "type": "string" }, "energy_uncertainty": { "type": "object", "properties": { "relative_ppm": { "type": "integer" }, "window_us": { "type": "integer" } } }, "energy_counter_filtering": { "type": "string" }, "coverage": { "enum": [ "whole", "partial" ] }, "covers": { "type": "string" }, "excludes": { "type": "array", "items": { "type": "string" } }, "cpu_ms": { "type": "integer" }, "source": { "type": "string" }, "attribution": { "enum": [ "process", "none" ], "description": "Whose energy it is: the job's worker process, or none (the processor packages' over the job's window, every process on the host in it)." }, "packages": { "type": "integer", "minimum": 1, "description": "The processor packages read." }, "concurrent_jobs": { "type": "integer", "minimum": 0, "description": "Other jobs that ran on the host during the window." }, "counter": { "type": "object", "description": "The package counter as seen: the longest it went between updates, and the smallest step it took.", "properties": { "update_us": { "type": "integer", "minimum": 0 }, "step_uj": { "type": "integer", "minimum": 0 } } }, "declared": { "type": "string", "description": "What the stated uncertainty covers, and what it does not." } } } ] }, "receipt": { "anyOf": [ { "title": "wai.quantum.receipt/2", "description": "A result's receipt: an Ed25519 signature, by the key it names, over digest = BLAKE3(\"wai:quantum-service-receipt\\x02\" ‖ len ‖ request ‖ len ‖ result), each of request and result in its RFC 8785 canonical text (the result without its receipt member), each length 8 bytes big-endian. Whatever members the request and the result hold are sealed, the result's engine and schema among them. The first receipts (no canon member, $defs/first) signed serde_json's own text under the domain ending \\x01; they still verify.", "type": "object", "required": [ "alg", "canon", "key", "digest", "signature" ], "properties": { "alg": { "const": "ed25519" }, "canon": { "const": "rfc8785", "description": "The canonical form the digest is taken over." }, "key": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The signing key, 32 bytes in hex." }, "digest": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The digest signed, 32 bytes in hex." }, "signature": { "type": "string", "minLength": 128, "maxLength": 128, "description": "The signature, 64 bytes in hex." } } }, { "description": "The first form, before canon: the digest is over serde_json's own text of each, under the domain ending \\x01. Never written now; still verified.", "type": "object", "required": [ "alg", "key", "digest", "signature" ], "properties": { "alg": { "const": "ed25519" }, "key": { "type": "string", "minLength": 64, "maxLength": 64 }, "digest": { "type": "string", "minLength": 64, "maxLength": 64 }, "signature": { "type": "string", "minLength": 128, "maxLength": 128 } } } ] }, "provider": { "type": "object", "description": "A provider job: the provider's name, kind and protocol, the device, its provenance, and the hash of its description." }, "calibration": { "type": [ "string", "null" ], "description": "A provider job: the calibration snapshot it ran under." }, "job": { "type": "object", "description": "A provider job: the provider's job id and its status checks." }, "ideal": { "description": "A provider job: the circuit's exact distribution set beside the measured counts.", "anyOf": [ { "type": "object", "required": [ "computed", "total_variation_distance", "hellinger_fidelity" ], "properties": { "computed": { "const": true }, "method": { "type": "string" }, "total_variation_distance": { "type": "number" }, "hellinger_fidelity": { "type": "number" }, "sampling_tvd_expected": { "type": "number" }, "ideal_outcomes": { "type": "integer" }, "note": { "type": "string" } } }, { "type": "object", "required": [ "computed", "why" ], "properties": { "computed": { "const": false }, "why": { "type": "string" } } } ] }, "cost": { "type": "object", "description": "A provider job: the estimate shown before it was sent, what the provider says it charged, and whether the person confirmed a run that was not free." }, "provenance": { "title": "wai.quantum.provenance/1", "description": "What a result came from, under the five categories cross-platform provenance surveys use: the circuit, the computer, the compilation, the execution and the software. A host adds it to the results it seals (the job service does, and each item of a set); a result without it reads as it always did. wai-quantum-service/docs/provenance.md maps every field to where it is and whether the receipt seals it.", "type": "object", "required": [ "schema", "circuit", "computer", "compilation", "execution", "software" ], "properties": { "schema": { "const": "wai.quantum.provenance/1" }, "circuit": { "type": "object", "description": "The program: the BLAKE3 digest of its text as given, its qubits and its gates.", "required": [ "program" ], "properties": { "program": { "type": "string", "description": "BLAKE3 of the program's text, in hex." }, "qubits": { "type": "integer", "minimum": 0 }, "gates": { "type": [ "integer", "null" ] } } }, "computer": { "type": "object", "description": "What ran it: a classical simulator, the method and its accuracy class, and a device target's hash when the job named one.", "required": [ "kind", "method" ], "properties": { "kind": { "const": "simulator" }, "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "target": { "type": "string", "description": "The device target's hash; its layout, routes and noise are in the result's own target." } } }, "compilation": { "type": "object", "description": "Whether the job asked to be compiled; if it did, each pass in order with its check's verdict, the certificate's digest, the gate set compiled to (its basis), the level, the ε budget and the distance the result carries, and that no pass draws a random number.", "required": [ "asked" ], "properties": { "asked": { "type": "boolean" }, "passes": { "type": [ "array", "null" ], "items": { "type": "object", "properties": { "pass": { "type": "string" }, "verdict": { "type": [ "string", "null" ] } } } }, "certificate": { "type": [ "string", "null" ] }, "basis": { "type": [ "string", "null" ], "description": "The gate set compiled to: clifford_t or standard." }, "level": { "type": [ "integer", "null" ] }, "epsilon": { "type": [ "number", "null" ] }, "distance": { "type": [ "number", "null" ] }, "seeded": { "const": false }, "device": { "type": "string", "description": "A job on a device target, compiled exactly to its gates: where its layout and routes are." }, "status": { "const": "not-applicable" }, "why": { "type": "string" } } }, "execution": { "type": "object", "description": "The shots, the seed and the plan the job ran under; its identifier and times are the host's, outside the result.", "required": [ "plan" ], "properties": { "shots": { "type": [ "integer", "null" ] }, "seed": { "type": [ "integer", "null" ] }, "plan": { "type": "object", "properties": { "method": { "type": "string" }, "why": { "type": "string" }, "memory_bytes": { "type": "integer", "minimum": 0 }, "work": { "type": "integer", "minimum": 0 } } } } }, "software": { "type": "object", "description": "The engine's name and version, and the host's.", "required": [ "engine", "host" ], "properties": { "engine": { "type": "string" }, "host": { "type": "string" } } } } }, "mitigation": { "title": "wai.quantum.mitigation/1", "description": "A job's mitigation (its request's mitigate, engine::mitigate), in its result: the method and the options it ran with, its bias and variance assumptions, each observable raw and mitigated with a standard error each and the ideal value (or, for readout, the counts inverted as a quasi-distribution), the method's own details and what it spent. docs/qec.md describes each method.", "type": "object", "required": [ "method", "options", "assumptions" ], "properties": { "method": { "enum": [ "zne", "pea", "pec", "cdr", "vd", "readout" ] }, "options": { "type": "object", "description": "The options it ran with, the defaults filled in.", "properties": { "method": { "type": "string" }, "shots": { "type": "integer" }, "seed": { "type": "integer" }, "factors": { "type": "array", "items": { "type": "number" } }, "extrapolation": { "enum": [ "richardson", "linear", "exponential" ] }, "samples": { "type": "integer" }, "training": { "type": "integer" }, "keep": { "type": "integer" }, "learn_shots": { "type": "integer" } } }, "assumptions": { "type": "object", "properties": { "bias": { "type": "string" }, "variance": { "type": "string" } } }, "noise": { "type": "string", "description": "How the job's noise model is read for the method." }, "note": { "type": "string" }, "observables": { "type": "array", "items": { "type": "object", "description": "One observable: its raw value and the mitigated one, each with its standard error, and the ideal value a simulation knows.", "properties": { "observable": { "type": "string" }, "coeff": { "type": "number" }, "raw": { "type": "number" }, "raw_stderr": { "type": "number" }, "mitigated": { "type": "number" }, "stderr": { "type": "number" }, "ideal": { "type": "number" } } } }, "distribution": { "type": "array", "description": "readout: each outcome's raw share and its mitigated quasi-probability, with its standard error.", "items": { "type": "object", "properties": { "bits": { "type": "string" }, "raw": { "type": "number" }, "mitigated": { "type": "number" }, "stderr": { "type": "number" } } } }, "details": { "type": "object", "description": "The method's own: the folded scales and the folding check (zne), the learned model and the amplified values (pea), the quasi-probability and the value it converges to (pec), the training fits (cdr), the purity (vd), the flip and its amplification (readout).", "additionalProperties": true }, "cost": { "type": "object", "description": "The circuits and shots it spent beyond the job's own.", "properties": { "circuits": { "type": "integer", "minimum": 0 }, "shots": { "type": "integer", "minimum": 0 }, "note": { "type": "string" } } } } } } }, "error": { "type": "string" }, "code": { "type": "string", "description": "A failed item's refusal code (engine::refusal)." }, "path": { "type": "array", "items": { "type": "string" }, "description": "The item's leaf's sibling digests up to the root, in hex." } } } } } } ] }, "error": { "type": "string", "description": "Why a job failed." }, "submitted_ms": { "type": "integer", "description": "The job service: when it was submitted, in milliseconds since 1970." }, "started_ms": { "type": "integer" }, "finished_ms": { "type": "integer" }, "peak_rss_bytes": { "type": "integer", "description": "The job service: the most memory the job's process held." }, "digests": { "type": "object", "description": "The job service: the BLAKE3 digests its store keeps the job's objects under (the request, each program, the result and the receipt).", "properties": { "algorithm": { "const": "blake3" }, "request": { "type": [ "string", "null" ] }, "programs": { "type": "array", "items": { "type": "string" } }, "result": { "type": "string" }, "receipt": { "type": "string" } } }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } } } }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } } } } ], "required": [ "verdict" ] } }, { "name": "plan_quantum_circuit", "title": "Plan a quantum program", "description": "The method a program would run on and why, the memory and work it would take, without running it.", "inputSchema": { "type": "object", "required": [ "qasm" ], "properties": { "qasm": { "type": "string", "description": "The program, OpenQASM 3 or 2: registers and broadcast over them, the standard gates, ctrl/negctrl modifiers, gate definitions, measurement and reset anywhere, if on measured bits, and generators (integer input, const and for loops, one program for a family of circuits; give the inputs' values in \"inputs\"). while, inv and pow are refused with their line." }, "inputs": { "type": "object", "additionalProperties": { "type": "integer" }, "description": "Values for a generator's integer inputs, as {\"n\": 5}: the program is read as its family's circuit at those values." }, "shots": { "type": "integer", "minimum": 0, "description": "Shots to sample; 1024 when nothing else is asked." }, "seed": { "type": "integer", "minimum": 0, "description": "The sampling seed (default 1)." }, "method": { "type": "string", "description": "auto (the default: the strongest method the program admits), or one of list_methods' names." }, "observables": { "type": "array", "items": { "type": "string" }, "description": "Pauli observables, as \"Z0 Z1\" or \"0.5 X2\"." }, "amplitudes": { "type": "array", "items": { "type": "string" }, "description": "Basis states whose amplitudes to return, as bit strings with the highest qubit first." }, "noise": { "type": "object", "description": "Channel probabilities", "properties": { "depolarizing_1q": { "type": "number", "minimum": 0, "maximum": 1 }, "depolarizing_2q": { "type": "number", "minimum": 0, "maximum": 1 }, "amplitude_damping": { "type": "number", "minimum": 0, "maximum": 1 }, "dephasing": { "type": "number", "minimum": 0, "maximum": 1 }, "readout": { "type": "number", "minimum": 0, "maximum": 1 } }, "additionalProperties": false }, "options": { "type": "object", "description": "Method options: max_bond, fusion, trajectories, threshold, memory_gb." }, "compile": { "type": "object", "description": "Compile the program first (as compile_qasm does) and run the compiled circuit: with basis clifford_t it runs bit-exact, and the result's \"compiled\" states its distance from the program.", "properties": { "epsilon": { "type": "number", "exclusiveMinimum": 0, "description": "The most the output may differ from the program in the operator norm, up to a global phase, shared by its rotations (default 1e-6)." }, "level": { "type": "integer", "minimum": 0, "maximum": 2, "description": "0: lower and approximate; 1 (default): also checked rewrites and phase folding; 2: also one- and two-qubit resynthesis." }, "basis": { "type": "string", "enum": [ "clifford_t", "standard" ], "description": "clifford_t (default): every rotation off the multiples of π/4 written as a Clifford+T word; standard: nothing approximated." }, "twirl": { "description": "Twirl each two-qubit Clifford gate with Paulis from a seeded stream: true, or {\"seed\": N}. One seed is one instance, checked to be the same circuit." }, "dd": { "type": "string", "enum": [ "xx", "xy4" ], "description": "Dynamical decoupling in each window where a qubit idles long enough, checked to change nothing without noise." } } }, "target": { "description": "A device target: its name (list_targets) or a target document (wai.quantum.target/1). The program is then compiled to the target's gates, placed where it is most likely to succeed and simulated under the target's noise, the target's hash in the receipt; noise may not be given beside it." }, "intent": { "description": "What the program must do, checked by the engine with the run: the result's \"verdict\" states how far it checked (proof, evidence, executed, parsed, refused) and whether the intent holds, sealed by the receipt.", "anyOf": [ { "type": "object", "description": "One of distribution, equivalent, prepares or sampled; with note, name, and \"require\": \"proof\" (evidence then counts as unchecked).", "properties": { "distribution": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 }, "description": "The exact distribution of the measured bits, keyed by the classical bits with the highest bit first, as {\"00\": 0.5, \"11\": 0.5}." }, "tolerance": { "type": "number", "minimum": 0, "maximum": 1, "description": "For a distribution: the total variation distance it is held within (default 1e-9)." }, "equivalent": { "type": "string", "description": "A reference program's text: the same circuit up to a global phase, by the equivalence ladder." }, "prepares": { "type": "string", "description": "A reference program's text: the same state from |0…0⟩, the same qubits measured into the same bits." }, "sampled": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 }, "description": "A distribution the program's samples are held to: the program run as the job runs it for `shots` at `seed`, and the counts tested by `test` at the significance level `alpha` (all three required). Evidence, never proof." }, "test": { "enum": [ "chi_squared", "g_test" ], "description": "For a sampled intent: Pearson's chi-squared test, or the G-test (the likelihood ratio)." }, "alpha": { "type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 1, "description": "For a sampled intent: the significance level, as 0.01." }, "shots": { "type": "integer", "minimum": 1, "description": "For a sampled intent: the samples the test takes." }, "seed": { "type": "integer", "minimum": 0, "description": "For a sampled intent: the sampling seed (default: the job's)." }, "require": { "const": "proof" }, "note": { "type": "string" }, "name": { "type": "string" } } }, { "type": "array", "items": { "type": "object", "description": "One of distribution, equivalent, prepares or sampled; with note, name, and \"require\": \"proof\" (evidence then counts as unchecked).", "properties": { "distribution": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 }, "description": "The exact distribution of the measured bits, keyed by the classical bits with the highest bit first, as {\"00\": 0.5, \"11\": 0.5}." }, "tolerance": { "type": "number", "minimum": 0, "maximum": 1, "description": "For a distribution: the total variation distance it is held within (default 1e-9)." }, "equivalent": { "type": "string", "description": "A reference program's text: the same circuit up to a global phase, by the equivalence ladder." }, "prepares": { "type": "string", "description": "A reference program's text: the same state from |0…0⟩, the same qubits measured into the same bits." }, "sampled": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 }, "description": "A distribution the program's samples are held to: the program run as the job runs it for `shots` at `seed`, and the counts tested by `test` at the significance level `alpha` (all three required). Evidence, never proof." }, "test": { "enum": [ "chi_squared", "g_test" ], "description": "For a sampled intent: Pearson's chi-squared test, or the G-test (the likelihood ratio)." }, "alpha": { "type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 1, "description": "For a sampled intent: the significance level, as 0.01." }, "shots": { "type": "integer", "minimum": 1, "description": "For a sampled intent: the samples the test takes." }, "seed": { "type": "integer", "minimum": 0, "description": "For a sampled intent: the sampling seed (default: the job's)." }, "require": { "const": "proof" }, "note": { "type": "string" }, "name": { "type": "string" } } }, "minItems": 1 } ] }, "repair": { "description": "Repair the program first, on the lines its diagnostics flag alone (as repair_qasm does): true, or the choices {\"max_iterations\": N, \"dyadic_bits\": K, \"sizes\": {\"q\": 3}}. The result's \"repaired\" holds the program that ran and each repair." }, "mitigate": { "description": "Mitigate the job's expectation values (or, for readout, its counts) under its own noise: zne (the whole program folded U(U†U)^k and extrapolated), pea (the noise learned as a sparse Pauli–Lindblad model and amplified), pec (the learned channels inverted and sampled), cdr (a line fitted over near-Clifford training circuits), vd (two copies), readout (the counts' flips inverted). Needs noise and observables (shots for readout), at most 8 qubits. The result's `mitigation` gives raw and mitigated values with standard errors, the ideal value (known because this is a simulation), the method's bias and variance assumptions and its cost. A method's name, or an object.", "anyOf": [ { "type": "string", "enum": [ "zne", "pea", "pec", "cdr", "vd", "readout" ] }, { "type": "object", "required": [ "method" ], "properties": { "method": { "type": "string", "enum": [ "zne", "pea", "pec", "cdr", "vd", "readout" ] }, "shots": { "type": "integer", "minimum": 1, "maximum": 1000000, "description": "Shots per circuit (default 10000; 2000 per sampled circuit for pec)." }, "seed": { "type": "integer", "minimum": 0 }, "factors": { "type": "array", "items": { "type": "number" }, "description": "zne: odd whole numbers (default 1, 3, 5); pea: factors from 1 to 10 (default 1, 1.5, 2)." }, "extrapolation": { "type": "string", "enum": [ "richardson", "linear", "exponential" ] }, "samples": { "type": "integer", "minimum": 2, "description": "pec: sampled circuits (default 200)." }, "training": { "type": "integer", "minimum": 3, "description": "cdr: training circuits (default 16)." }, "keep": { "type": "integer", "minimum": 0, "description": "cdr: non-Clifford gates each training circuit keeps (default 2, and always one fewer than the program has)." }, "learn_shots": { "type": "integer", "minimum": 100, "description": "pea, pec: shots per depth of the cycle benchmarking that learns the noise (default 60000)." } } } ] } } }, "outputSchema": { "$id": "wai-quantum://schemas/plan_quantum_circuit/1", "type": "object", "description": "What a job will run, before it runs: the method the planner chose and why, the memory the job is admitted with (an upper estimate) and its work in the method's own unit. The command line's plan --json and both servers' plan tools give it.", "anyOf": [ { "title": "wai.quantum.plan/1", "description": "What a job will run, before it runs: the method the planner chose and why, the memory the job is admitted with (an upper estimate) and its work in the method's own unit. The command line's plan --json and both servers' plan tools give it.", "type": "object", "required": [ "method", "why", "memory_bytes", "work", "qubits" ], "properties": { "method": { "type": "string" }, "why": { "type": "string" }, "memory_bytes": { "type": "integer", "minimum": 0 }, "work": { "type": "integer", "minimum": 0 }, "qubits": { "type": "integer", "minimum": 0 }, "target": { "type": "object", "description": "A run on a device target: which target (its hash, as its receipt binds it), its calibration snapshot, where the program was placed and why, and the noise derived from the target.", "required": [ "name", "hash" ], "properties": { "name": { "type": "string" }, "hash": { "type": "string" }, "hash_is": { "type": "string" }, "calibration": { "type": "object", "properties": { "id": { "type": "string" }, "timestamp": { "type": "string" } } }, "source": { "type": "object", "properties": { "format": { "type": "string" }, "note": { "type": "string" } } }, "placement": { "type": "object", "description": "The native gate set, the layout and routes chosen, the swaps, the expected success beside the fewest-swaps layout's, and the check of the compiled program." }, "noise": { "type": "object", "description": "The noise model derived from the target's calibration: its channels, durations and idling, and each qubit's readout." } } }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } } } }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } } } } ], "required": [ "verdict" ] } }, { "name": "lint_qasm", "title": "Check an OpenQASM program", "description": "Parse an OpenQASM program as the engine reads it: its qubits, gates and measured bits, or the first problem with its line.", "inputSchema": { "type": "object", "required": [ "qasm" ], "properties": { "qasm": { "type": "string", "description": "The program, OpenQASM 3 or 2, or a generator (integer input, const, for loops) with its values in \"inputs\"." }, "inputs": { "type": "object", "additionalProperties": { "type": "integer" }, "description": "Values for a generator's integer inputs, as {\"n\": 5}: the program is read as its family's circuit at those values." } } }, "outputSchema": { "$id": "wai-quantum://schemas/lint_qasm/1", "type": "object", "description": "A program read as the engine reads it: its shape, or the first problem with its line.", "anyOf": [ { "description": "A program read as the engine reads it: its shape, or the first problem with its line.", "anyOf": [ { "type": "object", "required": [ "ok", "qubits", "gates", "bits", "measured" ], "properties": { "ok": { "const": true }, "qubits": { "type": "integer", "minimum": 0 }, "gates": { "type": "integer", "minimum": 0 }, "bits": { "type": "integer", "minimum": 0 }, "measured": { "type": "integer", "minimum": 0 }, "dynamic_steps": { "type": [ "integer", "null" ], "description": "The steps of a program that measures in the middle, resets or branches; null otherwise." }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } }, "description": "The reader's warnings and notes on a program it read, each with its code; present only when there are any." }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } } } }, { "type": "object", "description": "A program that does not read: the problem, and its line, its diagnostic code, column and length when the reader names them.", "required": [ "ok", "error" ], "properties": { "ok": { "const": false }, "error": { "type": "string" }, "line": { "type": [ "integer", "null" ] }, "code": { "type": "string", "description": "The reader's diagnostic code, as Q103; qasm_diagnostics says what each means." }, "column": { "type": "integer", "minimum": 1, "description": "Where the problem starts on its line, in characters from 1." }, "length": { "type": "integer", "minimum": 0, "description": "Its length on that line, in characters." }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } } } } ] }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } } } } ], "required": [ "verdict" ] } }, { "name": "repair_qasm", "title": "Repair a program on its flagged lines", "description": "Repair a program the reader refuses, changing only the lines its diagnostics flag. The engine makes the fixes that are mechanical (a missing `;`, an undeclared register's size, a measurement with no target, an unbounded while given the bound chosen, an angle the bit-exact method refuses rounded to the bits chosen with its rounding stated), and holds a fix you propose (`proposed`) to the flagged lines: any change to another line is rejected (J021) and nothing is changed. Returns the repaired program, each repair with its code and every line it changed, what needs a person with the reader's advice, and the verdict. Never guess what a needs-a-person code means: ask.", "inputSchema": { "type": "object", "required": [ "qasm" ], "properties": { "qasm": { "type": "string", "description": "The program, OpenQASM 3 or 2, or a generator (integer input, const, for loops) with its values in \"inputs\"." }, "inputs": { "type": "object", "additionalProperties": { "type": "integer" }, "description": "Values for a generator's integer inputs, as {\"n\": 5}: the program is read as its family's circuit at those values." }, "proposed": { "type": "string", "description": "Your repaired version: taken only if every changed line is a flagged one (or a line added beside one)." }, "max_iterations": { "type": "integer", "minimum": 1, "description": "The bound for an unbounded `while` on measured bits (Q310), as the person chose it." }, "dyadic_bits": { "type": "integer", "minimum": 1, "maximum": 32, "description": "Round each angle the bit-exact method refuses (Q500) to the nearest multiple of 2π/2^K." }, "sizes": { "type": "object", "additionalProperties": { "type": "integer", "minimum": 1 }, "description": "A register's size, for one used before it is declared (Q102)." }, "diagnostics": { "type": "array", "description": "Codes you saw that reading the text does not raise (Q500, from a run on the bit-exact method)." }, "rules": { "type": "boolean", "description": "false: only check the proposal, make none of the engine's fixes." } } }, "outputSchema": { "$id": "wai-quantum://schemas/repair_qasm/1", "type": "object", "description": "A program repaired on the lines its diagnostics flag alone: the program as it now is, each repair with the code it answered and every line it changed, and what needs a person, with the reader's advice.", "anyOf": [ { "type": "object", "description": "A program repaired on the lines its diagnostics flag alone: the program as it now is, each repair with the code it answered and every line it changed, and what needs a person, with the reader's advice.", "required": [ "ok", "changed", "qasm", "repairs", "needs_person" ], "properties": { "ok": { "type": "boolean", "description": "Whether the program now reads." }, "changed": { "type": "boolean" }, "qasm": { "type": "string" }, "repairs": { "type": "array", "items": { "type": "object", "required": [ "code", "by", "edits" ], "properties": { "code": { "type": "string" }, "rule": { "type": "string" }, "by": { "enum": [ "engine", "proposal" ] }, "flagged": { "type": "array", "items": { "type": "integer" } }, "edits": { "type": "array", "items": { "type": "object", "properties": { "line": { "type": "integer" }, "before": { "type": [ "string", "null" ] }, "after": { "type": [ "string", "null" ] } } } } } } }, "needs_person": { "type": "array", "items": { "type": "object", "required": [ "code" ], "properties": { "code": { "type": "string" }, "line": { "type": [ "integer", "null" ] }, "message": { "type": "string" }, "advice": { "type": "string" } } } }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } } } }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } } } } ], "required": [ "verdict" ] } }, { "name": "critique_qasm", "title": "Critique an OpenQASM program", "description": "A program's measures, computed by the engine: gates by kind, one-, two- and three-qubit gates, depth and two-qubit depth, T count, whether it is a Clifford circuit, and a fidelity under reference error rates, which is a model and not a run. And its smells, each with its lines: gates that cancel, rotations that merge or do nothing, idle qubits, qubits acted on but never measured.", "inputSchema": { "type": "object", "required": [ "qasm" ], "properties": { "qasm": { "type": "string", "description": "The program, OpenQASM 3 or 2, or a generator (integer input, const, for loops) with its values in \"inputs\"." }, "inputs": { "type": "object", "additionalProperties": { "type": "integer" }, "description": "Values for a generator's integer inputs, as {\"n\": 5}: the program is read as its family's circuit at those values." } } }, "outputSchema": { "$id": "wai-quantum://schemas/critique_qasm/1", "type": "object", "description": "A program's measures and its smells, each with its lines; or why it does not read.", "anyOf": [ { "description": "A program's measures and its smells, each with its lines; or why it does not read.", "anyOf": [ { "type": "object", "description": "A program's measures, computed by the engine.", "required": [ "ok", "qubits", "gates", "depth", "two_qubit", "t_count", "clifford" ], "properties": { "ok": { "const": true }, "qubits": { "type": "integer" }, "bits": { "type": "integer" }, "gates": { "type": "integer" }, "one_qubit": { "type": "integer" }, "two_qubit": { "type": "integer" }, "three_qubit": { "type": "integer" }, "t_count": { "type": "integer" }, "non_clifford": { "type": "integer" }, "clifford": { "type": "boolean" }, "depth": { "type": "integer" }, "two_qubit_depth": { "type": "integer" }, "measured": { "type": "integer" }, "dynamic": { "type": "boolean" }, "by_gate": { "type": "object", "additionalProperties": { "type": "integer" } }, "fidelity_model": { "type": "object", "description": "A fidelity under reference error rates: a model of a device, not a run.", "required": [ "estimate" ], "properties": { "estimate": { "type": "number" }, "rates": { "type": "object", "properties": { "one_qubit": { "type": "number" }, "two_qubit": { "type": "number" }, "readout": { "type": "number" } } }, "note": { "type": "string" } } }, "smells": { "type": "array", "items": { "type": "object", "required": [ "kind", "message", "lines", "fixable" ], "properties": { "kind": { "type": "string" }, "message": { "type": "string" }, "lines": { "type": "array", "items": { "type": "integer" } }, "ops": { "type": "array", "items": { "type": "integer" } }, "qubits": { "type": "array", "items": { "type": "integer" } }, "fixable": { "type": "boolean" } } } }, "inputs": { "type": "object", "additionalProperties": { "type": "integer" }, "description": "A generator's inputs, when it was read at them." }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } } } }, { "type": "object", "description": "A program that does not read: the problem, and its line, its diagnostic code, column and length when the reader names them.", "required": [ "ok", "error" ], "properties": { "ok": { "const": false }, "error": { "type": "string" }, "line": { "type": [ "integer", "null" ] }, "code": { "type": "string", "description": "The reader's diagnostic code, as Q103; qasm_diagnostics says what each means." }, "column": { "type": "integer", "minimum": 1, "description": "Where the problem starts on its line, in characters from 1." }, "length": { "type": "integer", "minimum": 0, "description": "Its length on that line, in characters." }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } } } } ] }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } } } } ], "required": [ "verdict" ] } }, { "name": "check_equivalent", "title": "Check two programs are the same circuit", "description": "Whether two programs are the same circuit up to a global phase, and how the engine knows: equal tableaus for Clifford circuits at any size, every basis state to 8 qubits, checked rewrites of one followed by the other's inverse to nothing (a proof at any width), random product states to 22 qubits (evidence, not proof), or unchecked with the reason. Its `verdict` is that decision; `verification` is the level it reached, as every tool's verdict states it.", "inputSchema": { "type": "object", "required": [ "a", "b" ], "properties": { "a": { "type": "string", "description": "The first program." }, "b": { "type": "string", "description": "The second program." }, "inputs": { "type": "object", "additionalProperties": { "type": "integer" }, "description": "Values for a generator's integer inputs, as {\"n\": 5}: the program is read as its family's circuit at those values." } } }, "outputSchema": { "$id": "wai-quantum://schemas/check_equivalent/1", "type": "object", "description": "Whether two programs are the same circuit up to a global phase, and how the engine decided.", "anyOf": [ { "type": "object", "description": "Whether two programs are the same circuit up to a global phase, and how the engine decided.", "required": [ "verdict", "how", "why" ], "properties": { "verdict": { "enum": [ "equivalent", "different", "unchecked" ] }, "how": { "enum": [ "tableau", "exact", "rewrites", "random", "state", "shape", "none" ], "description": "tableau, exact and rewrites are proofs; state is a proof of the same state from |0…0⟩; random is evidence, not proof; shape: they differ in their shape; none: unchecked." }, "why": { "type": "string" }, "global_phase": { "type": [ "number", "null" ], "description": "The global phase between them, in units of π." }, "steps": { "type": "integer", "description": "rewrites: the checked steps to nothing." }, "verification": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } } } }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" }, "verification": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } } } } ], "required": [ "verification" ] } }, { "name": "improve_qasm", "title": "Improve an OpenQASM program", "description": "The program with its smells fixed in its own text (all of them, and each alone), each with its measures and the equivalence check's verdict against the original. A candidate the check finds different is never returned.", "inputSchema": { "type": "object", "required": [ "qasm" ], "properties": { "qasm": { "type": "string", "description": "The program, OpenQASM 3 or 2, or a generator (integer input, const, for loops) with its values in \"inputs\"." }, "inputs": { "type": "object", "additionalProperties": { "type": "integer" }, "description": "Values for a generator's integer inputs, as {\"n\": 5}: the program is read as its family's circuit at those values." } } }, "outputSchema": { "$id": "wai-quantum://schemas/improve_qasm/1", "type": "object", "description": "The program with its smells fixed, all together and each alone, each candidate checked against the program; a candidate found different is never given.", "anyOf": [ { "description": "The program with its smells fixed, all together and each alone, each candidate checked against the program; a candidate found different is never given.", "anyOf": [ { "type": "object", "required": [ "ok", "base", "candidates" ], "properties": { "ok": { "const": true }, "base": { "type": "object", "description": "A program's measures, computed by the engine.", "required": [ "ok", "qubits", "gates", "depth", "two_qubit", "t_count", "clifford" ], "properties": { "ok": { "const": true }, "qubits": { "type": "integer" }, "bits": { "type": "integer" }, "gates": { "type": "integer" }, "one_qubit": { "type": "integer" }, "two_qubit": { "type": "integer" }, "three_qubit": { "type": "integer" }, "t_count": { "type": "integer" }, "non_clifford": { "type": "integer" }, "clifford": { "type": "boolean" }, "depth": { "type": "integer" }, "two_qubit_depth": { "type": "integer" }, "measured": { "type": "integer" }, "dynamic": { "type": "boolean" }, "by_gate": { "type": "object", "additionalProperties": { "type": "integer" } }, "fidelity_model": { "type": "object", "description": "A fidelity under reference error rates: a model of a device, not a run.", "required": [ "estimate" ], "properties": { "estimate": { "type": "number" }, "rates": { "type": "object", "properties": { "one_qubit": { "type": "number" }, "two_qubit": { "type": "number" }, "readout": { "type": "number" } } }, "note": { "type": "string" } } }, "smells": { "type": "array", "items": { "type": "object", "required": [ "kind", "message", "lines", "fixable" ], "properties": { "kind": { "type": "string" }, "message": { "type": "string" }, "lines": { "type": "array", "items": { "type": "integer" } }, "ops": { "type": "array", "items": { "type": "integer" } }, "qubits": { "type": "array", "items": { "type": "integer" } }, "fixable": { "type": "boolean" } } } }, "inputs": { "type": "object", "additionalProperties": { "type": "integer" }, "description": "A generator's inputs, when it was read at them." } } }, "candidates": { "type": "array", "items": { "type": "object", "required": [ "label", "qasm", "changes", "measures", "equivalence" ], "properties": { "label": { "type": "string" }, "qasm": { "type": "string" }, "changes": { "type": "array", "items": { "type": "string" } }, "measures": { "type": "object", "description": "A program's measures, computed by the engine.", "required": [ "ok", "qubits", "gates", "depth", "two_qubit", "t_count", "clifford" ], "properties": { "ok": { "const": true }, "qubits": { "type": "integer" }, "bits": { "type": "integer" }, "gates": { "type": "integer" }, "one_qubit": { "type": "integer" }, "two_qubit": { "type": "integer" }, "three_qubit": { "type": "integer" }, "t_count": { "type": "integer" }, "non_clifford": { "type": "integer" }, "clifford": { "type": "boolean" }, "depth": { "type": "integer" }, "two_qubit_depth": { "type": "integer" }, "measured": { "type": "integer" }, "dynamic": { "type": "boolean" }, "by_gate": { "type": "object", "additionalProperties": { "type": "integer" } }, "fidelity_model": { "type": "object", "description": "A fidelity under reference error rates: a model of a device, not a run.", "required": [ "estimate" ], "properties": { "estimate": { "type": "number" }, "rates": { "type": "object", "properties": { "one_qubit": { "type": "number" }, "two_qubit": { "type": "number" }, "readout": { "type": "number" } } }, "note": { "type": "string" } } }, "smells": { "type": "array", "items": { "type": "object", "required": [ "kind", "message", "lines", "fixable" ], "properties": { "kind": { "type": "string" }, "message": { "type": "string" }, "lines": { "type": "array", "items": { "type": "integer" } }, "ops": { "type": "array", "items": { "type": "integer" } }, "qubits": { "type": "array", "items": { "type": "integer" } }, "fixable": { "type": "boolean" } } } }, "inputs": { "type": "object", "additionalProperties": { "type": "integer" }, "description": "A generator's inputs, when it was read at them." } } }, "equivalence": { "type": "object", "description": "Whether two programs are the same circuit up to a global phase, and how the engine decided.", "required": [ "verdict", "how", "why" ], "properties": { "verdict": { "enum": [ "equivalent", "different", "unchecked" ] }, "how": { "enum": [ "tableau", "exact", "rewrites", "random", "state", "shape", "none" ], "description": "tableau, exact and rewrites are proofs; state is a proof of the same state from |0…0⟩; random is evidence, not proof; shape: they differ in their shape; none: unchecked." }, "why": { "type": "string" }, "global_phase": { "type": [ "number", "null" ], "description": "The global phase between them, in units of π." }, "steps": { "type": "integer", "description": "rewrites: the checked steps to nothing." } } } } } }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } } } }, { "type": "object", "description": "A program that does not read: the problem, and its line, its diagnostic code, column and length when the reader names them.", "required": [ "ok", "error" ], "properties": { "ok": { "const": false }, "error": { "type": "string" }, "line": { "type": [ "integer", "null" ] }, "code": { "type": "string", "description": "The reader's diagnostic code, as Q103; qasm_diagnostics says what each means." }, "column": { "type": "integer", "minimum": 1, "description": "Where the problem starts on its line, in characters from 1." }, "length": { "type": "integer", "minimum": 0, "description": "Its length on that line, in characters." }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } } } } ] }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } } } } ], "required": [ "verdict" ] } }, { "name": "classical_shortcuts", "title": "Find a program's classical shortcuts", "description": "Every exact classical route the engine knows for simulating a program, with its cost on it: the stabilizer tableau (Clifford circuits), the cut-rank sum (a Clifford circuit then one layer of one-qubit gates), an exact matrix product state at a rigorous bond bound, the light cone of a one-qubit expectation value, a tensor-network contraction (thorough only) and the state vector. Each gives its memory and the log2 of its operations, with the cheapest for each question. A cheap route proves the program classically easy; none being cheap proves nothing about hardness.", "inputSchema": { "type": "object", "required": [ "qasm" ], "properties": { "qasm": { "type": "string", "description": "The program, OpenQASM 3 or 2, or a generator (integer input, const, for loops) with its values in \"inputs\"." }, "inputs": { "type": "object", "additionalProperties": { "type": "integer" }, "description": "Values for a generator's integer inputs, as {\"n\": 5}: the program is read as its family's circuit at those values." }, "thorough": { "type": "boolean", "description": "Also search a contraction tree, and search longer for a cut-rank order: seconds to minutes on a large program." } } }, "outputSchema": { "$id": "wai-quantum://schemas/classical_shortcuts/1", "type": "object", "description": "Every exact classical route the engine knows for a program, priced on it, and the cheapest for each question.", "anyOf": [ { "description": "Every exact classical route the engine knows for a program, priced on it, and the cheapest for each question.", "anyOf": [ { "type": "object", "required": [ "ok", "qubits", "gates", "routes", "cheapest", "summary" ], "properties": { "ok": { "const": true }, "qubits": { "type": "integer" }, "gates": { "type": "integer" }, "thorough": { "type": "boolean" }, "routes": { "type": "array", "items": { "type": "object", "required": [ "route", "answers", "applies", "why" ], "properties": { "route": { "type": "string" }, "answers": { "type": "array", "items": { "type": "string" } }, "applies": { "type": "boolean" }, "why": { "type": "string" }, "memory_bytes": { "type": "number" }, "log2_work": { "type": "number" }, "seconds_at_reference": { "type": "number" }, "size": { "type": "object" } } } }, "cheapest": { "type": "object", "description": "For counts, amplitudes, expectations and one_qubit_expectations: the cheapest route that answers it, or null.", "additionalProperties": { "anyOf": [ { "type": "null" }, { "type": "object", "required": [ "route" ], "properties": { "route": { "type": "string" }, "memory_bytes": { "type": "number" }, "log2_work": { "type": "number" }, "seconds_at_reference": { "type": "number" } } } ] } }, "summary": { "type": "string" }, "reference_rate": { "type": "number", "description": "Operations a second the times assume." }, "note": { "type": "string" }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } } } }, { "type": "object", "description": "A program that does not read: the problem, and its line, its diagnostic code, column and length when the reader names them.", "required": [ "ok", "error" ], "properties": { "ok": { "const": false }, "error": { "type": "string" }, "line": { "type": [ "integer", "null" ] }, "code": { "type": "string", "description": "The reader's diagnostic code, as Q103; qasm_diagnostics says what each means." }, "column": { "type": "integer", "minimum": 1, "description": "Where the problem starts on its line, in characters from 1." }, "length": { "type": "integer", "minimum": 0, "description": "Its length on that line, in characters." }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } } } } ] }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } } } } ], "required": [ "verdict" ] } }, { "name": "compile_qasm", "title": "Compile a program, every pass checked", "description": "Compile an OpenQASM program through named passes (lowering, checked rewrites, phase folding, one- and two-qubit resynthesis, and every rotation off the multiples of π/4 written as a Clifford+T word within its share of the ε budget), each checked where it acts. Returns the compiled program and a certificate signed with this user's key: each pass's counts before and after (gates, CNOTs, T count, rotations), its check and verdict (proof, exact or approximate with its distance), the ε budget, the bound the distances add to, and up to 8 qubits the whole output's distance measured against the program. Quote the bound; do not call an approximate compile exact.", "inputSchema": { "type": "object", "required": [ "qasm" ], "properties": { "qasm": { "type": "string", "description": "The program, OpenQASM 3 or 2, or a generator with its values in \"inputs\"." }, "inputs": { "type": "object", "additionalProperties": { "type": "integer" }, "description": "Values for a generator's integer inputs, as {\"n\": 5}: the program is read as its family's circuit at those values." }, "epsilon": { "type": "number", "exclusiveMinimum": 0, "description": "The most the output may differ from the program in the operator norm, up to a global phase, shared by its rotations (default 1e-6)." }, "level": { "type": "integer", "minimum": 0, "maximum": 2, "description": "0: lower and approximate; 1 (default): also checked rewrites and phase folding; 2: also one- and two-qubit resynthesis." }, "basis": { "type": "string", "enum": [ "clifford_t", "standard" ], "description": "clifford_t (default): every rotation off the multiples of π/4 written as a Clifford+T word; standard: nothing approximated." }, "twirl": { "description": "Twirl each two-qubit Clifford gate with Paulis from a seeded stream: true, or {\"seed\": N}. One seed is one instance, checked to be the same circuit." }, "dd": { "type": "string", "enum": [ "xx", "xy4" ], "description": "Dynamical decoupling in each window where a qubit idles long enough, checked to change nothing without noise." } } }, "outputSchema": { "$id": "wai-quantum://schemas/compile_qasm/1", "type": "object", "description": "A compile as a host returns it (the command line's compile --json, both servers' compile_qasm, the job service's POST /v1/compile): the request as given, and the result, which its receipt seals in the form every job's receipt takes. The result holds the compiled program and its certificate (wai.quantum.compile/1): each pass's counts before and after, its check and verdict, the budget and the bound the passes' distances add to. A result names the engine that made it and this schema (engine and schema); results made before results carried them have neither.", "anyOf": [ { "title": "wai.quantum.compile-result/1", "description": "A compile as a host returns it (the command line's compile --json, both servers' compile_qasm, the job service's POST /v1/compile): the request as given, and the result, which its receipt seals in the form every job's receipt takes. The result holds the compiled program and its certificate (wai.quantum.compile/1): each pass's counts before and after, its check and verdict, the budget and the bound the passes' distances add to. A result names the engine that made it and this schema (engine and schema); results made before results carried them have neither.", "type": "object", "required": [ "request", "result" ], "properties": { "request": { "type": "object", "description": "The program and the compile's options, as given.", "required": [ "qasm" ], "properties": { "qasm": { "type": "string" }, "epsilon": { "type": "number" }, "level": { "type": "integer" }, "basis": { "type": "string" }, "stages": { "type": "boolean" }, "twirl": { "description": "Twirl each two-qubit Clifford gate with Paulis drawn from a seeded stream: true (seed 1), or {\"seed\": N}. One seed is one instance, checked to be the same circuit.", "anyOf": [ { "type": "boolean" }, { "type": "object", "required": [ "seed" ], "properties": { "seed": { "type": "integer", "minimum": 0 } } } ] }, "dd": { "description": "Dynamical decoupling in each window where a qubit idles long enough: xx or xy4 (or {\"sequence\": …}), checked to change nothing without noise.", "anyOf": [ { "enum": [ "xx", "xy4" ] }, { "type": "boolean" }, { "type": "object", "properties": { "sequence": { "enum": [ "xx", "xy4" ] } } } ] } } }, "result": { "type": "object", "required": [ "ok", "options", "qasm", "certificate" ], "properties": { "engine": { "type": "object", "description": "The engine that made the result: the wai-quantum crate's name and version.", "required": [ "name", "version" ], "properties": { "name": { "const": "wai-quantum" }, "version": { "type": "string" } } }, "schema": { "const": "wai.quantum.compile-result/1" }, "ok": { "const": true }, "options": { "type": "object", "description": "The options the compile ran with, the defaults filled in.", "required": [ "epsilon", "level", "basis" ], "properties": { "epsilon": { "type": "number" }, "level": { "type": "integer" }, "basis": { "enum": [ "clifford_t", "standard" ] }, "twirl": { "type": "object", "properties": { "seed": { "type": "integer", "minimum": 0 } }, "description": "The twirl pass's seed." }, "dd": { "enum": [ "xx", "xy4" ], "description": "The decoupling pass's sequence." } } }, "qasm": { "type": "string", "description": "The compiled program, as OpenQASM 3." }, "certificate": { "type": "object", "description": "What the compile did and how each step was checked. Hashes are BLAKE3, in hex, of the program as read (written out as OpenQASM 3) and of the output text.", "required": [ "format", "basis", "level", "source", "output", "epsilon", "passes", "verdict" ], "properties": { "format": { "const": "wai.quantum.compile/1" }, "basis": { "enum": [ "clifford_t", "standard" ] }, "level": { "type": "integer" }, "source": { "type": "object", "properties": { "hash": { "type": "string" }, "qubits": { "type": "integer" }, "counts": { "type": "object", "description": "A circuit's counts, as the compiler counts them.", "properties": { "gates": { "type": "integer", "minimum": 0 }, "one_qubit": { "type": "integer", "minimum": 0 }, "two_qubit": { "type": "integer", "minimum": 0 }, "three_qubit": { "type": "integer", "minimum": 0 }, "cnots": { "type": "integer", "minimum": 0 }, "t_count": { "type": "integer", "minimum": 0 }, "rotations": { "type": "integer", "minimum": 0 }, "depth": { "type": "integer", "minimum": 0 } } } } }, "output": { "type": "object", "properties": { "hash": { "type": "string" }, "counts": { "type": "object", "description": "A circuit's counts, as the compiler counts them.", "properties": { "gates": { "type": "integer", "minimum": 0 }, "one_qubit": { "type": "integer", "minimum": 0 }, "two_qubit": { "type": "integer", "minimum": 0 }, "three_qubit": { "type": "integer", "minimum": 0 }, "cnots": { "type": "integer", "minimum": 0 }, "t_count": { "type": "integer", "minimum": 0 }, "rotations": { "type": "integer", "minimum": 0 }, "depth": { "type": "integer", "minimum": 0 } } } } }, "epsilon": { "type": "object", "description": "The budget, the bound the passes' distances add to, and how the budget was shared among the rotations.", "properties": { "budget": { "type": "number" }, "bound": { "type": "number" }, "rotations": { "type": "integer" }, "each": { "type": "number" } } }, "passes": { "type": "array", "description": "Each pass: its name, the counts before and after, and its check (how, the verdict, and its distance where it has one).", "items": { "type": "object", "required": [ "pass", "check" ], "properties": { "pass": { "type": "string" }, "before": { "type": "object", "description": "A circuit's counts, as the compiler counts them.", "properties": { "gates": { "type": "integer", "minimum": 0 }, "one_qubit": { "type": "integer", "minimum": 0 }, "two_qubit": { "type": "integer", "minimum": 0 }, "three_qubit": { "type": "integer", "minimum": 0 }, "cnots": { "type": "integer", "minimum": 0 }, "t_count": { "type": "integer", "minimum": 0 }, "rotations": { "type": "integer", "minimum": 0 }, "depth": { "type": "integer", "minimum": 0 } } }, "after": { "type": "object", "description": "A circuit's counts, as the compiler counts them.", "properties": { "gates": { "type": "integer", "minimum": 0 }, "one_qubit": { "type": "integer", "minimum": 0 }, "two_qubit": { "type": "integer", "minimum": 0 }, "three_qubit": { "type": "integer", "minimum": 0 }, "cnots": { "type": "integer", "minimum": 0 }, "t_count": { "type": "integer", "minimum": 0 }, "rotations": { "type": "integer", "minimum": 0 }, "depth": { "type": "integer", "minimum": 0 } } }, "check": { "type": "object" } } } }, "rotations": { "type": "array", "items": { "type": "object" }, "description": "Each rotation written as a Clifford+T word: its angle, its T count, its distance." }, "whole": { "type": "object", "description": "The check of the whole output against the whole program, where it was made." }, "verdict": { "type": "string", "description": "proof, exact or approximate." }, "reading": { "type": "string", "description": "What the certificate says of the output, in words." } } }, "stages": { "type": "array", "description": "With stages: the circuit after each pass.", "items": { "type": "object", "required": [ "pass", "qasm" ], "properties": { "pass": { "type": "string" }, "qasm": { "type": "string" } } } }, "receipt": { "title": "wai.quantum.receipt/2", "description": "A result's receipt: an Ed25519 signature, by the key it names, over digest = BLAKE3(\"wai:quantum-service-receipt\\x02\" ‖ len ‖ request ‖ len ‖ result), each of request and result in its RFC 8785 canonical text (the result without its receipt member), each length 8 bytes big-endian. Whatever members the request and the result hold are sealed, the result's engine and schema among them. The first receipts (no canon member, $defs/first) signed serde_json's own text under the domain ending \\x01; they still verify.", "type": "object", "required": [ "alg", "canon", "key", "digest", "signature" ], "properties": { "alg": { "const": "ed25519" }, "canon": { "const": "rfc8785", "description": "The canonical form the digest is taken over." }, "key": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The signing key, 32 bytes in hex." }, "digest": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The digest signed, 32 bytes in hex." }, "signature": { "type": "string", "minLength": 128, "maxLength": 128, "description": "The signature, 64 bytes in hex." } } } } }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } } } }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } } } } ], "required": [ "verdict" ] } }, { "name": "estimate_resources", "title": "Estimate a program's fault-tolerant resources", "description": "What a fault-tolerant quantum computer would need to run a program. First its logical counts: T gates, Toffolis, rotations (each costed at the T count of its own synthesised Clifford+T word, within its share of the budget), measurements, T depth and total depth, and logical qubits with the ancillas that gates under several controls need. Then, on a physical qubit, the planar model's code distance (the gate-based surface code's model fitted to this engine's own decoders), T factories, physical qubits and runtime, and the frontier of estimates trading qubits for time. Takes a program, or a logical-counts or routine document. Every estimate is sealed in the resource-estimate receipt family, binding the program's digest and the ε budget; the answer's notes state the model's assumptions. Quote the figures with the qubit and the budget, and call them an estimate. Sealed with this user's key; verify_quantum_result checks the seals and re-runs it.", "inputSchema": { "type": "object", "properties": { "qasm": { "type": "string", "description": "The program, OpenQASM 3 or 2, or a generator (integer input, const, for loops) with its values in \"inputs\"." }, "inputs": { "type": "object", "additionalProperties": { "type": "integer" }, "description": "Values for a generator's integer inputs, as {\"n\": 5}: the program is read as its family's circuit at those values." }, "counts": { "type": "object", "description": "A logical-counts document instead of a program: numQubits, tCount, rotationCount, rotationDepth, cczCount, ccixCount, measurementCount." }, "routine": { "type": "object", "description": "A routine document instead of a program (version v1: routines with their ports, resources, children and connections)." }, "budget": { "type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 1, "description": "The probability the run may fail, shared by logical errors, distillation and the rotations' synthesis (default 1e-3)." }, "qubit": { "anyOf": [ { "type": "string", "enum": [ "us-e3", "us-e4", "ns-e3", "ns-e4", "meas-e4", "meas-e6" ] }, { "type": "object", "properties": { "name": { "type": "string" }, "instruction_set": { "type": "string", "enum": [ "gate", "measurement" ] }, "gate_ns": { "type": "number" }, "meas_ns": { "type": "number" }, "clifford_error": { "type": "number" }, "t_error": { "type": "number" } } } ], "description": "The physical qubit: a reference qubit (ns-e4, the default: 50 ns gates, 1e-4 error; us-* are 100 µs gates, meas-* measurement-based), or one described." }, "calibration": { "type": "string", "enum": [ "exact_matching", "union_find", "assumed" ], "description": "The gate-based surface code's model: fitted to this engine's exact-matching decoder (default) or its union-find decoder, or the planar model's assumed one." }, "max_slowdown": { "type": "integer", "minimum": 1, "maximum": 4096, "description": "The most the frontier slows the program by to need fewer factories (default 256)." }, "export": { "type": "string", "enum": [ "counts", "routine" ], "description": "Also give the program's counts as a logical-counts or a routine document, under export." }, "name": { "type": "string", "description": "The program's name in a routine document." } } }, "outputSchema": { "$id": "wai-quantum://schemas/estimate_resources/1", "type": "object", "description": "A resource estimate as a host returns it (the command line's estimate --json, both servers' estimate_resources, the job service's POST /v1/estimate): the request, and the result, which its receipt seals in a job's form. The result holds the program's logical counts, the error budget and how it was shared, the decoder calibration the physical model uses, the headline estimate and the frontier trading physical qubits for runtime, each estimate sealed in the resource-estimate receipt family (the frontier's naming the headline's as parent), and the model's notes. A result names the engine that made it and this schema (engine and schema); results made before results carried them have neither. docs/estimate.md explains every number.", "anyOf": [ { "title": "wai.quantum.estimate/1", "description": "A resource estimate as a host returns it (the command line's estimate --json, both servers' estimate_resources, the job service's POST /v1/estimate): the request, and the result, which its receipt seals in a job's form. The result holds the program's logical counts, the error budget and how it was shared, the decoder calibration the physical model uses, the headline estimate and the frontier trading physical qubits for runtime, each estimate sealed in the resource-estimate receipt family (the frontier's naming the headline's as parent), and the model's notes. A result names the engine that made it and this schema (engine and schema); results made before results carried them have neither. docs/estimate.md explains every number.", "type": "object", "required": [ "request", "result" ], "properties": { "request": { "type": "object", "description": "A program (qasm), a logical-counts document (counts) or a routine document (routine), with the estimate's options, as given.", "properties": { "qasm": { "type": "string" }, "counts": { "type": "object" }, "routine": { "type": "object" }, "inputs": { "type": "object", "additionalProperties": { "type": "integer" } }, "budget": { "type": "number" }, "qubit": { "type": [ "string", "object" ] }, "calibration": { "type": "string" }, "max_slowdown": { "type": "integer" }, "export": { "enum": [ "counts", "routine" ] }, "name": { "type": "string" } } }, "result": { "type": "object", "required": [ "ok", "format", "program", "counts", "epsilon", "options", "estimate", "frontier" ], "properties": { "engine": { "type": "object", "description": "The engine that made the result: the wai-quantum crate's name and version.", "required": [ "name", "version" ], "properties": { "name": { "const": "wai-quantum" }, "version": { "type": "string" } } }, "schema": { "const": "wai.quantum.estimate/1" }, "ok": { "const": true }, "format": { "const": "wai.quantum.estimate/1" }, "program": { "type": "object", "description": "What was estimated: a circuit (its digest, BLAKE3 of the program's text), or a document's counts.", "properties": { "origin": { "enum": [ "circuit", "counts", "routine" ] }, "digest": { "type": "string" }, "qubits": { "type": "integer" }, "bound": { "type": "string" }, "name": { "type": "string" } } }, "counts": { "type": "object", "description": "The program's logical counts: qubits and ancillas, measurements, Clifford gates, T gates, Toffolis, rotations (each costed at its own synthesised word's T count), T states, depths.", "additionalProperties": { "type": [ "integer", "number", "string", "null", "array" ] } }, "epsilon": { "type": "object", "description": "The error budget, the synthesis share and each rotation's share, the bound the rotations' distances add to, and their T counts.", "properties": { "budget": { "type": [ "number", "null" ] }, "synthesis": { "type": [ "number", "null" ] }, "each": { "type": [ "number", "null" ] }, "rotations": { "type": [ "integer", "null" ] }, "angles": { "type": [ "integer", "null" ] }, "bound": { "type": [ "number", "null" ] }, "t_per_rotation": { "type": [ "object", "null" ] } } }, "calibration": { "type": "object", "description": "The decoder calibration the physical model uses: the decoder, the experiment, the fit, its measured range, and how to reproduce it." }, "options": { "type": "object", "description": "The options the estimate ran with, the defaults filled in." }, "estimate": { "type": "object", "description": "One estimate on a physical qubit: the code and its distance, the slowdown, physical qubits (the algorithm's and the factories'), factories, runtime, logical steps and their length, tiles, the logical error, T states, and how the budget was shared; sealed by its resource-estimate receipt (receipt), or marked the headline.", "properties": { "qubit": { "type": "string" }, "code": { "type": "string" }, "distance": { "type": "integer" }, "slowdown": { "type": "integer" }, "physical_qubits": { "type": "integer" }, "algorithm_qubits": { "type": "integer" }, "factory_qubits": { "type": "integer" }, "factories": { "type": "integer" }, "factory_fraction": { "type": "number" }, "runtime_s": { "type": "number" }, "steps": { "type": "integer" }, "step_us": { "type": "number" }, "tiles": { "type": "integer" }, "tile_qubits": { "type": "integer" }, "logical_error": { "type": "number" }, "t_states": { "type": "integer" }, "t_target": { "type": "number" }, "budget": { "type": "object", "properties": { "logical": { "type": "number" }, "distillation": { "type": "number" }, "synthesis": { "type": "number" } } }, "factory": { "type": [ "object", "null" ] }, "headline": { "type": "boolean" }, "receipt": { "type": "object", "description": "A receipt of the resource-estimate family: the estimate, the hashes of its job and its result, its Merkle root, its signer and signature, and the receipt it names as parent.", "required": [ "kind", "receipt_hash", "sig", "signer_pubkey" ], "properties": { "kind": { "const": "quantum-resource" }, "estimate": { "type": "object" }, "job_hash": { "type": "string" }, "joules_micro": { "type": "integer" }, "parent_receipt_hash": { "type": [ "string", "null" ] }, "receipt_hash": { "type": "string" }, "result_hash": { "type": "string" }, "root_hash": { "type": "string" }, "sig": { "type": "string" }, "signer_id": { "type": "string" }, "signer_pubkey": { "type": "string" }, "energy_provenance": { "type": "string" }, "energy_uncertainty": { "type": "object" } } } } }, "frontier": { "type": "array", "items": { "type": "object", "description": "One estimate on a physical qubit: the code and its distance, the slowdown, physical qubits (the algorithm's and the factories'), factories, runtime, logical steps and their length, tiles, the logical error, T states, and how the budget was shared; sealed by its resource-estimate receipt (receipt), or marked the headline.", "properties": { "qubit": { "type": "string" }, "code": { "type": "string" }, "distance": { "type": "integer" }, "slowdown": { "type": "integer" }, "physical_qubits": { "type": "integer" }, "algorithm_qubits": { "type": "integer" }, "factory_qubits": { "type": "integer" }, "factories": { "type": "integer" }, "factory_fraction": { "type": "number" }, "runtime_s": { "type": "number" }, "steps": { "type": "integer" }, "step_us": { "type": "number" }, "tiles": { "type": "integer" }, "tile_qubits": { "type": "integer" }, "logical_error": { "type": "number" }, "t_states": { "type": "integer" }, "t_target": { "type": "number" }, "budget": { "type": "object", "properties": { "logical": { "type": "number" }, "distillation": { "type": "number" }, "synthesis": { "type": "number" } } }, "factory": { "type": [ "object", "null" ] }, "headline": { "type": "boolean" }, "receipt": { "type": "object", "description": "A receipt of the resource-estimate family: the estimate, the hashes of its job and its result, its Merkle root, its signer and signature, and the receipt it names as parent.", "required": [ "kind", "receipt_hash", "sig", "signer_pubkey" ], "properties": { "kind": { "const": "quantum-resource" }, "estimate": { "type": "object" }, "job_hash": { "type": "string" }, "joules_micro": { "type": "integer" }, "parent_receipt_hash": { "type": [ "string", "null" ] }, "receipt_hash": { "type": "string" }, "result_hash": { "type": "string" }, "root_hash": { "type": "string" }, "sig": { "type": "string" }, "signer_id": { "type": "string" }, "signer_pubkey": { "type": "string" }, "energy_provenance": { "type": "string" }, "energy_uncertainty": { "type": "object" } } } } }, "description": "Estimates no other beats on both physical qubits and runtime; the headline among them." }, "notes": { "type": "array", "items": { "type": "string" }, "description": "The model's assumptions." }, "rotations": { "type": "array", "items": { "type": "object" }, "description": "Each distinct rotation angle: how many there are, its T count, gates and distance." }, "export": { "type": "object", "description": "With export: the program's counts as a logical-counts or a routine document." }, "receipt": { "title": "wai.quantum.receipt/2", "description": "A result's receipt: an Ed25519 signature, by the key it names, over digest = BLAKE3(\"wai:quantum-service-receipt\\x02\" ‖ len ‖ request ‖ len ‖ result), each of request and result in its RFC 8785 canonical text (the result without its receipt member), each length 8 bytes big-endian. Whatever members the request and the result hold are sealed, the result's engine and schema among them. The first receipts (no canon member, $defs/first) signed serde_json's own text under the domain ending \\x01; they still verify.", "type": "object", "required": [ "alg", "canon", "key", "digest", "signature" ], "properties": { "alg": { "const": "ed25519" }, "canon": { "const": "rfc8785", "description": "The canonical form the digest is taken over." }, "key": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The signing key, 32 bytes in hex." }, "digest": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The digest signed, 32 bytes in hex." }, "signature": { "type": "string", "minLength": 128, "maxLength": 128, "description": "The signature, 64 bytes in hex." } } } } } } }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } } ] } }, { "name": "draw_circuit", "title": "Draw a circuit", "description": "A program's circuit: as text (one wire per qubit, controls as ●, targets as ⊕, measurements as M with their bit), or with format svg as a standalone SVG image (the Studio's picture), latex as one picture in plain TikZ (it needs only \\usepackage{tikz}), or description as the circuit in words, column by column, as a screen reader reads it. The answer's key is the format's name.", "inputSchema": { "type": "object", "required": [ "qasm" ], "properties": { "qasm": { "type": "string", "description": "The program, OpenQASM 3 or 2, or a generator (integer input, const, for loops) with its values in \"inputs\"." }, "inputs": { "type": "object", "additionalProperties": { "type": "integer" }, "description": "Values for a generator's integer inputs, as {\"n\": 5}: the program is read as its family's circuit at those values." }, "width": { "type": "integer", "minimum": 20, "description": "Wrap the text at this many columns (default 100)." }, "format": { "type": "string", "enum": [ "text", "svg", "latex", "description" ], "description": "text (the default), svg, latex or description." } } }, "outputSchema": { "$id": "wai-quantum://schemas/draw_circuit/1", "type": "object", "description": "A program's circuit: as text (one wire per qubit), a standalone SVG drawing, a LaTeX (TikZ) picture, or a description in words for a screen reader, as asked.", "anyOf": [ { "type": "object", "description": "A program's circuit: as text (one wire per qubit), a standalone SVG drawing, a LaTeX (TikZ) picture, or a description in words for a screen reader, as asked.", "properties": { "text": { "type": "string" }, "svg": { "type": "string" }, "latex": { "type": "string" }, "description": { "type": "string" }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } } } }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } } } } ], "required": [ "verdict" ] } }, { "name": "debug_step", "title": "Step through a program and look into its state", "description": "The state of a program at one point, from the engine's debugger, which steps it one gate, measurement or reset at a time on the bit-exact or double-precision state vector, or under noise the density matrix beside its noiseless state. Stop at position `to` (the steps taken, or \"end\") or before the first step on `line`; each measurement on the way takes the next of `outcomes` (0 or 1, in the order the path meets them), else the likelier. The answer: the next and last steps with their lines, each measurement's outcome and probability, the path's weight, the classical bits, the amplitudes with their phases (or the probabilities of a mixed state), each qubit's Bloch vector and purity, the reduced density matrix of probe.qubits, and the entanglement across probe.cut (default the first half). Every number is computed by the engine: quote them. Read-only and deterministic. Refused past 16 qubits, or 8 under noise.", "inputSchema": { "type": "object", "required": [ "qasm" ], "properties": { "qasm": { "type": "string", "description": "The program, OpenQASM 3 or 2, or a generator (integer input, const, for loops) with its values in \"inputs\"." }, "inputs": { "type": "object", "additionalProperties": { "type": "integer" }, "description": "Values for a generator's integer inputs, as {\"n\": 5}: the program is read as its family's circuit at those values." }, "to": { "description": "The position to stop at: a number of steps, or \"end\". The start when neither this nor line is given." }, "line": { "type": "integer", "minimum": 1, "description": "Stop before the first step on this line of the program." }, "outcomes": { "type": "array", "items": { "type": "integer", "minimum": 0, "maximum": 1 }, "description": "The outcome of each measurement (and reset, without noise) the path meets, in order: a recorded path, replayed. An outcome the state cannot give is refused." }, "method": { "type": "string", "enum": [ "auto", "exact", "statevector", "density_matrix" ], "description": "auto (the default): the density matrix under noise, else the bit-exact state vector when every angle is a dyadic multiple of 2π, else double precision." }, "noise": { "type": "object", "description": "Channel probabilities, as a job takes them: the density matrix steps the noisy state.", "properties": { "depolarizing_1q": { "type": "number", "minimum": 0, "maximum": 1 }, "depolarizing_2q": { "type": "number", "minimum": 0, "maximum": 1 }, "amplitude_damping": { "type": "number", "minimum": 0, "maximum": 1 }, "dephasing": { "type": "number", "minimum": 0, "maximum": 1 }, "readout": { "type": "number", "minimum": 0, "maximum": 1 } }, "additionalProperties": false }, "probe": { "type": "object", "description": "What to look at: qubits (the reduced density matrix of these, at most 6), cut (one side of the cut to measure entanglement across), top (the most amplitudes listed, default 64).", "properties": { "qubits": { "type": "array", "items": { "type": "integer" } }, "cut": { "type": "array", "items": { "type": "integer" } }, "top": { "type": "integer", "minimum": 1 } } }, "length": { "type": "boolean", "description": "Also the number of positions on the path." }, "outline": { "type": "boolean", "description": "Also every step of the program as written, each with its line." } } }, "annotations": { "readOnlyHint": true, "idempotentHint": true, "openWorldHint": false }, "outputSchema": { "$id": "wai-quantum://schemas/debug_step/1", "type": "object", "description": "The engine's state at one point of a program's path: where it is, the measurements decided on the way and their weight, each qubit's Bloch vector, a reduced state and an entanglement measure when asked, and the state's digest and amplitudes.", "anyOf": [ { "type": "object", "description": "The engine's state at one point of a program's path: where it is, the measurements decided on the way and their weight, each qubit's Bloch vector, a reduced state and an entanglement measure when asked, and the state's digest and amplitudes.", "required": [ "ok", "method", "position", "at_end", "decisions", "outcomes", "weight", "classical", "state" ], "properties": { "ok": { "const": true }, "method": { "type": "string" }, "accuracy": { "type": "object", "description": "The method's accuracy class and what it promises.", "properties": { "class": { "type": "string" }, "note": { "type": "string" } } }, "qubits": { "type": "integer" }, "bits": { "type": "integer" }, "position": { "type": "integer", "description": "Steps taken from the start." }, "at_end": { "type": "boolean" }, "next": { "type": [ "object", "null" ], "description": "A step of the program: its place, its kind, its line, what it does and on which qubits.", "properties": { "step": { "type": "integer" }, "kind": { "type": "string" }, "op": { "type": "integer" }, "line": { "type": [ "integer", "null" ] }, "label": { "type": "string" }, "qubits": { "type": "array", "items": { "type": "integer" } }, "bit": { "type": "integer" }, "final": { "type": "boolean" } } }, "last": { "type": [ "object", "null" ], "description": "A step of the program: its place, its kind, its line, what it does and on which qubits.", "properties": { "step": { "type": "integer" }, "kind": { "type": "string" }, "op": { "type": "integer" }, "line": { "type": [ "integer", "null" ] }, "label": { "type": "string" }, "qubits": { "type": "array", "items": { "type": "integer" } }, "bit": { "type": "integer" }, "final": { "type": "boolean" } } }, "decisions": { "type": "array", "items": { "type": "object", "properties": { "position": { "type": "integer" }, "step": { "type": "integer" }, "kind": { "type": "string" }, "line": { "type": [ "integer", "null" ] }, "qubit": { "type": "integer" }, "bit": { "type": [ "integer", "null" ] }, "outcome": { "type": "integer" }, "p": { "type": "number" }, "by": { "type": "string" } } } }, "outcomes": { "type": "array", "items": { "type": "integer", "minimum": 0, "maximum": 1 } }, "weight": { "type": "number", "description": "The path's probability so far." }, "classical": { "type": "string", "description": "The classical bits so far, the highest first." }, "bloch": { "type": "array", "items": { "type": "object", "properties": { "qubit": { "type": "integer" }, "x": { "type": "number" }, "y": { "type": "number" }, "z": { "type": "number" }, "length": { "type": "number" }, "purity": { "type": "number" }, "p1": { "type": "number" } } } }, "reduced": { "type": "object", "description": "The reduced state of the qubits asked for: its density matrix, purity and entropy." }, "entanglement": { "type": "object", "description": "An entanglement measure across a cut: the entropy of a pure state, or the logarithmic negativity of a mixed one." }, "ideal": { "type": "object", "description": "With noise: the same path without it, and the noisy state's fidelity to it." }, "state": { "type": "object", "properties": { "digest": { "type": "string" }, "norm": { "type": "number" }, "purity": { "type": "number" }, "nonzero": { "type": "integer" }, "of": { "type": "integer" }, "amplitudes": { "type": "array", "items": { "type": "object" } }, "probabilities": { "type": "array", "items": { "type": "object" } }, "trace": { "type": "number", "description": "With noise: the density matrix's trace." } } }, "length": { "type": "integer", "description": "With length: the steps in the path." }, "outline": { "type": "array", "description": "With outline: every step, in order.", "items": { "type": "object" } } } }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } } ] } }, { "name": "debug_branches", "title": "Every branch of a program's measurements", "description": "Every outcome of every measurement in the middle of a program (and reset, without noise), as a tree, from the engine's debugger: each branch with its outcome's probability and the path's weight (exact fractions, from the stabilizer tableau, for a noiseless Clifford program), and each leaf with its path, the outcomes that replay it in debug_step, and the distribution of the final measurements on it. Read-only and deterministic. Refused past 1024 branches.", "inputSchema": { "type": "object", "required": [ "qasm" ], "properties": { "qasm": { "type": "string", "description": "The program, OpenQASM 3 or 2, or a generator (integer input, const, for loops) with its values in \"inputs\"." }, "inputs": { "type": "object", "additionalProperties": { "type": "integer" }, "description": "Values for a generator's integer inputs, as {\"n\": 5}: the program is read as its family's circuit at those values." }, "method": { "type": "string", "enum": [ "auto", "exact", "statevector", "density_matrix" ] }, "noise": { "type": "object", "description": "Channel probabilities, as a job takes them.", "properties": { "depolarizing_1q": { "type": "number", "minimum": 0, "maximum": 1 }, "depolarizing_2q": { "type": "number", "minimum": 0, "maximum": 1 }, "amplitude_damping": { "type": "number", "minimum": 0, "maximum": 1 }, "dephasing": { "type": "number", "minimum": 0, "maximum": 1 }, "readout": { "type": "number", "minimum": 0, "maximum": 1 } }, "additionalProperties": false } } }, "annotations": { "readOnlyHint": true, "idempotentHint": true, "openWorldHint": false }, "outputSchema": { "$id": "wai-quantum://schemas/debug_branches/1", "type": "object", "description": "Every branch of a program at its measurements in the middle, each with its weight (exact for a noiseless Clifford program), and each leaf's path, outcomes and final distribution.", "anyOf": [ { "type": "object", "description": "Every branch of a program at its measurements in the middle, each with its weight (exact for a noiseless Clifford program), and each leaf's path, outcomes and final distribution.", "required": [ "ok", "method", "qubits", "bits", "tree", "leaves", "total_weight" ], "properties": { "ok": { "const": true }, "method": { "type": "string" }, "accuracy": { "type": "object", "description": "The method's accuracy class and what it promises.", "properties": { "class": { "type": "string" }, "note": { "type": "string" } } }, "weights": { "type": "string" }, "qubits": { "type": "integer" }, "bits": { "type": "integer" }, "tree": { "type": [ "object", "null" ], "description": "The tree of branches, from the first measurement; null when there is none." }, "leaves": { "type": "array", "items": { "type": "object", "properties": { "leaf": { "type": "integer" }, "path": { "type": "array", "items": { "type": "object" } }, "outcomes": { "type": "array", "items": { "type": "integer" } }, "weight": { "type": "number" }, "weight_exact": { "type": "string" }, "final": { "type": "array", "items": { "type": "object" } }, "final_outcomes": { "type": "integer" } } } }, "total_weight": { "type": "number" }, "truncated": { "type": "boolean" }, "note": { "type": "string" } } }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } } ] } }, { "name": "verify_quantum_result", "title": "Check a result's receipt", "description": "Whether a job's receipt seals its request and its result, as run_quantum_circuit or the job service returns them, and which key signed it.", "inputSchema": { "type": "object", "required": [ "job" ], "properties": { "job": { "type": "object", "description": "The job: {\"request\": ..., \"result\": ...}, the result carrying its receipt." } } }, "outputSchema": { "$id": "wai-quantum://schemas/verify_quantum_result/1", "type": "object", "description": "Whether a job's receipt seals its request and its result, and the key that signed it; for an estimate, also every estimate's receipt and the request re-run here.", "anyOf": [ { "description": "Whether a job's receipt seals its request and its result, and the key that signed it; for an estimate, also every estimate's receipt and the request re-run here.", "anyOf": [ { "type": "object", "description": "Whether a job's receipt seals its request and its result, and the key that signed it.", "required": [ "valid", "key" ], "properties": { "valid": { "type": "boolean" }, "key": { "type": [ "string", "null" ], "description": "The signing key, 32 bytes in hex." } } }, { "type": "object", "description": "An estimate's check: its seal, every estimate's receipt, and the request re-run here giving the same figures.", "required": [ "valid", "signed", "receipts", "reproduced" ], "properties": { "valid": { "type": "boolean" }, "signed": { "type": "boolean" }, "receipts": { "type": "boolean" }, "reproduced": { "type": "boolean" }, "key": { "type": [ "string", "null" ] }, "signer": { "type": [ "string", "null" ] }, "estimates": { "type": "integer" } } } ] }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } } ] } }, { "name": "discover_evaluate", "title": "Judge a generator against a workbench specification", "description": "The engine's verdict on a generator (an OpenQASM program with integer inputs) against a specification: whether it reads, keeps the specification's gate and connectivity rules, and matches the reference (the same unitary, or the same state from |0…0⟩) at every size; the weakest check it passed (tableau, exact and state decide it; random is evidence); its measures at each size; its cost; and its two axes. Write generators freely: the engine, not you, decides whether one is right.", "inputSchema": { "type": "object", "required": [ "spec", "qasm" ], "properties": { "spec": { "description": "The specification: its JSON, or the path of its file." }, "qasm": { "type": "string", "description": "The generator." } } }, "outputSchema": { "$id": "wai-quantum://schemas/discover_evaluate/1", "type": "object", "description": "The engine's verdict on a generator against a workbench specification.", "anyOf": [ { "type": "object", "description": "The engine's verdict on a generator against a workbench specification.", "required": [ "verified", "sizes" ], "properties": { "verified": { "type": "boolean" }, "strength": { "type": "string", "description": "The weakest check it passed: tableau, exact and state decide it; random is evidence." }, "failure": { "type": "string" }, "sizes": { "type": "array", "items": { "type": "object" } }, "cost": { "type": "number" }, "axes": { "type": "array", "items": { "type": "integer" }, "minItems": 2, "maxItems": 2 }, "aberration": { "type": "object" } } }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } } ] } }, { "name": "discover_submit", "title": "Propose a generator to a workbench archive", "description": "Judge a generator against the specification in a file and keep it in the archive beside it (spec.json → spec.archive.json) if it is verified and the cheapest in its cell of the two axes. A kept generator is sealed with this user's key, with you named as its proposer. Say which entry it came from (parent) and what it tries (note), so its lineage can be read.", "inputSchema": { "type": "object", "required": [ "spec", "qasm" ], "properties": { "spec": { "type": "string", "description": "The specification's path." }, "archive": { "type": "string", "description": "The archive's path, if not beside the specification." }, "qasm": { "type": "string", "description": "The generator." }, "parent": { "type": "string", "description": "The id of the entry it came from." }, "note": { "type": "string", "description": "What it tries, in a sentence." }, "proposer": { "type": "string", "description": "Who wrote it (default \"agent\")." } } }, "outputSchema": { "$id": "wai-quantum://schemas/discover_submit/1", "type": "object", "description": "What the archive did with a generator, and its best entry after.", "anyOf": [ { "type": "object", "description": "What the archive did with a generator, and its best entry after.", "required": [ "outcome", "best" ], "properties": { "outcome": { "type": "object" }, "best": { "type": [ "object", "null" ] } } }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } } ] } }, { "name": "discover_archive", "title": "Read a workbench archive", "description": "An archive's summary: what the searches spent (evaluations, seconds, joules) and found (verified, kept, improvements), the reference, the best, the front of the two axes, and the best of every cell, with its proposer, parent and note. With sources, each cell's generator too, to propose from.", "inputSchema": { "type": "object", "required": [ "spec" ], "properties": { "spec": { "type": "string", "description": "The specification's path." }, "archive": { "type": "string", "description": "The archive's path, if not beside the specification." }, "sources": { "type": "boolean", "description": "Include every cell's generator." } } }, "outputSchema": { "$id": "wai-quantum://schemas/discover_archive/1", "type": "object", "description": "A workbench archive's summary.", "anyOf": [ { "type": "object", "description": "A workbench archive's summary.", "required": [ "spec", "stats", "front", "cells" ], "properties": { "spec": { "type": "string" }, "task": { "type": "string" }, "axes": { "type": "array" }, "stats": { "type": "object" }, "joules_per_improvement": { "type": [ "number", "null" ] }, "reference": { "type": [ "object", "null" ] }, "best": { "type": [ "object", "null" ] }, "front": { "type": "array", "items": { "type": "object" } }, "cells": { "type": "array", "items": { "type": "object" } }, "sources": { "type": "object", "additionalProperties": { "type": "string" } } } }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } } ] } }, { "name": "novelty_qasm", "title": "What is new in a program", "description": "A program's structural distance to the known constructions (GHZ by a chain, by doubling and by fan-out; the uniform superposition; the quantum Fourier transform) and to programs you give, the nearest named; each known construction the engine proves it to be (the same state, or the same circuit), and whether by a different route, which is worth a second look; and, with a reference, the measures it beats the reference on that the cost (weighed) does not count. A high distance is a reason to look, not a claim that nobody has built it.", "inputSchema": { "type": "object", "required": [ "qasm" ], "properties": { "qasm": { "type": "string", "description": "The program, or a generator with its values in inputs." }, "inputs": { "type": "object", "additionalProperties": { "type": "integer" }, "description": "Values for a generator's integer inputs, as {\"n\": 5}: the program is read as its family's circuit at those values." }, "against": { "type": "array", "items": { "type": "object", "required": [ "name", "qasm" ], "properties": { "name": { "type": "string" }, "qasm": { "type": "string" } } }, "description": "More programs to compare with." }, "reference": { "type": "string", "description": "The program it is meant to improve on." }, "weighed": { "type": "array", "items": { "type": "string" }, "description": "The measures the cost weighs." } } }, "outputSchema": { "$id": "wai-quantum://schemas/novelty_qasm/1", "type": "object", "description": "A program's structural distance to the known constructions and to programs given, each known construction it is found to be, and the measures it beats a reference on that the cost does not weigh.", "anyOf": [ { "description": "A program's structural distance to the known constructions and to programs given, each known construction it is found to be, and the measures it beats a reference on that the cost does not weigh.", "anyOf": [ { "type": "object", "required": [ "ok", "compared", "nearest", "rediscovers" ], "properties": { "ok": { "const": true }, "qubits": { "type": "integer" }, "compared": { "type": "integer" }, "nearest": { "anyOf": [ { "type": "null" }, { "type": "object", "required": [ "name", "distance" ], "properties": { "name": { "type": "string" }, "distance": { "type": "number" } } } ] }, "novelty": { "type": [ "number", "null" ] }, "rediscovers": { "type": "array", "items": { "type": "object", "required": [ "name", "route", "distance" ], "properties": { "name": { "type": "string" }, "route": { "type": "string" }, "distance": { "type": "number" }, "how": { "type": [ "string", "null" ] }, "prepares": { "type": "boolean" } } } }, "unasked": { "type": "array", "items": { "type": "object", "required": [ "measure", "candidate", "reference" ], "properties": { "measure": { "type": "string" }, "candidate": { "type": "number" }, "reference": { "type": "number" } } } }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } } } }, { "type": "object", "description": "A program that does not read: the problem, and its line, its diagnostic code, column and length when the reader names them.", "required": [ "ok", "error" ], "properties": { "ok": { "const": false }, "error": { "type": "string" }, "line": { "type": [ "integer", "null" ] }, "code": { "type": "string", "description": "The reader's diagnostic code, as Q103; qasm_diagnostics says what each means." }, "column": { "type": "integer", "minimum": 1, "description": "Where the problem starts on its line, in characters from 1." }, "length": { "type": "integer", "minimum": 0, "description": "Its length on that line, in characters." }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } } } } ] }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } } } } ], "required": [ "verdict" ] } }, { "name": "discover_novelty", "title": "What is new in a workbench entry", "description": "For one entry of a workbench archive, read at the specification's largest size: its nearest known construction or elite and the distance, each known construction it is found to be (and whether by a different route), and the measures it beats the reference on that the specification's cost does not weigh.", "inputSchema": { "type": "object", "required": [ "spec", "id" ], "properties": { "spec": { "type": "string", "description": "The specification's path." }, "archive": { "type": "string", "description": "The archive's path, if not beside the specification." }, "id": { "type": "string", "description": "The entry's id." } } }, "outputSchema": { "$id": "wai-quantum://schemas/discover_novelty/1", "type": "object", "description": "What is new in one entry of a workbench archive, read at the specification's largest size.", "anyOf": [ { "description": "What is new in one entry of a workbench archive, read at the specification's largest size.", "anyOf": [ { "type": "object", "required": [ "ok", "entry", "compared", "nearest", "rediscovers" ], "properties": { "ok": { "const": true }, "qubits": { "type": "integer" }, "compared": { "type": "integer" }, "nearest": { "anyOf": [ { "type": "null" }, { "type": "object", "required": [ "name", "distance" ], "properties": { "name": { "type": "string" }, "distance": { "type": "number" } } } ] }, "novelty": { "type": [ "number", "null" ] }, "rediscovers": { "type": "array", "items": { "type": "object", "required": [ "name", "route", "distance" ], "properties": { "name": { "type": "string" }, "route": { "type": "string" }, "distance": { "type": "number" }, "how": { "type": [ "string", "null" ] }, "prepares": { "type": "boolean" } } } }, "unasked": { "type": "array", "items": { "type": "object", "required": [ "measure", "candidate", "reference" ], "properties": { "measure": { "type": "string" }, "candidate": { "type": "number" }, "reference": { "type": "number" } } } }, "entry": { "type": "string", "description": "The entry's id." }, "inputs": { "type": "object", "additionalProperties": { "type": "integer" }, "description": "The specification's largest size, at which it was read." } } }, { "type": "object", "description": "A program that does not read: the problem, and its line, its diagnostic code, column and length when the reader names them.", "required": [ "ok", "error" ], "properties": { "ok": { "const": false }, "error": { "type": "string" }, "line": { "type": [ "integer", "null" ] }, "code": { "type": "string", "description": "The reader's diagnostic code, as Q103; qasm_diagnostics says what each means." }, "column": { "type": "integer", "minimum": 1, "description": "Where the problem starts on its line, in characters from 1." }, "length": { "type": "integer", "minimum": 0, "description": "Its length on that line, in characters." } } } ] }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } } ] } }, { "name": "rewrite_qasm", "title": "Rewrite a program, each step checked", "description": "Rewrites that keep a program's meaning, each checked by the engine on the qubits it touches (a gate and its inverse cancel, rotations merge, Hadamards conjugate, a gate is carried past what it commutes with, two gates that commute trade places). op options: every rewrite the program admits, each an edit to its own lines with its id; apply: the program with the rewrite `id` made; simplify: every rewrite to a fixed point, each step in words; explain: how the program becomes `other`, as a chain of rewrites. Use explain to show the person why an optimisation is the same circuit.", "inputSchema": { "type": "object", "required": [ "qasm", "op" ], "properties": { "qasm": { "type": "string" }, "op": { "type": "string", "enum": [ "options", "apply", "simplify", "explain" ] }, "id": { "type": "string", "description": "For apply: a rewrite's id from options." }, "other": { "type": "string", "description": "For explain: the program it should become." }, "inputs": { "type": "object", "additionalProperties": { "type": "integer" }, "description": "Values for a generator's integer inputs, as {\"n\": 5}: the program is read as its family's circuit at those values." } } }, "outputSchema": { "$id": "wai-quantum://schemas/rewrite_qasm/1", "type": "object", "description": "The rewrites: options (each rewrite the program admits), apply (the program with one made), simplify (every rewrite to a fixed point), prove (two programs equal by rewrites) or explain (how one program becomes another).", "anyOf": [ { "description": "The rewrites: options (each rewrite the program admits), apply (the program with one made), simplify (every rewrite to a fixed point), prove (two programs equal by rewrites) or explain (how one program becomes another).", "anyOf": [ { "type": "object", "required": [ "ok", "options" ], "properties": { "ok": { "const": true }, "options": { "type": "array", "items": { "type": "object", "required": [ "id", "rule", "why", "result" ], "properties": { "id": { "type": "string" }, "rule": { "type": "string" }, "why": { "type": "string" }, "gates": { "type": "array", "items": { "type": "integer" } }, "lines": { "type": "array", "items": { "type": "integer" } }, "result": { "type": "string" } } } }, "note": { "type": "string" }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } } } }, { "type": "object", "required": [ "ok", "unread" ], "properties": { "ok": { "const": false }, "unread": { "type": "string" }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } } } }, { "type": "object", "required": [ "result", "why" ], "properties": { "result": { "type": "string" }, "why": { "type": "string" }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } } } }, { "type": "object", "required": [ "steps", "gates", "result" ], "properties": { "steps": { "type": "array", "items": { "type": "object", "required": [ "rule", "why" ], "properties": { "rule": { "type": "string" }, "why": { "type": "string" } } } }, "gates": { "type": "array", "items": { "type": "integer" }, "minItems": 2, "maxItems": 2 }, "result": { "type": "string" }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } } } }, { "type": "object", "description": "prove: whether checked rewrites take the first followed by the second's inverse to nothing.", "required": [ "verdict", "how", "why" ], "properties": { "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } }, "how": { "const": "rewrites" }, "why": { "type": "string" }, "steps": { "type": "integer" } } }, { "type": "object", "required": [ "ok", "found", "a_steps", "b_steps" ], "properties": { "ok": { "const": true }, "found": { "type": "boolean" }, "reordered": { "type": "boolean" }, "a_steps": { "type": "array", "items": { "type": "object", "required": [ "rule", "why" ], "properties": { "rule": { "type": "string" }, "why": { "type": "string" } } } }, "b_steps": { "type": "array", "items": { "type": "object", "required": [ "rule", "why" ], "properties": { "rule": { "type": "string" }, "why": { "type": "string" } } } }, "gates": { "type": "array", "items": { "type": "integer" } }, "form": { "type": "integer" }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } } } } ] }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } } } } ], "required": [ "verdict" ] } }, { "name": "converge_cohort", "title": "How diverse a set of programs is", "description": "For programs written for one task (a group's, or one person's over time): the Vendi score (the effective number of distinct designs, from 1 when all are built alike to the number of programs), each one's structural distance to the centroid, the medoid and the one built least like the rest, and with times (milliseconds) the score in windows over time and whether it narrows. Use it before proposing, to see whether your proposals would narrow what the person has made.", "inputSchema": { "type": "object", "required": [ "programs" ], "properties": { "programs": { "type": "array", "items": { "type": "object", "required": [ "name", "qasm" ], "properties": { "name": { "type": "string" }, "qasm": { "type": "string" }, "at": { "type": "integer" } } } }, "inputs": { "type": "object", "additionalProperties": { "type": "integer" }, "description": "Values for a generator's integer inputs, as {\"n\": 5}: the program is read as its family's circuit at those values." }, "windows": { "type": "integer" } } }, "outputSchema": { "$id": "wai-quantum://schemas/converge_cohort/1", "type": "object", "description": "How diverse a set of programs is: the Vendi score (the effective number of distinct designs), each one's distance to the centroid, the medoid and the outlier, and with times, the score in windows over time.", "anyOf": [ { "type": "object", "description": "How diverse a set of programs is: the Vendi score (the effective number of distinct designs), each one's distance to the centroid, the medoid and the outlier, and with times, the score in windows over time.", "required": [ "programs", "vendi", "share", "centroid", "medoid", "outlier" ], "properties": { "programs": { "type": "integer" }, "vendi": { "type": "number" }, "share": { "type": "number", "description": "The Vendi score over the number of programs." }, "mean_distance": { "type": "number" }, "centroid": { "type": "array", "items": { "type": "object", "required": [ "name", "distance" ], "properties": { "name": { "type": "string" }, "distance": { "type": "number" } } } }, "medoid": { "type": "string" }, "outlier": { "type": "string" }, "windows": { "type": "array", "items": { "type": "object", "properties": { "from": { "type": [ "integer", "null" ] }, "to": { "type": [ "integer", "null" ] }, "programs": { "type": "integer" }, "vendi": { "type": "number" }, "share": { "type": "number" } } } }, "narrowing": { "type": "boolean" } } }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } } ] } }, { "name": "converge_history", "title": "Whether the person's designs converge on a model's", "description": "Along a program's history (the path of NAME.history.json): for each version the person made after a model proposed, how far it is built from the proposals and the share of its gates in a model's hand; whether that is converging, and why; and the versions made exploring on their own set beside the rest. When it converges, propose less and ask more.", "inputSchema": { "type": "object", "required": [ "history" ], "properties": { "history": { "type": "string", "description": "The history file's path." }, "inputs": { "type": "object", "additionalProperties": { "type": "integer" }, "description": "Values for a generator's integer inputs, as {\"n\": 5}: the program is read as its family's circuit at those values." } } }, "outputSchema": { "$id": "wai-quantum://schemas/converge_history/1", "type": "object", "description": "Whether the person's designs converge on a model's proposals along a program's history, and why; the versions made on their own set beside the rest.", "anyOf": [ { "type": "object", "description": "Whether the person's designs converge on a model's proposals along a program's history, and why; the versions made on their own set beside the rest.", "required": [ "series", "converging", "why" ], "properties": { "series": { "type": "array", "items": { "type": "object", "properties": { "version": { "type": "string" }, "at": { "type": [ "integer", "null" ] }, "distance": { "type": "number" }, "share": { "type": "number" }, "organic": { "type": "boolean" } } } }, "share": { "type": [ "number", "null" ] }, "distance_trend": { "type": [ "number", "null" ] }, "share_trend": { "type": [ "number", "null" ] }, "converging": { "type": "boolean" }, "why": { "type": "string" }, "organic": { "type": "object", "properties": { "versions": { "type": "integer" }, "distance": { "type": [ "number", "null" ] } } }, "assisted": { "type": "object", "properties": { "versions": { "type": "integer" }, "distance": { "type": [ "number", "null" ] } } } } }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } } ] } }, { "name": "study_measure", "title": "A study participant's measures", "description": "The engine's measures of one participant's record (the file the Studio's \"Export my record\" saves): quality (the edits the engine proves equal to what they replaced, and whether they made it cheaper) and its trend, diversity (Vendi), novelty, selection skill, calibration of predictions, unassisted probe scores (scored again by the engine), ownership answers and authorship share, and convergence on a model's proposals.", "inputSchema": { "type": "object", "required": [ "record" ], "properties": { "record": { "type": "string", "description": "The record file's path." } } }, "outputSchema": { "$id": "wai-quantum://schemas/study_measure/1", "type": "object", "description": "The engine's measures of one participant's record: quality and its trend, diversity, novelty, authorship, convergence, selection skill, calibration of predictions, unassisted probe scores and ownership answers. A measure the record holds nothing for is left out or null.", "anyOf": [ { "type": "object", "description": "The engine's measures of one participant's record: quality and its trend, diversity, novelty, authorship, convergence, selection skill, calibration of predictions, unassisted probe scores and ownership answers. A measure the record holds nothing for is left out or null.", "required": [ "participant", "condition" ], "properties": { "participant": { "type": [ "string", "null" ] }, "condition": { "type": [ "string", "null" ] }, "quality": { "type": "object" }, "diversity": { "type": "object" }, "novelty": { "type": "object" }, "authorship": { "type": "number" }, "convergence": { "type": "object" }, "selection": { "type": "object" }, "calibration": { "type": "object" }, "unassisted": { "type": "object" }, "ownership": { "type": "object" } } }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } } ] } }, { "name": "study_cohort", "title": "A study's report", "description": "A study's report from its sealed protocol and the participants' sealed records: each record checked (the protocol's digest, its seal, the condition its key is assigned) and refused with the reason if it fails; the measures per condition; each condition's difference from the control on the primary measure with a seeded bootstrap interval; Cronbach's alpha of the ownership items; the Vendi score of each condition's final designs. The analysis is the one the protocol fixed before any data.", "inputSchema": { "type": "object", "required": [ "protocol", "records" ], "properties": { "protocol": { "type": "string", "description": "The sealed protocol's path." }, "records": { "type": "array", "items": { "type": "string" }, "description": "The sealed records' paths." } } }, "outputSchema": { "$id": "wai-quantum://schemas/study_cohort/1", "type": "object", "description": "A study's report from its sealed protocol and the participants' sealed records: each record checked or refused with the reason, the measures per condition, each condition against the control on the primary measure with a bootstrap interval, and Cronbach's alpha of the ownership items.", "anyOf": [ { "type": "object", "description": "A study's report from its sealed protocol and the participants' sealed records: each record checked or refused with the reason, the measures per condition, each condition against the control on the primary measure with a bootstrap interval, and Cronbach's alpha of the ownership items.", "required": [ "study", "protocol", "records", "included", "refused", "conditions" ], "properties": { "study": { "type": "string" }, "protocol": { "type": "string", "description": "The sealed protocol's digest." }, "hypotheses": { "type": "array", "items": { "type": "string" } }, "primary": { "type": "string" }, "control": { "type": "string" }, "analysis": { "type": "object" }, "records": { "type": "integer" }, "included": { "type": "integer" }, "refused": { "type": "array", "items": { "type": "object", "properties": { "record": { "type": "integer" }, "why": { "type": "string" } } } }, "conditions": { "type": "array", "items": { "type": "object" } }, "ownership_alpha": { "type": [ "number", "null" ] }, "ownership_answers": { "type": "integer" } } }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } } ] } }, { "name": "taste_rank", "title": "Rank programs by the person's taste", "description": "Programs ranked by the person's own taste profile, learned from the choices they made between programs the engine proved equal: each with its score, each rubric part's score (economy, clarity, insight, precision, utility), and its typicality (nearness to the known constructions), which the profile never learns and only the novelty dial moves; where the parts and the cost put another first; and whether the ranking narrows what comes first. An agent cannot record a choice: only the person chooses, with `wai-quantum taste choose`.", "inputSchema": { "type": "object", "properties": { "programs": { "type": "array", "items": { "type": "object", "required": [ "name", "qasm" ], "properties": { "name": { "type": "string" }, "qasm": { "type": "string" }, "cost": { "type": "number" } } } }, "inputs": { "type": "object", "additionalProperties": { "type": "integer" }, "description": "Values for a generator's integer inputs, as {\"n\": 5}: the program is read as its family's circuit at those values." }, "spec": { "type": "string", "description": "A workbench specification's path: rank its archive's elites instead." }, "archive": { "type": "string" }, "novelty": { "type": "number", "description": "The novelty dial, -1 (toward the typical) to 1 (toward the novel)." }, "profile": { "type": "string", "description": "The profile's name (default mine)." } } }, "outputSchema": { "$id": "wai-quantum://schemas/taste_rank/1", "type": "object", "description": "Programs ranked by the person's own taste profile: each with its score, its parts' scores and its typicality; where the parts or the cost put another first; and whether the ranking narrows what comes first.", "anyOf": [ { "type": "object", "description": "Programs ranked by the person's own taste profile: each with its score, its parts' scores and its typicality; where the parts or the cost put another first; and whether the ranking narrows what comes first.", "required": [ "choices", "ranked" ], "properties": { "choices": { "type": "integer", "description": "The choices the profile has learned from." }, "dial": { "type": "number", "description": "The novelty dial, -1 to 1." }, "ranked": { "type": "array", "items": { "type": "object", "required": [ "name", "score", "final" ], "properties": { "name": { "type": "string" }, "score": { "type": "number" }, "final": { "type": "number" }, "novelty": { "type": [ "number", "null" ] }, "typicality": { "type": [ "number", "null" ] }, "cost": { "type": [ "number", "null" ] }, "parts": { "type": "object", "additionalProperties": { "type": "number" } } } } }, "disagree": { "type": "array", "items": { "type": "object", "properties": { "part": { "type": "string" }, "first": { "type": "string" } } } }, "narrowing": { "type": [ "object", "null" ] } } }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } } ] } }, { "name": "taste_next", "title": "The pair to show the person next", "description": "Among programs (or a specification's elites), the pair the person's taste profile is least sure of that the engine proves equal: the comparison that teaches the profile most. Show it to the person; only they choose.", "inputSchema": { "type": "object", "properties": { "programs": { "type": "array", "items": { "type": "object", "required": [ "name", "qasm" ], "properties": { "name": { "type": "string" }, "qasm": { "type": "string" } } } }, "inputs": { "type": "object", "additionalProperties": { "type": "integer" }, "description": "Values for a generator's integer inputs, as {\"n\": 5}: the program is read as its family's circuit at those values." }, "spec": { "type": "string" }, "archive": { "type": "string" }, "task": { "type": "string", "enum": [ "equivalent", "prepares" ] }, "profile": { "type": "string" } } }, "outputSchema": { "$id": "wai-quantum://schemas/taste_next/1", "type": "object", "description": "The pair the person's taste profile is least sure of that the engine proves equal, or why there is none.", "anyOf": [ { "type": "object", "description": "The pair the person's taste profile is least sure of that the engine proves equal, or why there is none.", "required": [ "a" ], "properties": { "a": { "type": [ "string", "null" ] }, "b": { "type": "string" }, "how": { "type": "string", "description": "How the engine proved them equal." }, "p_a": { "type": "number", "description": "The profile's probability that the person prefers a." }, "why": { "type": "string" } } }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } } ] } }, { "name": "history_commit", "title": "Record your edit in a program's history", "description": "Record your change to a program as an edit in its history (prog.qasm → prog.history.json), sealed with this user's key. It is recorded as an outside agent's, under the name you gave when you connected, so the person can see which lines and gates are yours and accept or undo them. Give the program as you leave it in qasm (the file is written), or leave qasm out to record the file as it now is. With no history yet, the file as it was starts one. The person's rules bind your change: lines between `// @lock` and `// @unlock` stay as they are, and prog.locks.json beside the program may name the gates allowed, hold the qubit declarations, name gates and text to avoid, or a region to keep to. A change that breaks one is refused with the rule; history_changes shows them first.", "inputSchema": { "type": "object", "required": [ "program" ], "properties": { "program": { "type": "string", "description": "The program file's path." }, "qasm": { "type": "string", "description": "The program as you leave it; the file is written with it." }, "parent": { "type": "string", "description": "The version you changed (default: the head)." }, "note": { "type": "string", "description": "What the change does, in a sentence." }, "history": { "type": "string", "description": "The history's path, if not beside the program." } } }, "outputSchema": { "$id": "wai-quantum://schemas/history_commit/1", "type": "object", "description": "The version an agent's edit was recorded as, and in whose name.", "anyOf": [ { "type": "object", "description": "The version an agent's edit was recorded as, and in whose name.", "required": [ "version", "parent", "by", "history" ], "properties": { "version": { "type": "string" }, "parent": { "type": "string" }, "by": { "type": [ "object", "null" ], "properties": { "kind": { "enum": [ "person", "assistant", "agent", "engine", "origin" ] }, "name": { "type": [ "string", "null" ] } } }, "history": { "type": "string", "description": "The history file's path." } } }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } } ] } }, { "name": "history_changes", "title": "The changes a program would make", "description": "The changes, line by line and numbered, that a program would make to the head of a program's history (or another version): what a person reviews one by one. Each comes with the person's rules it breaks, if any, and `rules` lists the rules as sentences.", "inputSchema": { "type": "object", "required": [ "program", "qasm" ], "properties": { "program": { "type": "string", "description": "The program file's path." }, "qasm": { "type": "string", "description": "The proposed program." }, "parent": { "type": "string", "description": "The version to compare with (default: the head)." }, "inputs": { "type": "object", "additionalProperties": { "type": "integer" }, "description": "Values for a generator's integer inputs, as {\"n\": 5}: the program is read as its family's circuit at those values." }, "history": { "type": "string", "description": "The history's path, if not beside the program." } } }, "outputSchema": { "$id": "wai-quantum://schemas/history_changes/1", "type": "object", "description": "What history_changes answers.", "anyOf": [ { "type": "object", "required": [ "changes", "rules" ], "properties": { "changes": { "type": "array", "items": { "type": "object" } }, "breaches": {}, "rules": { "type": "array", "items": { "type": "string" } } } }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } } ] } }, { "name": "history_blame", "title": "Whose hand each line and gate is in", "description": "Each line of a version (default: the head) and whose hand it is in: the person, the assistant, an agent, the engine, where the program came from, or a model's or an agent's line the person then edited; and the gates (at the inputs given) and lines in each hand, with each contributor's share.", "inputSchema": { "type": "object", "required": [ "program" ], "properties": { "program": { "type": "string", "description": "The program file's path." }, "version": { "type": "string", "description": "The version (default: the head)." }, "inputs": { "type": "object", "additionalProperties": { "type": "integer" }, "description": "Values for a generator's integer inputs, as {\"n\": 5}: the program is read as its family's circuit at those values." }, "history": { "type": "string", "description": "The history's path, if not beside the program." } } }, "outputSchema": { "$id": "wai-quantum://schemas/history_blame/1", "type": "object", "description": "What history_blame answers.", "anyOf": [ { "type": "object", "required": [ "version", "lines", "authorship" ], "properties": { "version": { "type": "string" }, "lines": { "type": "array", "items": { "type": "object" } }, "authorship": { "type": "object" } } }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } } ] } }, { "name": "history_log", "title": "A program's history", "description": "Every version of a program: who made it and how (an edit, a proposal reviewed change by change, a merge), when, what it changed, which versions are heads, and whether the chain, every seal and every review hold.", "inputSchema": { "type": "object", "required": [ "program" ], "properties": { "program": { "type": "string", "description": "The program file's path." }, "history": { "type": "string", "description": "The history's path, if not beside the program." } } }, "outputSchema": { "$id": "wai-quantum://schemas/history_log/1", "type": "object", "description": "What history_log answers.", "anyOf": [ { "type": "object", "required": [ "versions", "check" ], "properties": { "versions": { "type": "array", "items": { "type": "object" } }, "check": { "type": "object" } } }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } } ] } }, { "name": "list_methods", "title": "List the methods", "description": "Each simulation method: its accuracy class, the circuits it takes, and the most qubits it holds in a job's memory here.", "inputSchema": { "type": "object", "properties": {} }, "outputSchema": { "$id": "wai-quantum://schemas/list_methods/1", "type": "object", "description": "What list_methods answers.", "anyOf": [ { "type": "object", "required": [ "methods" ], "properties": { "methods": { "type": "array", "items": { "type": "object", "required": [ "method", "accuracy", "circuits", "max_qubits", "answers" ], "properties": { "method": { "type": "string" }, "accuracy": { "type": "string" }, "circuits": { "type": "string" }, "max_qubits": { "type": "integer" }, "max_cut": { "type": "integer" }, "available": { "type": "boolean", "description": "false when this build or this machine lacks it." }, "answers": { "type": "array", "items": { "type": "string" } }, "options": { "type": "object", "additionalProperties": { "type": "string" } } } } } } }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } } ] } }, { "name": "qasm_diagnostics", "title": "The reader's diagnostic codes", "description": "Every code the OpenQASM reader gives (each refusal and warning carries one, as `[Q103]` at the end of its message and as `code` in lint's JSON): its outcome (refused, lowered, carried, preserved or warned) and its meaning; and beside them, under job_codes, the codes of what is asked of a program (`[J011]`: the request, the method, an intent, a repair, the host). A code never changes meaning once released. Give `code` for one of either.", "inputSchema": { "type": "object", "properties": { "code": { "type": "string", "description": "One code, as Q103 or J011." } } }, "outputSchema": { "$id": "wai-quantum://schemas/qasm_diagnostics/1", "type": "object", "description": "The codes of both tables, the reader's (Q…) and the job layer's (J…), or the row of one code.", "anyOf": [ { "description": "The codes of both tables, the reader's (Q…) and the job layer's (J…), or the row of one code.", "anyOf": [ { "type": "object", "required": [ "codes" ], "properties": { "codes": { "type": "array", "items": { "type": "object", "description": "A row of a table of codes, the reader's (Q…) or the job layer's (J…): a code, its outcome, its meaning, and whether it is retired (a retired code keeps its row and its meaning, and nothing gives it).", "required": [ "code", "outcome", "meaning", "retired" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" }, "retired": { "type": "boolean" }, "table": { "enum": [ "reader", "job" ], "description": "Which table the code is in: the reader's (Q…) or the job layer's (J…)." } } } }, "stable": { "type": "string" }, "job_codes": { "type": "array", "items": { "type": "object", "description": "A row of a table of codes, the reader's (Q…) or the job layer's (J…): a code, its outcome, its meaning, and whether it is retired (a retired code keeps its row and its meaning, and nothing gives it).", "required": [ "code", "outcome", "meaning", "retired" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" }, "retired": { "type": "boolean" }, "table": { "enum": [ "reader", "job" ], "description": "Which table the code is in: the reader's (Q…) or the job layer's (J…)." } } }, "description": "The job layer's codes (J…): what a host refuses of a job it read, and why." } } }, { "type": "object", "description": "A row of a table of codes, the reader's (Q…) or the job layer's (J…): a code, its outcome, its meaning, and whether it is retired (a retired code keeps its row and its meaning, and nothing gives it).", "required": [ "code", "outcome", "meaning", "retired" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" }, "retired": { "type": "boolean" }, "table": { "enum": [ "reader", "job" ], "description": "Which table the code is in: the reader's (Q…) or the job layer's (J…)." } } } ] }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } } ] } }, { "name": "list_targets", "title": "List the device targets", "description": "The device targets this machine knows: the built-in ones (synthetic, made up in the shapes of published formats) and the person's own, kept with `wai-quantum targets import`. Each with its qubits, pairs, the gates it compiles to, the spread of its T1 and readout errors, and its hash.", "inputSchema": { "type": "object", "properties": {} }, "outputSchema": { "$id": "wai-quantum://schemas/list_targets/1", "type": "object", "description": "The device targets this host knows: the built-in ones (all synthetic) and the person's own, kept in a directory of theirs.", "anyOf": [ { "type": "object", "description": "The device targets this host knows: the built-in ones (all synthetic) and the person's own, kept in a directory of theirs.", "required": [ "built_in", "yours" ], "properties": { "built_in": { "type": "array", "items": { "type": "object", "description": "A device target in brief: its name and hash, where it came from, its calibration snapshot, its qubits and pairs, each native gate's error and duration across the device, the native gate set it is compiled to, and its qubits' T1, T2 and readout error.", "required": [ "name", "hash", "qubits", "pairs" ], "properties": { "name": { "type": "string" }, "hash": { "type": "string", "description": "BLAKE3 of the target document's RFC 8785 text: what a receipt names." }, "source": { "type": "object", "properties": { "format": { "type": "string" }, "note": { "type": "string" } } }, "calibration": { "type": "object", "properties": { "id": { "type": "string" }, "timestamp": { "type": "string" } } }, "qubits": { "type": "integer" }, "pairs": { "type": "integer" }, "gates": { "type": "array", "items": { "type": "object", "properties": { "gate": { "type": "string" }, "qubits": { "type": "integer" }, "where": { "type": "integer" }, "error": { "type": [ "object", "null" ], "properties": { "min": { "type": "number" }, "median": { "type": "number" }, "max": { "type": "number" }, "of": { "type": "integer" } }, "description": "The least, the median and the most of a figure across the device, and how many it has; null when the target gives none." }, "duration_ns": { "type": [ "object", "null" ], "properties": { "min": { "type": "number" }, "median": { "type": "number" }, "max": { "type": "number" }, "of": { "type": "integer" } }, "description": "The least, the median and the most of a figure across the device, and how many it has; null when the target gives none." } } } }, "native": { "type": "object", "description": "The compiler's gate set the target's gates hold, whether exactly, and how each is costed." }, "t1_us": { "type": [ "object", "null" ], "properties": { "min": { "type": "number" }, "median": { "type": "number" }, "max": { "type": "number" }, "of": { "type": "integer" } }, "description": "The least, the median and the most of a figure across the device, and how many it has; null when the target gives none." }, "t2_us": { "type": [ "object", "null" ], "properties": { "min": { "type": "number" }, "median": { "type": "number" }, "max": { "type": "number" }, "of": { "type": "integer" } }, "description": "The least, the median and the most of a figure across the device, and how many it has; null when the target gives none." }, "readout_error": { "type": [ "object", "null" ], "properties": { "min": { "type": "number" }, "median": { "type": "number" }, "max": { "type": "number" }, "of": { "type": "integer" } }, "description": "The least, the median and the most of a figure across the device, and how many it has; null when the target gives none." }, "view": { "type": "object", "description": "With view: each qubit's place and errors and each pair's error, to draw the coupling map." }, "document": { "title": "wai.quantum.target/1", "description": "A device target: its qubits, the pairs it couples, its native gates with their errors and durations, and the calibration snapshot they come from. A value not known is left out, never written as zero. Every field but format, name, source, qubits, gates and coupling is optional, and a field the format does not name is refused, so a misspelt one never reads as absent. Its canonical text is its RFC 8785 form, and the BLAKE3 of that text, the target's hash, names the snapshot in a receipt.", "type": "object", "required": [ "format", "name", "source", "qubits", "gates", "coupling" ], "additionalProperties": false, "properties": { "format": { "const": "wai.quantum.target/1" }, "name": { "type": "string", "minLength": 1, "maxLength": 200 }, "source": { "type": "object", "required": [ "format" ], "additionalProperties": false, "properties": { "format": { "type": "string", "description": "The format the target was read from (wai-quantum targets import --help lists them)." }, "note": { "type": "string", "maxLength": 400 } } }, "calibration": { "type": "object", "additionalProperties": false, "properties": { "id": { "type": "string", "maxLength": 400, "description": "The calibration snapshot's id, as the source names it, or a content id of the snapshot read." }, "timestamp": { "type": "string", "maxLength": 400, "description": "When the snapshot was taken, as the source writes it." } } }, "qubits": { "type": "array", "minItems": 1, "maxItems": 2048, "description": "Every qubit, in order.", "items": { "type": "object", "required": [ "qubit" ], "additionalProperties": false, "properties": { "qubit": { "type": "integer", "minimum": 0, "description": "Its index: its place in the list." }, "label": { "type": "string", "description": "The source's own name for it, when that is not its index." }, "t1_us": { "type": "number", "minimum": 0, "description": "T1, microseconds." }, "t2_us": { "type": "number", "minimum": 0, "description": "T2 (the echo or Ramsey time the source reports), microseconds." }, "frequency_ghz": { "type": "number", "minimum": 0, "description": "Its frequency, gigahertz." }, "readout": { "type": "object", "required": [ "p01", "p10" ], "additionalProperties": false, "properties": { "p01": { "type": "number", "minimum": 0, "maximum": 1, "description": "P(reads 1 | holds 0)." }, "p10": { "type": "number", "minimum": 0, "maximum": 1, "description": "P(reads 0 | holds 1)." } } }, "measure_ns": { "type": "number", "minimum": 0, "description": "The measurement's duration, nanoseconds." } } } }, "gates": { "type": "array", "maxItems": 262144, "description": "Each native gate where the device runs it, sorted by gate then qubits.", "items": { "type": "object", "required": [ "gate", "qubits" ], "additionalProperties": false, "properties": { "gate": { "type": "string", "pattern": "^[a-z0-9_]{1,40}$" }, "qubits": { "type": "array", "minItems": 1, "maxItems": 2, "items": { "type": "integer", "minimum": 0 } }, "error": { "type": "number", "minimum": 0, "maximum": 1, "description": "The average gate infidelity." }, "duration_ns": { "type": "number", "minimum": 0, "description": "Nanoseconds." } } } }, "coupling": { "type": "array", "description": "The pairs a two-qubit gate may act on, each once, the lower qubit first, sorted.", "items": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "type": "integer", "minimum": 0 } } } } } } } }, "yours": { "type": "array", "items": { "type": "object", "description": "A device target in brief: its name and hash, where it came from, its calibration snapshot, its qubits and pairs, each native gate's error and duration across the device, the native gate set it is compiled to, and its qubits' T1, T2 and readout error.", "required": [ "name", "hash", "qubits", "pairs" ], "properties": { "name": { "type": "string" }, "hash": { "type": "string", "description": "BLAKE3 of the target document's RFC 8785 text: what a receipt names." }, "source": { "type": "object", "properties": { "format": { "type": "string" }, "note": { "type": "string" } } }, "calibration": { "type": "object", "properties": { "id": { "type": "string" }, "timestamp": { "type": "string" } } }, "qubits": { "type": "integer" }, "pairs": { "type": "integer" }, "gates": { "type": "array", "items": { "type": "object", "properties": { "gate": { "type": "string" }, "qubits": { "type": "integer" }, "where": { "type": "integer" }, "error": { "type": [ "object", "null" ], "properties": { "min": { "type": "number" }, "median": { "type": "number" }, "max": { "type": "number" }, "of": { "type": "integer" } }, "description": "The least, the median and the most of a figure across the device, and how many it has; null when the target gives none." }, "duration_ns": { "type": [ "object", "null" ], "properties": { "min": { "type": "number" }, "median": { "type": "number" }, "max": { "type": "number" }, "of": { "type": "integer" } }, "description": "The least, the median and the most of a figure across the device, and how many it has; null when the target gives none." } } } }, "native": { "type": "object", "description": "The compiler's gate set the target's gates hold, whether exactly, and how each is costed." }, "t1_us": { "type": [ "object", "null" ], "properties": { "min": { "type": "number" }, "median": { "type": "number" }, "max": { "type": "number" }, "of": { "type": "integer" } }, "description": "The least, the median and the most of a figure across the device, and how many it has; null when the target gives none." }, "t2_us": { "type": [ "object", "null" ], "properties": { "min": { "type": "number" }, "median": { "type": "number" }, "max": { "type": "number" }, "of": { "type": "integer" } }, "description": "The least, the median and the most of a figure across the device, and how many it has; null when the target gives none." }, "readout_error": { "type": [ "object", "null" ], "properties": { "min": { "type": "number" }, "median": { "type": "number" }, "max": { "type": "number" }, "of": { "type": "integer" } }, "description": "The least, the median and the most of a figure across the device, and how many it has; null when the target gives none." }, "view": { "type": "object", "description": "With view: each qubit's place and errors and each pair's error, to draw the coupling map." }, "document": { "title": "wai.quantum.target/1", "description": "A device target: its qubits, the pairs it couples, its native gates with their errors and durations, and the calibration snapshot they come from. A value not known is left out, never written as zero. Every field but format, name, source, qubits, gates and coupling is optional, and a field the format does not name is refused, so a misspelt one never reads as absent. Its canonical text is its RFC 8785 form, and the BLAKE3 of that text, the target's hash, names the snapshot in a receipt.", "type": "object", "required": [ "format", "name", "source", "qubits", "gates", "coupling" ], "additionalProperties": false, "properties": { "format": { "const": "wai.quantum.target/1" }, "name": { "type": "string", "minLength": 1, "maxLength": 200 }, "source": { "type": "object", "required": [ "format" ], "additionalProperties": false, "properties": { "format": { "type": "string", "description": "The format the target was read from (wai-quantum targets import --help lists them)." }, "note": { "type": "string", "maxLength": 400 } } }, "calibration": { "type": "object", "additionalProperties": false, "properties": { "id": { "type": "string", "maxLength": 400, "description": "The calibration snapshot's id, as the source names it, or a content id of the snapshot read." }, "timestamp": { "type": "string", "maxLength": 400, "description": "When the snapshot was taken, as the source writes it." } } }, "qubits": { "type": "array", "minItems": 1, "maxItems": 2048, "description": "Every qubit, in order.", "items": { "type": "object", "required": [ "qubit" ], "additionalProperties": false, "properties": { "qubit": { "type": "integer", "minimum": 0, "description": "Its index: its place in the list." }, "label": { "type": "string", "description": "The source's own name for it, when that is not its index." }, "t1_us": { "type": "number", "minimum": 0, "description": "T1, microseconds." }, "t2_us": { "type": "number", "minimum": 0, "description": "T2 (the echo or Ramsey time the source reports), microseconds." }, "frequency_ghz": { "type": "number", "minimum": 0, "description": "Its frequency, gigahertz." }, "readout": { "type": "object", "required": [ "p01", "p10" ], "additionalProperties": false, "properties": { "p01": { "type": "number", "minimum": 0, "maximum": 1, "description": "P(reads 1 | holds 0)." }, "p10": { "type": "number", "minimum": 0, "maximum": 1, "description": "P(reads 0 | holds 1)." } } }, "measure_ns": { "type": "number", "minimum": 0, "description": "The measurement's duration, nanoseconds." } } } }, "gates": { "type": "array", "maxItems": 262144, "description": "Each native gate where the device runs it, sorted by gate then qubits.", "items": { "type": "object", "required": [ "gate", "qubits" ], "additionalProperties": false, "properties": { "gate": { "type": "string", "pattern": "^[a-z0-9_]{1,40}$" }, "qubits": { "type": "array", "minItems": 1, "maxItems": 2, "items": { "type": "integer", "minimum": 0 } }, "error": { "type": "number", "minimum": 0, "maximum": 1, "description": "The average gate infidelity." }, "duration_ns": { "type": "number", "minimum": 0, "description": "Nanoseconds." } } } }, "coupling": { "type": "array", "description": "The pairs a two-qubit gate may act on, each once, the lower qubit first, sorted.", "items": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "type": "integer", "minimum": 0 } } } } } } } }, "kept_in": { "type": [ "string", "null" ] }, "note": { "type": "string" } } }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } } ] } }, { "name": "show_target", "title": "Show a device target", "description": "A device target's qubits, pairs, native gates with the spread of their errors and durations, its calibration snapshot and its hash; with view, each qubit's place for drawing the coupling map, its readout and one-qubit errors, T1 and T2, and each pair's two-qubit error; with document, the target document itself. Give a target's name (list_targets) or a target document.", "inputSchema": { "type": "object", "required": [ "target" ], "properties": { "target": { "description": "A target's name (list_targets), or a target document (wai.quantum.target/1)." }, "view": { "type": "boolean", "description": "Include each qubit's place and errors and each pair's error." }, "document": { "type": "boolean", "description": "Include the target document." } } }, "outputSchema": { "$id": "wai-quantum://schemas/show_target/1", "type": "object", "description": "A device target in brief: its name and hash, where it came from, its calibration snapshot, its qubits and pairs, each native gate's error and duration across the device, the native gate set it is compiled to, and its qubits' T1, T2 and readout error.", "anyOf": [ { "type": "object", "description": "A device target in brief: its name and hash, where it came from, its calibration snapshot, its qubits and pairs, each native gate's error and duration across the device, the native gate set it is compiled to, and its qubits' T1, T2 and readout error.", "required": [ "name", "hash", "qubits", "pairs" ], "properties": { "name": { "type": "string" }, "hash": { "type": "string", "description": "BLAKE3 of the target document's RFC 8785 text: what a receipt names." }, "source": { "type": "object", "properties": { "format": { "type": "string" }, "note": { "type": "string" } } }, "calibration": { "type": "object", "properties": { "id": { "type": "string" }, "timestamp": { "type": "string" } } }, "qubits": { "type": "integer" }, "pairs": { "type": "integer" }, "gates": { "type": "array", "items": { "type": "object", "properties": { "gate": { "type": "string" }, "qubits": { "type": "integer" }, "where": { "type": "integer" }, "error": { "type": [ "object", "null" ], "properties": { "min": { "type": "number" }, "median": { "type": "number" }, "max": { "type": "number" }, "of": { "type": "integer" } }, "description": "The least, the median and the most of a figure across the device, and how many it has; null when the target gives none." }, "duration_ns": { "type": [ "object", "null" ], "properties": { "min": { "type": "number" }, "median": { "type": "number" }, "max": { "type": "number" }, "of": { "type": "integer" } }, "description": "The least, the median and the most of a figure across the device, and how many it has; null when the target gives none." } } } }, "native": { "type": "object", "description": "The compiler's gate set the target's gates hold, whether exactly, and how each is costed." }, "t1_us": { "type": [ "object", "null" ], "properties": { "min": { "type": "number" }, "median": { "type": "number" }, "max": { "type": "number" }, "of": { "type": "integer" } }, "description": "The least, the median and the most of a figure across the device, and how many it has; null when the target gives none." }, "t2_us": { "type": [ "object", "null" ], "properties": { "min": { "type": "number" }, "median": { "type": "number" }, "max": { "type": "number" }, "of": { "type": "integer" } }, "description": "The least, the median and the most of a figure across the device, and how many it has; null when the target gives none." }, "readout_error": { "type": [ "object", "null" ], "properties": { "min": { "type": "number" }, "median": { "type": "number" }, "max": { "type": "number" }, "of": { "type": "integer" } }, "description": "The least, the median and the most of a figure across the device, and how many it has; null when the target gives none." }, "view": { "type": "object", "description": "With view: each qubit's place and errors and each pair's error, to draw the coupling map." }, "document": { "title": "wai.quantum.target/1", "description": "A device target: its qubits, the pairs it couples, its native gates with their errors and durations, and the calibration snapshot they come from. A value not known is left out, never written as zero. Every field but format, name, source, qubits, gates and coupling is optional, and a field the format does not name is refused, so a misspelt one never reads as absent. Its canonical text is its RFC 8785 form, and the BLAKE3 of that text, the target's hash, names the snapshot in a receipt.", "type": "object", "required": [ "format", "name", "source", "qubits", "gates", "coupling" ], "additionalProperties": false, "properties": { "format": { "const": "wai.quantum.target/1" }, "name": { "type": "string", "minLength": 1, "maxLength": 200 }, "source": { "type": "object", "required": [ "format" ], "additionalProperties": false, "properties": { "format": { "type": "string", "description": "The format the target was read from (wai-quantum targets import --help lists them)." }, "note": { "type": "string", "maxLength": 400 } } }, "calibration": { "type": "object", "additionalProperties": false, "properties": { "id": { "type": "string", "maxLength": 400, "description": "The calibration snapshot's id, as the source names it, or a content id of the snapshot read." }, "timestamp": { "type": "string", "maxLength": 400, "description": "When the snapshot was taken, as the source writes it." } } }, "qubits": { "type": "array", "minItems": 1, "maxItems": 2048, "description": "Every qubit, in order.", "items": { "type": "object", "required": [ "qubit" ], "additionalProperties": false, "properties": { "qubit": { "type": "integer", "minimum": 0, "description": "Its index: its place in the list." }, "label": { "type": "string", "description": "The source's own name for it, when that is not its index." }, "t1_us": { "type": "number", "minimum": 0, "description": "T1, microseconds." }, "t2_us": { "type": "number", "minimum": 0, "description": "T2 (the echo or Ramsey time the source reports), microseconds." }, "frequency_ghz": { "type": "number", "minimum": 0, "description": "Its frequency, gigahertz." }, "readout": { "type": "object", "required": [ "p01", "p10" ], "additionalProperties": false, "properties": { "p01": { "type": "number", "minimum": 0, "maximum": 1, "description": "P(reads 1 | holds 0)." }, "p10": { "type": "number", "minimum": 0, "maximum": 1, "description": "P(reads 0 | holds 1)." } } }, "measure_ns": { "type": "number", "minimum": 0, "description": "The measurement's duration, nanoseconds." } } } }, "gates": { "type": "array", "maxItems": 262144, "description": "Each native gate where the device runs it, sorted by gate then qubits.", "items": { "type": "object", "required": [ "gate", "qubits" ], "additionalProperties": false, "properties": { "gate": { "type": "string", "pattern": "^[a-z0-9_]{1,40}$" }, "qubits": { "type": "array", "minItems": 1, "maxItems": 2, "items": { "type": "integer", "minimum": 0 } }, "error": { "type": "number", "minimum": 0, "maximum": 1, "description": "The average gate infidelity." }, "duration_ns": { "type": "number", "minimum": 0, "description": "Nanoseconds." } } } }, "coupling": { "type": "array", "description": "The pairs a two-qubit gate may act on, each once, the lower qubit first, sorted.", "items": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "type": "integer", "minimum": 0 } } } } } } }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } } ] } }, { "name": "run_on_target", "title": "Run a program as it would run on a device", "description": "Run an OpenQASM program here as it would run on a device target: compiled exactly to the target's native gates, placed on the qubits and routes most likely to succeed (the expected success given beside the fewest-swaps layout's), checked against the circuit, and simulated under the noise its calibration gives (each gate's error, T1, T2 and durations, idling, and each qubit's readout), on the density matrix or by trajectories. Counts and expectation values, their distance from the ideal distribution, the noise derived, and a receipt signed with this user's key that binds the target's hash. A model of the device, not a run on it: quote it as such. Every angle must be a dyadic multiple of 2π.", "inputSchema": { "type": "object", "required": [ "qasm", "target" ], "properties": { "qasm": { "type": "string", "description": "The program, OpenQASM 3 or 2: registers and broadcast over them, the standard gates, ctrl/negctrl modifiers, gate definitions, measurement and reset anywhere, if on measured bits, and generators (integer input, const and for loops, one program for a family of circuits; give the inputs' values in \"inputs\"). while, inv and pow are refused with their line." }, "inputs": { "type": "object", "additionalProperties": { "type": "integer" }, "description": "Values for a generator's integer inputs, as {\"n\": 5}: the program is read as its family's circuit at those values." }, "shots": { "type": "integer", "minimum": 0, "description": "Shots to sample; 1024 when nothing else is asked." }, "seed": { "type": "integer", "minimum": 0, "description": "The sampling seed (default 1)." }, "method": { "type": "string", "description": "auto (the default: the strongest method the program admits), or one of list_methods' names." }, "observables": { "type": "array", "items": { "type": "string" }, "description": "Pauli observables, as \"Z0 Z1\" or \"0.5 X2\"." }, "amplitudes": { "type": "array", "items": { "type": "string" }, "description": "Basis states whose amplitudes to return, as bit strings with the highest qubit first." }, "noise": { "type": "object", "description": "Channel probabilities", "properties": { "depolarizing_1q": { "type": "number", "minimum": 0, "maximum": 1 }, "depolarizing_2q": { "type": "number", "minimum": 0, "maximum": 1 }, "amplitude_damping": { "type": "number", "minimum": 0, "maximum": 1 }, "dephasing": { "type": "number", "minimum": 0, "maximum": 1 }, "readout": { "type": "number", "minimum": 0, "maximum": 1 } }, "additionalProperties": false }, "options": { "type": "object", "description": "Method options: max_bond, fusion, trajectories, threshold, memory_gb." }, "compile": { "type": "object", "description": "Compile the program first (as compile_qasm does) and run the compiled circuit: with basis clifford_t it runs bit-exact, and the result's \"compiled\" states its distance from the program.", "properties": { "epsilon": { "type": "number", "exclusiveMinimum": 0, "description": "The most the output may differ from the program in the operator norm, up to a global phase, shared by its rotations (default 1e-6)." }, "level": { "type": "integer", "minimum": 0, "maximum": 2, "description": "0: lower and approximate; 1 (default): also checked rewrites and phase folding; 2: also one- and two-qubit resynthesis." }, "basis": { "type": "string", "enum": [ "clifford_t", "standard" ], "description": "clifford_t (default): every rotation off the multiples of π/4 written as a Clifford+T word; standard: nothing approximated." }, "twirl": { "description": "Twirl each two-qubit Clifford gate with Paulis from a seeded stream: true, or {\"seed\": N}. One seed is one instance, checked to be the same circuit." }, "dd": { "type": "string", "enum": [ "xx", "xy4" ], "description": "Dynamical decoupling in each window where a qubit idles long enough, checked to change nothing without noise." } } }, "target": { "description": "A device target: its name (list_targets) or a target document (wai.quantum.target/1). The program is then compiled to the target's gates, placed where it is most likely to succeed and simulated under the target's noise, the target's hash in the receipt; noise may not be given beside it." }, "intent": { "description": "What the program must do, checked by the engine with the run: the result's \"verdict\" states how far it checked (proof, evidence, executed, parsed, refused) and whether the intent holds, sealed by the receipt.", "anyOf": [ { "type": "object", "description": "One of distribution, equivalent, prepares or sampled; with note, name, and \"require\": \"proof\" (evidence then counts as unchecked).", "properties": { "distribution": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 }, "description": "The exact distribution of the measured bits, keyed by the classical bits with the highest bit first, as {\"00\": 0.5, \"11\": 0.5}." }, "tolerance": { "type": "number", "minimum": 0, "maximum": 1, "description": "For a distribution: the total variation distance it is held within (default 1e-9)." }, "equivalent": { "type": "string", "description": "A reference program's text: the same circuit up to a global phase, by the equivalence ladder." }, "prepares": { "type": "string", "description": "A reference program's text: the same state from |0…0⟩, the same qubits measured into the same bits." }, "sampled": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 }, "description": "A distribution the program's samples are held to: the program run as the job runs it for `shots` at `seed`, and the counts tested by `test` at the significance level `alpha` (all three required). Evidence, never proof." }, "test": { "enum": [ "chi_squared", "g_test" ], "description": "For a sampled intent: Pearson's chi-squared test, or the G-test (the likelihood ratio)." }, "alpha": { "type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 1, "description": "For a sampled intent: the significance level, as 0.01." }, "shots": { "type": "integer", "minimum": 1, "description": "For a sampled intent: the samples the test takes." }, "seed": { "type": "integer", "minimum": 0, "description": "For a sampled intent: the sampling seed (default: the job's)." }, "require": { "const": "proof" }, "note": { "type": "string" }, "name": { "type": "string" } } }, { "type": "array", "items": { "type": "object", "description": "One of distribution, equivalent, prepares or sampled; with note, name, and \"require\": \"proof\" (evidence then counts as unchecked).", "properties": { "distribution": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 }, "description": "The exact distribution of the measured bits, keyed by the classical bits with the highest bit first, as {\"00\": 0.5, \"11\": 0.5}." }, "tolerance": { "type": "number", "minimum": 0, "maximum": 1, "description": "For a distribution: the total variation distance it is held within (default 1e-9)." }, "equivalent": { "type": "string", "description": "A reference program's text: the same circuit up to a global phase, by the equivalence ladder." }, "prepares": { "type": "string", "description": "A reference program's text: the same state from |0…0⟩, the same qubits measured into the same bits." }, "sampled": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 }, "description": "A distribution the program's samples are held to: the program run as the job runs it for `shots` at `seed`, and the counts tested by `test` at the significance level `alpha` (all three required). Evidence, never proof." }, "test": { "enum": [ "chi_squared", "g_test" ], "description": "For a sampled intent: Pearson's chi-squared test, or the G-test (the likelihood ratio)." }, "alpha": { "type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 1, "description": "For a sampled intent: the significance level, as 0.01." }, "shots": { "type": "integer", "minimum": 1, "description": "For a sampled intent: the samples the test takes." }, "seed": { "type": "integer", "minimum": 0, "description": "For a sampled intent: the sampling seed (default: the job's)." }, "require": { "const": "proof" }, "note": { "type": "string" }, "name": { "type": "string" } } }, "minItems": 1 } ] }, "repair": { "description": "Repair the program first, on the lines its diagnostics flag alone (as repair_qasm does): true, or the choices {\"max_iterations\": N, \"dyadic_bits\": K, \"sizes\": {\"q\": 3}}. The result's \"repaired\" holds the program that ran and each repair." }, "mitigate": { "description": "Mitigate the job's expectation values (or, for readout, its counts) under its own noise: zne (the whole program folded U(U†U)^k and extrapolated), pea (the noise learned as a sparse Pauli–Lindblad model and amplified), pec (the learned channels inverted and sampled), cdr (a line fitted over near-Clifford training circuits), vd (two copies), readout (the counts' flips inverted). Needs noise and observables (shots for readout), at most 8 qubits. The result's `mitigation` gives raw and mitigated values with standard errors, the ideal value (known because this is a simulation), the method's bias and variance assumptions and its cost. A method's name, or an object.", "anyOf": [ { "type": "string", "enum": [ "zne", "pea", "pec", "cdr", "vd", "readout" ] }, { "type": "object", "required": [ "method" ], "properties": { "method": { "type": "string", "enum": [ "zne", "pea", "pec", "cdr", "vd", "readout" ] }, "shots": { "type": "integer", "minimum": 1, "maximum": 1000000, "description": "Shots per circuit (default 10000; 2000 per sampled circuit for pec)." }, "seed": { "type": "integer", "minimum": 0 }, "factors": { "type": "array", "items": { "type": "number" }, "description": "zne: odd whole numbers (default 1, 3, 5); pea: factors from 1 to 10 (default 1, 1.5, 2)." }, "extrapolation": { "type": "string", "enum": [ "richardson", "linear", "exponential" ] }, "samples": { "type": "integer", "minimum": 2, "description": "pec: sampled circuits (default 200)." }, "training": { "type": "integer", "minimum": 3, "description": "cdr: training circuits (default 16)." }, "keep": { "type": "integer", "minimum": 0, "description": "cdr: non-Clifford gates each training circuit keeps (default 2, and always one fewer than the program has)." }, "learn_shots": { "type": "integer", "minimum": 100, "description": "pea, pec: shots per depth of the cycle benchmarking that learns the noise (default 60000)." } } } ] } } }, "outputSchema": { "$id": "wai-quantum://schemas/run_on_target/1", "type": "object", "description": "A job as a host returns it: its status, the method its plan chose and why, the request as submitted, and, once it is done, the result with its receipt: a job's result, or for a set (a request with programs or a sweep, its method set) the set's result. The command line's run --json, the local MCP server's run_quantum_circuit and a run on the person's own provider give a finished job; the job service also gives its id and times, and a job still queued or running, or failed with its error. A job's receipt verifies from this document alone: request and result.", "anyOf": [ { "title": "wai.quantum.job/1", "description": "A job as a host returns it: its status, the method its plan chose and why, the request as submitted, and, once it is done, the result with its receipt: a job's result, or for a set (a request with programs or a sweep, its method set) the set's result. The command line's run --json, the local MCP server's run_quantum_circuit and a run on the person's own provider give a finished job; the job service also gives its id and times, and a job still queued or running, or failed with its error. A job's receipt verifies from this document alone: request and result.", "type": "object", "required": [ "status", "request" ], "properties": { "id": { "type": "string", "description": "The job service's id for the job." }, "status": { "enum": [ "queued", "running", "done", "failed", "cancelled" ] }, "method": { "type": "string", "description": "The method the plan chose; set for a set." }, "why": { "type": "string", "description": "Why the plan chose the method." }, "estimate": { "type": "object", "description": "What the plan admitted the job with.", "required": [ "memory_bytes", "work" ], "properties": { "memory_bytes": { "type": "integer", "minimum": 0 }, "work": { "type": "integer", "minimum": 0, "description": "In the method's own unit." } } }, "request": { "title": "wai.quantum.job-request/1", "description": "A job as a client submits it: a program and what is asked of it, or a set: many programs (programs), or one over a grid of its inputs (sweep), run as one job. The command line, both MCP servers, the job service, the desktop app and the Studio read it alike, and a receipt seals it as it was given. A member the engine does not read is ignored, and sealed with the rest.", "type": "object", "anyOf": [ { "required": [ "qasm" ] }, { "required": [ "programs" ] } ], "properties": { "qasm": { "type": "string", "description": "The program, in OpenQASM 3 or the OpenQASM 2 forms in common use." }, "shots": { "type": "integer", "minimum": 0, "maximum": 1000000, "description": "Measurement shots; 1024 when no observables or amplitudes are asked for, otherwise 0." }, "seed": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "The sampling seed (1 when not given): the same job and seed give the same counts." }, "method": { "type": "string", "description": "auto (the default: the strongest method the program admits), or a method by its name as the methods list names it." }, "observables": { "type": "array", "maxItems": 256, "description": "Pauli observables to take the expectation values of.", "items": { "anyOf": [ { "type": "string", "description": "A Pauli string, as \"Z0 Z1\"; qubits count from 0." }, { "type": "object", "required": [ "pauli" ], "properties": { "pauli": { "type": "string", "description": "A Pauli string, as \"X3\"." }, "coeff": { "type": "number", "description": "Its coefficient (1 when not given)." } } } ] } }, "amplitudes": { "type": "array", "maxItems": 64, "description": "Basis states whose amplitudes to return: one 0 or 1 per qubit, qubit n-1 first.", "items": { "type": "string" } }, "noise": { "type": "object", "description": "A noise model, each channel a probability. A channel not listed here is refused.", "additionalProperties": false, "properties": { "depolarizing_1q": { "type": "number", "minimum": 0, "maximum": 1 }, "depolarizing_2q": { "type": "number", "minimum": 0, "maximum": 1 }, "amplitude_damping": { "type": "number", "minimum": 0, "maximum": 1 }, "dephasing": { "type": "number", "minimum": 0, "maximum": 1 }, "readout": { "type": "number", "minimum": 0, "maximum": 1 } } }, "options": { "type": "object", "description": "Options of the method that runs the job, as the methods list names them (max_bond, cutoff, fusion, trajectories, threshold, max_weight, ladder, max_terms, path_restarts), and memory_gb." }, "compile": { "type": "object", "description": "What a compile is asked for, each optional: the most the output may differ from the program (epsilon, in the operator norm up to a global phase), the level (0 lowers and approximates; 1 also rewrites and folds phases; 2 also resynthesises), the basis, the gate set it writes the program in (clifford_t: every rotation off the multiples of π/4 a Clifford+T word; standard: nothing approximated), whether to give the circuit after each pass (stages), and the twirl and dd passes, last (twirl, with its seed; dd, with its sequence).", "properties": { "epsilon": { "type": "number", "exclusiveMinimum": 0 }, "level": { "type": "integer", "minimum": 0, "maximum": 2 }, "basis": { "enum": [ "clifford_t", "standard" ] }, "stages": { "type": "boolean" }, "twirl": { "description": "Twirl each two-qubit Clifford gate with Paulis drawn from a seeded stream: true (seed 1), or {\"seed\": N}. One seed is one instance, checked to be the same circuit.", "anyOf": [ { "type": "boolean" }, { "type": "object", "required": [ "seed" ], "properties": { "seed": { "type": "integer", "minimum": 0 } } } ] }, "dd": { "description": "Dynamical decoupling in each window where a qubit idles long enough: xx or xy4 (or {\"sequence\": …}), checked to change nothing without noise.", "anyOf": [ { "enum": [ "xx", "xy4" ] }, { "type": "boolean" }, { "type": "object", "properties": { "sequence": { "enum": [ "xx", "xy4" ] } } } ] } } }, "intent": { "description": "What the program must do, checked with the run: one intent or a list. The result's verdict says how far it was checked.", "anyOf": [ { "type": "object", "description": "One of distribution, equivalent, prepares or sampled, with its options.", "properties": { "distribution": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 } }, "tolerance": { "type": "number", "minimum": 0, "maximum": 1 }, "equivalent": { "type": "string" }, "prepares": { "type": "string" }, "sampled": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 } }, "test": { "enum": [ "chi_squared", "g_test" ] }, "alpha": { "type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 1 }, "shots": { "type": "integer", "minimum": 1 }, "seed": { "type": "integer", "minimum": 0 }, "require": { "const": "proof" }, "note": { "type": "string" }, "name": { "type": "string" } } }, { "type": "array", "minItems": 1, "items": { "type": "object", "description": "One of distribution, equivalent, prepares or sampled, with its options.", "properties": { "distribution": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 } }, "tolerance": { "type": "number", "minimum": 0, "maximum": 1 }, "equivalent": { "type": "string" }, "prepares": { "type": "string" }, "sampled": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 } }, "test": { "enum": [ "chi_squared", "g_test" ] }, "alpha": { "type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 1 }, "shots": { "type": "integer", "minimum": 1 }, "seed": { "type": "integer", "minimum": 0 }, "require": { "const": "proof" }, "note": { "type": "string" }, "name": { "type": "string" } } } } ] }, "verdict": { "type": "boolean", "description": "true: the result carries a verdict even with no intent." }, "target": { "description": "A device target: a built-in target's name, or a target document. The program is compiled to it, placed and simulated under its noise; noise may not be given beside it.", "anyOf": [ { "type": "string" }, { "title": "wai.quantum.target/1", "description": "A device target: its qubits, the pairs it couples, its native gates with their errors and durations, and the calibration snapshot they come from. A value not known is left out, never written as zero. Every field but format, name, source, qubits, gates and coupling is optional, and a field the format does not name is refused, so a misspelt one never reads as absent. Its canonical text is its RFC 8785 form, and the BLAKE3 of that text, the target's hash, names the snapshot in a receipt.", "type": "object", "required": [ "format", "name", "source", "qubits", "gates", "coupling" ], "additionalProperties": false, "properties": { "format": { "const": "wai.quantum.target/1" }, "name": { "type": "string", "minLength": 1, "maxLength": 200 }, "source": { "type": "object", "required": [ "format" ], "additionalProperties": false, "properties": { "format": { "type": "string", "description": "The format the target was read from (wai-quantum targets import --help lists them)." }, "note": { "type": "string", "maxLength": 400 } } }, "calibration": { "type": "object", "additionalProperties": false, "properties": { "id": { "type": "string", "maxLength": 400, "description": "The calibration snapshot's id, as the source names it, or a content id of the snapshot read." }, "timestamp": { "type": "string", "maxLength": 400, "description": "When the snapshot was taken, as the source writes it." } } }, "qubits": { "type": "array", "minItems": 1, "maxItems": 2048, "description": "Every qubit, in order.", "items": { "type": "object", "required": [ "qubit" ], "additionalProperties": false, "properties": { "qubit": { "type": "integer", "minimum": 0, "description": "Its index: its place in the list." }, "label": { "type": "string", "description": "The source's own name for it, when that is not its index." }, "t1_us": { "type": "number", "minimum": 0, "description": "T1, microseconds." }, "t2_us": { "type": "number", "minimum": 0, "description": "T2 (the echo or Ramsey time the source reports), microseconds." }, "frequency_ghz": { "type": "number", "minimum": 0, "description": "Its frequency, gigahertz." }, "readout": { "type": "object", "required": [ "p01", "p10" ], "additionalProperties": false, "properties": { "p01": { "type": "number", "minimum": 0, "maximum": 1, "description": "P(reads 1 | holds 0)." }, "p10": { "type": "number", "minimum": 0, "maximum": 1, "description": "P(reads 0 | holds 1)." } } }, "measure_ns": { "type": "number", "minimum": 0, "description": "The measurement's duration, nanoseconds." } } } }, "gates": { "type": "array", "maxItems": 262144, "description": "Each native gate where the device runs it, sorted by gate then qubits.", "items": { "type": "object", "required": [ "gate", "qubits" ], "additionalProperties": false, "properties": { "gate": { "type": "string", "pattern": "^[a-z0-9_]{1,40}$" }, "qubits": { "type": "array", "minItems": 1, "maxItems": 2, "items": { "type": "integer", "minimum": 0 } }, "error": { "type": "number", "minimum": 0, "maximum": 1, "description": "The average gate infidelity." }, "duration_ns": { "type": "number", "minimum": 0, "description": "Nanoseconds." } } } }, "coupling": { "type": "array", "description": "The pairs a two-qubit gate may act on, each once, the lower qubit first, sorted.", "items": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "type": "integer", "minimum": 0 } } } } } ] }, "repair": { "description": "Repair the program first on its flagged lines: true, or the choices.", "anyOf": [ { "type": "boolean" }, { "type": "object", "properties": { "max_iterations": { "type": "integer", "minimum": 1 }, "dyadic_bits": { "type": "integer", "minimum": 1, "maximum": 32 }, "sizes": { "type": "object", "additionalProperties": { "type": "integer", "minimum": 1 } } } } ] }, "history": { "type": "object", "description": "The program's history's account of the version the job runs: its digest, and the gates and lines in each hand. The receipt binds it; a history recomputes and checks it." }, "provider": { "type": "string", "description": "The person's own provider to run on, by the name their registry gives it. Only a host that holds their credentials runs such a job; every other host refuses it." }, "programs": { "type": "array", "minItems": 1, "items": { "anyOf": [ { "type": "string", "description": "A program's text." }, { "type": "object", "required": [ "qasm" ], "description": "A job of its own, read as a job request is (no programs or sweep in it); each item of the set's result holds its request in full." } ] }, "description": "A set (engine::sets): the programs to run as one job, each a program's text or a job of its own; the request's other fields apply to every item that does not set them itself." }, "sweep": { "type": "object", "additionalProperties": { "type": "array", "minItems": 1, "items": { "type": "number" } }, "description": "A set over the request's own qasm: values for each of the program's inputs (integer, float or angle), every combination run, the names in sorted order and the first varying slowest." }, "dry_run": { "type": "boolean", "description": "With true: what the host would do with the job or set, running nothing." }, "mitigate": { "description": "Mitigate the job's expectation values (or, for readout, its counts) under its noise (engine::mitigate): zne, pea, pec, cdr, vd or readout, or {\"method\", …} with its options. The result's mitigation gives each value raw and mitigated.", "anyOf": [ { "enum": [ "zne", "pea", "pec", "cdr", "vd", "readout" ] }, { "type": "object", "required": [ "method" ] } ] } } }, "result": { "anyOf": [ { "title": "wai.quantum.job-result/1", "description": "A job's result as the engine gives it, on every host: what was asked of the program, computed by the method its plan chose, with that method's accuracy class. The receipt seals the result without its receipt member, beside the request. A result names the engine that made it and this schema (engine and schema); results made before results carried them have neither and follow this schema all the same.", "type": "object", "required": [ "method", "qubits", "gates", "accuracy" ], "properties": { "engine": { "type": "object", "description": "The engine that made the result: the wai-quantum crate's name and version.", "required": [ "name", "version" ], "properties": { "name": { "const": "wai-quantum" }, "version": { "type": "string", "description": "Its semantic version, as MAJOR.MINOR.PATCH." } } }, "schema": { "const": "wai.quantum.job-result/1", "description": "The schema the result follows." }, "method": { "type": "string", "description": "The method that ran the job (provider for a run on the person's own provider)." }, "qubits": { "type": "integer", "minimum": 0 }, "gates": { "type": "integer", "minimum": 0 }, "accuracy": { "type": "object", "description": "What the method promises of the numbers it gave.", "required": [ "class" ], "properties": { "class": { "enum": [ "bit-exact", "exact", "single", "bounded", "estimate", "heuristic", "measured" ], "description": "bit-exact: the same bits on every machine; exact: no approximation beyond double-precision rounding; single: single-precision arithmetic; bounded: a rigorous bound beside each value; estimate: a statistical estimate with its standard error; heuristic: an approximation with an estimate of its error, not a bound; measured: counts a device returned, not reproducible by recomputation." }, "note": { "type": "string" }, "fusion": { "type": "integer" }, "device": { "type": "string" }, "threshold": { "type": "number" }, "max_weight": { "type": [ "integer", "null" ] }, "max_bond": { "type": "integer" }, "max_bond_used": { "type": "integer" }, "discarded_weight": { "type": "number" }, "fidelity_estimate": { "type": "number" }, "truncations": { "type": "integer" }, "shots": { "type": "integer" }, "trajectories": { "type": "integer" }, "histories": { "type": "integer" }, "gate_applications": { "type": "integer" }, "max_cut": { "type": "integer" }, "order_work": { "type": "number" }, "batch": { "type": "integer" } } }, "state_hash": { "type": "string", "description": "The bit-exact method's statevector hash (BLAKE3, hex): the same on every machine." }, "counts": { "type": "object", "description": "Outcomes and their counts, keyed by the program's classical bits, the highest bit first. At most 65536 outcomes are listed; omitted_shots holds the rest.", "additionalProperties": { "type": "integer", "minimum": 0 } }, "distinct_outcomes": { "type": "integer", "minimum": 0 }, "omitted_shots": { "type": "integer", "minimum": 0 }, "outcome_dimension": { "type": "integer", "minimum": 0, "description": "The stabilizer method: the dimension of the measured outcomes' affine space." }, "shots": { "type": "integer", "minimum": 0, "description": "The shots, where the method names them in the result (trajectories, provider)." }, "expectations": { "type": "array", "items": { "type": "object", "required": [ "observable", "coeff", "value" ], "properties": { "observable": { "type": "string" }, "coeff": { "type": "number" }, "value": { "type": "number", "description": "The coefficient times the expectation value." }, "stderr": { "type": "number", "description": "The standard error, for an estimate." }, "bound": { "type": "number", "description": "A rigorous bound on |exact − value|, for the bounded class." }, "peak_terms": { "type": "integer" }, "threshold_reached": { "type": "number" }, "max_terms": { "type": "integer" }, "ladder": { "type": "array", "description": "The value at thresholds a decade apart, the asked one last.", "items": { "type": "object", "required": [ "threshold", "value", "bound" ], "properties": { "threshold": { "type": "number" }, "value": { "type": "number" }, "bound": { "type": "number" }, "peak_terms": { "type": "integer" }, "threshold_reached": { "type": "number" } } } } } } }, "amplitudes": { "type": "array", "items": { "type": "object", "required": [ "bits", "re", "im" ], "properties": { "bits": { "type": "string", "description": "One 0 or 1 per qubit, qubit n-1 first." }, "re": { "type": "number" }, "im": { "type": "number" } } } }, "global_phase": { "type": "string", "description": "Why the amplitudes' global phase is not fixed, when it is not." }, "warning": { "type": "string" }, "contraction_flops": { "type": "number", "description": "The tensor network's contraction cost." }, "dynamic": { "type": "object", "description": "A program that measures in the middle, resets or branches on a measured bit: how it ran.", "properties": { "measurements_and_resets": { "type": "integer", "minimum": 0 }, "branches_run": { "type": "integer", "minimum": 0 }, "states_at_once": { "type": "integer", "minimum": 0 }, "branches_weighed": { "type": "integer", "minimum": 0 } } }, "outputs": { "type": "array", "description": "The program's output declarations: each its name and type, and its value, or the places of its bits in each outcome.", "items": { "type": "object", "required": [ "name", "type" ], "properties": { "name": { "type": "string" }, "type": { "type": "string" }, "bits": { "type": "array", "items": { "type": "integer", "minimum": 0 } }, "value": { "description": "A number, a boolean, a bit string, a duration's text, {\"re\", \"im\"}, or an array of them." } } } }, "timing": { "type": "object", "description": "A program that states durations (delay, box, stretch) the method does not apply: said so, with the reader's code.", "required": [ "applied", "why" ], "properties": { "applied": { "type": "boolean" }, "code": { "type": "string" }, "why": { "type": "string" } } }, "diagnostics": { "type": "array", "description": "The reader's warnings and notes on the program, each with its code.", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "compiled": { "description": "How the program was compiled before it ran: on the person's own provider, to the device's gates; or, asked with compile, to a basis within a budget. Either way, basis is the gate set it was compiled to.", "anyOf": [ { "type": "object", "description": "A provider job: the program sent, compiled exactly to the device's own gates: its basis (the device's gate set), the BLAKE3 of its OpenQASM 3 text, its counts of gates and swaps, its layouts, and the check it passed before it was sent.", "required": [ "basis", "program" ], "properties": { "basis": { "type": "string" }, "program": { "type": "string" }, "hash": { "type": "string" }, "native_gates": { "type": "integer" }, "two_qubit_gates": { "type": "integer" }, "swaps": { "type": "integer" }, "layout": { "type": "array", "items": { "type": "integer" } }, "final_layout": { "type": "array", "items": { "type": "integer" } }, "checked": { "type": "string" }, "placement": { "type": "object", "description": "Where the program was placed on the device's qubits, and why." } } }, { "type": "object", "description": "A job asked to compile its program first: what ran is the compiled circuit, within distance of the program in the operator norm up to a global phase.", "required": [ "basis", "verdict" ], "properties": { "basis": { "enum": [ "clifford_t", "standard" ], "description": "The gate set the program was compiled to." }, "level": { "type": "integer", "minimum": 0 }, "epsilon": { "type": "number", "description": "The budget asked for." }, "distance": { "type": [ "number", "null" ], "description": "The bound the passes' distances add to." }, "verdict": { "type": "string" }, "source": { "type": "object", "description": "A circuit's counts, as the compiler counts them.", "properties": { "gates": { "type": "integer", "minimum": 0 }, "one_qubit": { "type": "integer", "minimum": 0 }, "two_qubit": { "type": "integer", "minimum": 0 }, "three_qubit": { "type": "integer", "minimum": 0 }, "cnots": { "type": "integer", "minimum": 0 }, "t_count": { "type": "integer", "minimum": 0 }, "rotations": { "type": "integer", "minimum": 0 }, "depth": { "type": "integer", "minimum": 0 } } }, "output": { "type": "object", "description": "A circuit's counts, as the compiler counts them.", "properties": { "gates": { "type": "integer", "minimum": 0 }, "one_qubit": { "type": "integer", "minimum": 0 }, "two_qubit": { "type": "integer", "minimum": 0 }, "three_qubit": { "type": "integer", "minimum": 0 }, "cnots": { "type": "integer", "minimum": 0 }, "t_count": { "type": "integer", "minimum": 0 }, "rotations": { "type": "integer", "minimum": 0 }, "depth": { "type": "integer", "minimum": 0 } } }, "certificate": { "type": [ "string", "null" ], "description": "The BLAKE3 of the compile certificate's RFC 8785 text, in hex." }, "note": { "type": "string" } } } ] }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } }, "target": { "type": "object", "description": "A run on a device target: which target (its hash, as its receipt binds it), its calibration snapshot, where the program was placed and why, and the noise derived from the target.", "required": [ "name", "hash" ], "properties": { "name": { "type": "string" }, "hash": { "type": "string" }, "hash_is": { "type": "string" }, "calibration": { "type": "object", "properties": { "id": { "type": "string" }, "timestamp": { "type": "string" } } }, "source": { "type": "object", "properties": { "format": { "type": "string" }, "note": { "type": "string" } } }, "placement": { "type": "object", "description": "The native gate set, the layout and routes chosen, the swaps, the expected success beside the fewest-swaps layout's, and the check of the compiled program." }, "noise": { "type": "object", "description": "The noise model derived from the target's calibration: its channels, durations and idling, and each qubit's readout." } } }, "repaired": { "type": "object", "description": "A job asked to repair its program first: the program that ran, each repair, and what needs a person.", "properties": { "qasm": { "type": "string" }, "repairs": { "type": "array", "items": { "type": "object", "required": [ "code", "by", "edits" ], "properties": { "code": { "type": "string" }, "rule": { "type": "string" }, "by": { "enum": [ "engine", "proposal" ] }, "flagged": { "type": "array", "items": { "type": "integer" } }, "edits": { "type": "array", "items": { "type": "object", "properties": { "line": { "type": "integer" }, "before": { "type": [ "string", "null" ] }, "after": { "type": [ "string", "null" ] } } } } } } }, "needs_person": { "type": "array", "items": { "type": "object" } } } }, "elapsed_ms": { "type": "integer", "minimum": 0, "description": "Wall time of the run, where the host has a clock (not in a browser tab)." }, "energy": { "description": "The CPU energy of the job's process as the kernel counts it, with its uncertainty and what it leaves out, or unmetered with the reason.", "anyOf": [ { "type": "object", "required": [ "unmetered" ], "properties": { "unmetered": { "type": "string" }, "service_kwh": { "type": "number", "description": "A provider job: the provider's own figure." }, "service_kwh_is": { "type": "string" } } }, { "type": "object", "required": [ "joules_micro", "energy_provenance", "coverage" ], "properties": { "joules_micro": { "type": "integer", "minimum": 1 }, "energy_provenance": { "type": "string" }, "energy_uncertainty": { "type": "object", "properties": { "relative_ppm": { "type": "integer" }, "window_us": { "type": "integer" } } }, "energy_counter_filtering": { "type": "string" }, "coverage": { "enum": [ "whole", "partial" ] }, "covers": { "type": "string" }, "excludes": { "type": "array", "items": { "type": "string" } }, "cpu_ms": { "type": "integer" }, "source": { "type": "string" }, "attribution": { "enum": [ "process", "none" ], "description": "Whose energy it is: the job's worker process, or none (the processor packages' over the job's window, every process on the host in it)." }, "packages": { "type": "integer", "minimum": 1, "description": "The processor packages read." }, "concurrent_jobs": { "type": "integer", "minimum": 0, "description": "Other jobs that ran on the host during the window." }, "counter": { "type": "object", "description": "The package counter as seen: the longest it went between updates, and the smallest step it took.", "properties": { "update_us": { "type": "integer", "minimum": 0 }, "step_uj": { "type": "integer", "minimum": 0 } } }, "declared": { "type": "string", "description": "What the stated uncertainty covers, and what it does not." } } } ] }, "receipt": { "anyOf": [ { "title": "wai.quantum.receipt/2", "description": "A result's receipt: an Ed25519 signature, by the key it names, over digest = BLAKE3(\"wai:quantum-service-receipt\\x02\" ‖ len ‖ request ‖ len ‖ result), each of request and result in its RFC 8785 canonical text (the result without its receipt member), each length 8 bytes big-endian. Whatever members the request and the result hold are sealed, the result's engine and schema among them. The first receipts (no canon member, $defs/first) signed serde_json's own text under the domain ending \\x01; they still verify.", "type": "object", "required": [ "alg", "canon", "key", "digest", "signature" ], "properties": { "alg": { "const": "ed25519" }, "canon": { "const": "rfc8785", "description": "The canonical form the digest is taken over." }, "key": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The signing key, 32 bytes in hex." }, "digest": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The digest signed, 32 bytes in hex." }, "signature": { "type": "string", "minLength": 128, "maxLength": 128, "description": "The signature, 64 bytes in hex." } } }, { "description": "The first form, before canon: the digest is over serde_json's own text of each, under the domain ending \\x01. Never written now; still verified.", "type": "object", "required": [ "alg", "key", "digest", "signature" ], "properties": { "alg": { "const": "ed25519" }, "key": { "type": "string", "minLength": 64, "maxLength": 64 }, "digest": { "type": "string", "minLength": 64, "maxLength": 64 }, "signature": { "type": "string", "minLength": 128, "maxLength": 128 } } } ] }, "provider": { "type": "object", "description": "A provider job: the provider's name, kind and protocol, the device, its provenance, and the hash of its description." }, "calibration": { "type": [ "string", "null" ], "description": "A provider job: the calibration snapshot it ran under." }, "job": { "type": "object", "description": "A provider job: the provider's job id and its status checks." }, "ideal": { "description": "A provider job: the circuit's exact distribution set beside the measured counts.", "anyOf": [ { "type": "object", "required": [ "computed", "total_variation_distance", "hellinger_fidelity" ], "properties": { "computed": { "const": true }, "method": { "type": "string" }, "total_variation_distance": { "type": "number" }, "hellinger_fidelity": { "type": "number" }, "sampling_tvd_expected": { "type": "number" }, "ideal_outcomes": { "type": "integer" }, "note": { "type": "string" } } }, { "type": "object", "required": [ "computed", "why" ], "properties": { "computed": { "const": false }, "why": { "type": "string" } } } ] }, "cost": { "type": "object", "description": "A provider job: the estimate shown before it was sent, what the provider says it charged, and whether the person confirmed a run that was not free." }, "provenance": { "title": "wai.quantum.provenance/1", "description": "What a result came from, under the five categories cross-platform provenance surveys use: the circuit, the computer, the compilation, the execution and the software. A host adds it to the results it seals (the job service does, and each item of a set); a result without it reads as it always did. wai-quantum-service/docs/provenance.md maps every field to where it is and whether the receipt seals it.", "type": "object", "required": [ "schema", "circuit", "computer", "compilation", "execution", "software" ], "properties": { "schema": { "const": "wai.quantum.provenance/1" }, "circuit": { "type": "object", "description": "The program: the BLAKE3 digest of its text as given, its qubits and its gates.", "required": [ "program" ], "properties": { "program": { "type": "string", "description": "BLAKE3 of the program's text, in hex." }, "qubits": { "type": "integer", "minimum": 0 }, "gates": { "type": [ "integer", "null" ] } } }, "computer": { "type": "object", "description": "What ran it: a classical simulator, the method and its accuracy class, and a device target's hash when the job named one.", "required": [ "kind", "method" ], "properties": { "kind": { "const": "simulator" }, "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "target": { "type": "string", "description": "The device target's hash; its layout, routes and noise are in the result's own target." } } }, "compilation": { "type": "object", "description": "Whether the job asked to be compiled; if it did, each pass in order with its check's verdict, the certificate's digest, the gate set compiled to (its basis), the level, the ε budget and the distance the result carries, and that no pass draws a random number.", "required": [ "asked" ], "properties": { "asked": { "type": "boolean" }, "passes": { "type": [ "array", "null" ], "items": { "type": "object", "properties": { "pass": { "type": "string" }, "verdict": { "type": [ "string", "null" ] } } } }, "certificate": { "type": [ "string", "null" ] }, "basis": { "type": [ "string", "null" ], "description": "The gate set compiled to: clifford_t or standard." }, "level": { "type": [ "integer", "null" ] }, "epsilon": { "type": [ "number", "null" ] }, "distance": { "type": [ "number", "null" ] }, "seeded": { "const": false }, "device": { "type": "string", "description": "A job on a device target, compiled exactly to its gates: where its layout and routes are." }, "status": { "const": "not-applicable" }, "why": { "type": "string" } } }, "execution": { "type": "object", "description": "The shots, the seed and the plan the job ran under; its identifier and times are the host's, outside the result.", "required": [ "plan" ], "properties": { "shots": { "type": [ "integer", "null" ] }, "seed": { "type": [ "integer", "null" ] }, "plan": { "type": "object", "properties": { "method": { "type": "string" }, "why": { "type": "string" }, "memory_bytes": { "type": "integer", "minimum": 0 }, "work": { "type": "integer", "minimum": 0 } } } } }, "software": { "type": "object", "description": "The engine's name and version, and the host's.", "required": [ "engine", "host" ], "properties": { "engine": { "type": "string" }, "host": { "type": "string" } } } } }, "mitigation": { "title": "wai.quantum.mitigation/1", "description": "A job's mitigation (its request's mitigate, engine::mitigate), in its result: the method and the options it ran with, its bias and variance assumptions, each observable raw and mitigated with a standard error each and the ideal value (or, for readout, the counts inverted as a quasi-distribution), the method's own details and what it spent. docs/qec.md describes each method.", "type": "object", "required": [ "method", "options", "assumptions" ], "properties": { "method": { "enum": [ "zne", "pea", "pec", "cdr", "vd", "readout" ] }, "options": { "type": "object", "description": "The options it ran with, the defaults filled in.", "properties": { "method": { "type": "string" }, "shots": { "type": "integer" }, "seed": { "type": "integer" }, "factors": { "type": "array", "items": { "type": "number" } }, "extrapolation": { "enum": [ "richardson", "linear", "exponential" ] }, "samples": { "type": "integer" }, "training": { "type": "integer" }, "keep": { "type": "integer" }, "learn_shots": { "type": "integer" } } }, "assumptions": { "type": "object", "properties": { "bias": { "type": "string" }, "variance": { "type": "string" } } }, "noise": { "type": "string", "description": "How the job's noise model is read for the method." }, "note": { "type": "string" }, "observables": { "type": "array", "items": { "type": "object", "description": "One observable: its raw value and the mitigated one, each with its standard error, and the ideal value a simulation knows.", "properties": { "observable": { "type": "string" }, "coeff": { "type": "number" }, "raw": { "type": "number" }, "raw_stderr": { "type": "number" }, "mitigated": { "type": "number" }, "stderr": { "type": "number" }, "ideal": { "type": "number" } } } }, "distribution": { "type": "array", "description": "readout: each outcome's raw share and its mitigated quasi-probability, with its standard error.", "items": { "type": "object", "properties": { "bits": { "type": "string" }, "raw": { "type": "number" }, "mitigated": { "type": "number" }, "stderr": { "type": "number" } } } }, "details": { "type": "object", "description": "The method's own: the folded scales and the folding check (zne), the learned model and the amplified values (pea), the quasi-probability and the value it converges to (pec), the training fits (cdr), the purity (vd), the flip and its amplification (readout).", "additionalProperties": true }, "cost": { "type": "object", "description": "The circuits and shots it spent beyond the job's own.", "properties": { "circuits": { "type": "integer", "minimum": 0 }, "shots": { "type": "integer", "minimum": 0 }, "note": { "type": "string" } } } } } } }, { "title": "wai.quantum.set/1", "description": "A set's result: many programs, or one program over a grid of its inputs, run as one job (engine::sets). Its head holds the count, how many items finished and failed, the Merkle root over the items' leaves, the set's energy and time; the set's receipt seals the set's request and its head. Each item is a plain job with its own receipt, its index, its point in a sweep, and its path to the root, so it is shown sealed by the set alone. A result names the engine that made it and this schema (engine and schema).", "type": "object", "required": [ "format", "count", "done", "failed", "root", "items" ], "properties": { "engine": { "type": "object", "description": "The engine that made the result: the wai-quantum crate's name and version.", "required": [ "name", "version" ], "properties": { "name": { "const": "wai-quantum" }, "version": { "type": "string" } } }, "schema": { "const": "wai.quantum.set/1" }, "format": { "const": "wai.quantum.set/1" }, "count": { "type": "integer", "minimum": 1 }, "done": { "type": "integer", "minimum": 0 }, "failed": { "type": "integer", "minimum": 0 }, "root": { "type": "string", "description": "The Merkle root of the items' leaves, in hex (domains moq-jwp:merkle-leaf and moq-jwp:merkle-node, version 1)." }, "energy": { "description": "The CPU energy of the job's process as the kernel counts it, with its uncertainty and what it leaves out, or unmetered with the reason.", "anyOf": [ { "type": "object", "required": [ "unmetered" ], "properties": { "unmetered": { "type": "string" }, "service_kwh": { "type": "number", "description": "A provider job: the provider's own figure." }, "service_kwh_is": { "type": "string" } } }, { "type": "object", "required": [ "joules_micro", "energy_provenance", "coverage" ], "properties": { "joules_micro": { "type": "integer", "minimum": 1 }, "energy_provenance": { "type": "string" }, "energy_uncertainty": { "type": "object", "properties": { "relative_ppm": { "type": "integer" }, "window_us": { "type": "integer" } } }, "energy_counter_filtering": { "type": "string" }, "coverage": { "enum": [ "whole", "partial" ] }, "covers": { "type": "string" }, "excludes": { "type": "array", "items": { "type": "string" } }, "cpu_ms": { "type": "integer" }, "source": { "type": "string" }, "attribution": { "enum": [ "process", "none" ], "description": "Whose energy it is: the job's worker process, or none (the processor packages' over the job's window, every process on the host in it)." }, "packages": { "type": "integer", "minimum": 1, "description": "The processor packages read." }, "concurrent_jobs": { "type": "integer", "minimum": 0, "description": "Other jobs that ran on the host during the window." }, "counter": { "type": "object", "description": "The package counter as seen: the longest it went between updates, and the smallest step it took.", "properties": { "update_us": { "type": "integer", "minimum": 0 }, "step_uj": { "type": "integer", "minimum": 0 } } }, "declared": { "type": "string", "description": "What the stated uncertainty covers, and what it does not." } } } ] }, "elapsed_ms": { "type": "integer", "minimum": 0 }, "receipt": { "title": "wai.quantum.receipt/2", "description": "A result's receipt: an Ed25519 signature, by the key it names, over digest = BLAKE3(\"wai:quantum-service-receipt\\x02\" ‖ len ‖ request ‖ len ‖ result), each of request and result in its RFC 8785 canonical text (the result without its receipt member), each length 8 bytes big-endian. Whatever members the request and the result hold are sealed, the result's engine and schema among them. The first receipts (no canon member, $defs/first) signed serde_json's own text under the domain ending \\x01; they still verify.", "type": "object", "required": [ "alg", "canon", "key", "digest", "signature" ], "properties": { "alg": { "const": "ed25519" }, "canon": { "const": "rfc8785", "description": "The canonical form the digest is taken over." }, "key": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The signing key, 32 bytes in hex." }, "digest": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The digest signed, 32 bytes in hex." }, "signature": { "type": "string", "minLength": 128, "maxLength": 128, "description": "The signature, 64 bytes in hex." } } }, "items": { "type": "array", "items": { "type": "object", "description": "One item: its index, its point in a sweep, its request (a plain job, complete in itself), and its result with its own receipt, or why it failed; and its path to the set's root.", "required": [ "index", "request", "status", "path" ], "properties": { "index": { "type": "integer", "minimum": 0 }, "point": { "type": "object", "description": "A sweep's item: the value of each input it was run at." }, "status": { "enum": [ "done", "failed" ] }, "method": { "type": "string" }, "why": { "type": "string" }, "request": { "title": "wai.quantum.job-request/1", "description": "A job as a client submits it: a program and what is asked of it, or a set: many programs (programs), or one over a grid of its inputs (sweep), run as one job. The command line, both MCP servers, the job service, the desktop app and the Studio read it alike, and a receipt seals it as it was given. A member the engine does not read is ignored, and sealed with the rest.", "type": "object", "anyOf": [ { "required": [ "qasm" ] }, { "required": [ "programs" ] } ], "properties": { "qasm": { "type": "string", "description": "The program, in OpenQASM 3 or the OpenQASM 2 forms in common use." }, "shots": { "type": "integer", "minimum": 0, "maximum": 1000000, "description": "Measurement shots; 1024 when no observables or amplitudes are asked for, otherwise 0." }, "seed": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "The sampling seed (1 when not given): the same job and seed give the same counts." }, "method": { "type": "string", "description": "auto (the default: the strongest method the program admits), or a method by its name as the methods list names it." }, "observables": { "type": "array", "maxItems": 256, "description": "Pauli observables to take the expectation values of.", "items": { "anyOf": [ { "type": "string", "description": "A Pauli string, as \"Z0 Z1\"; qubits count from 0." }, { "type": "object", "required": [ "pauli" ], "properties": { "pauli": { "type": "string", "description": "A Pauli string, as \"X3\"." }, "coeff": { "type": "number", "description": "Its coefficient (1 when not given)." } } } ] } }, "amplitudes": { "type": "array", "maxItems": 64, "description": "Basis states whose amplitudes to return: one 0 or 1 per qubit, qubit n-1 first.", "items": { "type": "string" } }, "noise": { "type": "object", "description": "A noise model, each channel a probability. A channel not listed here is refused.", "additionalProperties": false, "properties": { "depolarizing_1q": { "type": "number", "minimum": 0, "maximum": 1 }, "depolarizing_2q": { "type": "number", "minimum": 0, "maximum": 1 }, "amplitude_damping": { "type": "number", "minimum": 0, "maximum": 1 }, "dephasing": { "type": "number", "minimum": 0, "maximum": 1 }, "readout": { "type": "number", "minimum": 0, "maximum": 1 } } }, "options": { "type": "object", "description": "Options of the method that runs the job, as the methods list names them (max_bond, cutoff, fusion, trajectories, threshold, max_weight, ladder, max_terms, path_restarts), and memory_gb." }, "compile": { "type": "object", "description": "What a compile is asked for, each optional: the most the output may differ from the program (epsilon, in the operator norm up to a global phase), the level (0 lowers and approximates; 1 also rewrites and folds phases; 2 also resynthesises), the basis, the gate set it writes the program in (clifford_t: every rotation off the multiples of π/4 a Clifford+T word; standard: nothing approximated), whether to give the circuit after each pass (stages), and the twirl and dd passes, last (twirl, with its seed; dd, with its sequence).", "properties": { "epsilon": { "type": "number", "exclusiveMinimum": 0 }, "level": { "type": "integer", "minimum": 0, "maximum": 2 }, "basis": { "enum": [ "clifford_t", "standard" ] }, "stages": { "type": "boolean" }, "twirl": { "description": "Twirl each two-qubit Clifford gate with Paulis drawn from a seeded stream: true (seed 1), or {\"seed\": N}. One seed is one instance, checked to be the same circuit.", "anyOf": [ { "type": "boolean" }, { "type": "object", "required": [ "seed" ], "properties": { "seed": { "type": "integer", "minimum": 0 } } } ] }, "dd": { "description": "Dynamical decoupling in each window where a qubit idles long enough: xx or xy4 (or {\"sequence\": …}), checked to change nothing without noise.", "anyOf": [ { "enum": [ "xx", "xy4" ] }, { "type": "boolean" }, { "type": "object", "properties": { "sequence": { "enum": [ "xx", "xy4" ] } } } ] } } }, "intent": { "description": "What the program must do, checked with the run: one intent or a list. The result's verdict says how far it was checked.", "anyOf": [ { "type": "object", "description": "One of distribution, equivalent, prepares or sampled, with its options.", "properties": { "distribution": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 } }, "tolerance": { "type": "number", "minimum": 0, "maximum": 1 }, "equivalent": { "type": "string" }, "prepares": { "type": "string" }, "sampled": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 } }, "test": { "enum": [ "chi_squared", "g_test" ] }, "alpha": { "type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 1 }, "shots": { "type": "integer", "minimum": 1 }, "seed": { "type": "integer", "minimum": 0 }, "require": { "const": "proof" }, "note": { "type": "string" }, "name": { "type": "string" } } }, { "type": "array", "minItems": 1, "items": { "type": "object", "description": "One of distribution, equivalent, prepares or sampled, with its options.", "properties": { "distribution": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 } }, "tolerance": { "type": "number", "minimum": 0, "maximum": 1 }, "equivalent": { "type": "string" }, "prepares": { "type": "string" }, "sampled": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 } }, "test": { "enum": [ "chi_squared", "g_test" ] }, "alpha": { "type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 1 }, "shots": { "type": "integer", "minimum": 1 }, "seed": { "type": "integer", "minimum": 0 }, "require": { "const": "proof" }, "note": { "type": "string" }, "name": { "type": "string" } } } } ] }, "verdict": { "type": "boolean", "description": "true: the result carries a verdict even with no intent." }, "target": { "description": "A device target: a built-in target's name, or a target document. The program is compiled to it, placed and simulated under its noise; noise may not be given beside it.", "anyOf": [ { "type": "string" }, { "title": "wai.quantum.target/1", "description": "A device target: its qubits, the pairs it couples, its native gates with their errors and durations, and the calibration snapshot they come from. A value not known is left out, never written as zero. Every field but format, name, source, qubits, gates and coupling is optional, and a field the format does not name is refused, so a misspelt one never reads as absent. Its canonical text is its RFC 8785 form, and the BLAKE3 of that text, the target's hash, names the snapshot in a receipt.", "type": "object", "required": [ "format", "name", "source", "qubits", "gates", "coupling" ], "additionalProperties": false, "properties": { "format": { "const": "wai.quantum.target/1" }, "name": { "type": "string", "minLength": 1, "maxLength": 200 }, "source": { "type": "object", "required": [ "format" ], "additionalProperties": false, "properties": { "format": { "type": "string", "description": "The format the target was read from (wai-quantum targets import --help lists them)." }, "note": { "type": "string", "maxLength": 400 } } }, "calibration": { "type": "object", "additionalProperties": false, "properties": { "id": { "type": "string", "maxLength": 400, "description": "The calibration snapshot's id, as the source names it, or a content id of the snapshot read." }, "timestamp": { "type": "string", "maxLength": 400, "description": "When the snapshot was taken, as the source writes it." } } }, "qubits": { "type": "array", "minItems": 1, "maxItems": 2048, "description": "Every qubit, in order.", "items": { "type": "object", "required": [ "qubit" ], "additionalProperties": false, "properties": { "qubit": { "type": "integer", "minimum": 0, "description": "Its index: its place in the list." }, "label": { "type": "string", "description": "The source's own name for it, when that is not its index." }, "t1_us": { "type": "number", "minimum": 0, "description": "T1, microseconds." }, "t2_us": { "type": "number", "minimum": 0, "description": "T2 (the echo or Ramsey time the source reports), microseconds." }, "frequency_ghz": { "type": "number", "minimum": 0, "description": "Its frequency, gigahertz." }, "readout": { "type": "object", "required": [ "p01", "p10" ], "additionalProperties": false, "properties": { "p01": { "type": "number", "minimum": 0, "maximum": 1, "description": "P(reads 1 | holds 0)." }, "p10": { "type": "number", "minimum": 0, "maximum": 1, "description": "P(reads 0 | holds 1)." } } }, "measure_ns": { "type": "number", "minimum": 0, "description": "The measurement's duration, nanoseconds." } } } }, "gates": { "type": "array", "maxItems": 262144, "description": "Each native gate where the device runs it, sorted by gate then qubits.", "items": { "type": "object", "required": [ "gate", "qubits" ], "additionalProperties": false, "properties": { "gate": { "type": "string", "pattern": "^[a-z0-9_]{1,40}$" }, "qubits": { "type": "array", "minItems": 1, "maxItems": 2, "items": { "type": "integer", "minimum": 0 } }, "error": { "type": "number", "minimum": 0, "maximum": 1, "description": "The average gate infidelity." }, "duration_ns": { "type": "number", "minimum": 0, "description": "Nanoseconds." } } } }, "coupling": { "type": "array", "description": "The pairs a two-qubit gate may act on, each once, the lower qubit first, sorted.", "items": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "type": "integer", "minimum": 0 } } } } } ] }, "repair": { "description": "Repair the program first on its flagged lines: true, or the choices.", "anyOf": [ { "type": "boolean" }, { "type": "object", "properties": { "max_iterations": { "type": "integer", "minimum": 1 }, "dyadic_bits": { "type": "integer", "minimum": 1, "maximum": 32 }, "sizes": { "type": "object", "additionalProperties": { "type": "integer", "minimum": 1 } } } } ] }, "history": { "type": "object", "description": "The program's history's account of the version the job runs: its digest, and the gates and lines in each hand. The receipt binds it; a history recomputes and checks it." }, "provider": { "type": "string", "description": "The person's own provider to run on, by the name their registry gives it. Only a host that holds their credentials runs such a job; every other host refuses it." }, "programs": { "type": "array", "minItems": 1, "items": { "anyOf": [ { "type": "string", "description": "A program's text." }, { "type": "object", "required": [ "qasm" ], "description": "A job of its own, read as a job request is (no programs or sweep in it); each item of the set's result holds its request in full." } ] }, "description": "A set (engine::sets): the programs to run as one job, each a program's text or a job of its own; the request's other fields apply to every item that does not set them itself." }, "sweep": { "type": "object", "additionalProperties": { "type": "array", "minItems": 1, "items": { "type": "number" } }, "description": "A set over the request's own qasm: values for each of the program's inputs (integer, float or angle), every combination run, the names in sorted order and the first varying slowest." }, "dry_run": { "type": "boolean", "description": "With true: what the host would do with the job or set, running nothing." }, "mitigate": { "description": "Mitigate the job's expectation values (or, for readout, its counts) under its noise (engine::mitigate): zne, pea, pec, cdr, vd or readout, or {\"method\", …} with its options. The result's mitigation gives each value raw and mitigated.", "anyOf": [ { "enum": [ "zne", "pea", "pec", "cdr", "vd", "readout" ] }, { "type": "object", "required": [ "method" ] } ] } } }, "result": { "title": "wai.quantum.job-result/1", "description": "A job's result as the engine gives it, on every host: what was asked of the program, computed by the method its plan chose, with that method's accuracy class. The receipt seals the result without its receipt member, beside the request. A result names the engine that made it and this schema (engine and schema); results made before results carried them have neither and follow this schema all the same.", "type": "object", "required": [ "method", "qubits", "gates", "accuracy" ], "properties": { "engine": { "type": "object", "description": "The engine that made the result: the wai-quantum crate's name and version.", "required": [ "name", "version" ], "properties": { "name": { "const": "wai-quantum" }, "version": { "type": "string", "description": "Its semantic version, as MAJOR.MINOR.PATCH." } } }, "schema": { "const": "wai.quantum.job-result/1", "description": "The schema the result follows." }, "method": { "type": "string", "description": "The method that ran the job (provider for a run on the person's own provider)." }, "qubits": { "type": "integer", "minimum": 0 }, "gates": { "type": "integer", "minimum": 0 }, "accuracy": { "type": "object", "description": "What the method promises of the numbers it gave.", "required": [ "class" ], "properties": { "class": { "enum": [ "bit-exact", "exact", "single", "bounded", "estimate", "heuristic", "measured" ], "description": "bit-exact: the same bits on every machine; exact: no approximation beyond double-precision rounding; single: single-precision arithmetic; bounded: a rigorous bound beside each value; estimate: a statistical estimate with its standard error; heuristic: an approximation with an estimate of its error, not a bound; measured: counts a device returned, not reproducible by recomputation." }, "note": { "type": "string" }, "fusion": { "type": "integer" }, "device": { "type": "string" }, "threshold": { "type": "number" }, "max_weight": { "type": [ "integer", "null" ] }, "max_bond": { "type": "integer" }, "max_bond_used": { "type": "integer" }, "discarded_weight": { "type": "number" }, "fidelity_estimate": { "type": "number" }, "truncations": { "type": "integer" }, "shots": { "type": "integer" }, "trajectories": { "type": "integer" }, "histories": { "type": "integer" }, "gate_applications": { "type": "integer" }, "max_cut": { "type": "integer" }, "order_work": { "type": "number" }, "batch": { "type": "integer" } } }, "state_hash": { "type": "string", "description": "The bit-exact method's statevector hash (BLAKE3, hex): the same on every machine." }, "counts": { "type": "object", "description": "Outcomes and their counts, keyed by the program's classical bits, the highest bit first. At most 65536 outcomes are listed; omitted_shots holds the rest.", "additionalProperties": { "type": "integer", "minimum": 0 } }, "distinct_outcomes": { "type": "integer", "minimum": 0 }, "omitted_shots": { "type": "integer", "minimum": 0 }, "outcome_dimension": { "type": "integer", "minimum": 0, "description": "The stabilizer method: the dimension of the measured outcomes' affine space." }, "shots": { "type": "integer", "minimum": 0, "description": "The shots, where the method names them in the result (trajectories, provider)." }, "expectations": { "type": "array", "items": { "type": "object", "required": [ "observable", "coeff", "value" ], "properties": { "observable": { "type": "string" }, "coeff": { "type": "number" }, "value": { "type": "number", "description": "The coefficient times the expectation value." }, "stderr": { "type": "number", "description": "The standard error, for an estimate." }, "bound": { "type": "number", "description": "A rigorous bound on |exact − value|, for the bounded class." }, "peak_terms": { "type": "integer" }, "threshold_reached": { "type": "number" }, "max_terms": { "type": "integer" }, "ladder": { "type": "array", "description": "The value at thresholds a decade apart, the asked one last.", "items": { "type": "object", "required": [ "threshold", "value", "bound" ], "properties": { "threshold": { "type": "number" }, "value": { "type": "number" }, "bound": { "type": "number" }, "peak_terms": { "type": "integer" }, "threshold_reached": { "type": "number" } } } } } } }, "amplitudes": { "type": "array", "items": { "type": "object", "required": [ "bits", "re", "im" ], "properties": { "bits": { "type": "string", "description": "One 0 or 1 per qubit, qubit n-1 first." }, "re": { "type": "number" }, "im": { "type": "number" } } } }, "global_phase": { "type": "string", "description": "Why the amplitudes' global phase is not fixed, when it is not." }, "warning": { "type": "string" }, "contraction_flops": { "type": "number", "description": "The tensor network's contraction cost." }, "dynamic": { "type": "object", "description": "A program that measures in the middle, resets or branches on a measured bit: how it ran.", "properties": { "measurements_and_resets": { "type": "integer", "minimum": 0 }, "branches_run": { "type": "integer", "minimum": 0 }, "states_at_once": { "type": "integer", "minimum": 0 }, "branches_weighed": { "type": "integer", "minimum": 0 } } }, "outputs": { "type": "array", "description": "The program's output declarations: each its name and type, and its value, or the places of its bits in each outcome.", "items": { "type": "object", "required": [ "name", "type" ], "properties": { "name": { "type": "string" }, "type": { "type": "string" }, "bits": { "type": "array", "items": { "type": "integer", "minimum": 0 } }, "value": { "description": "A number, a boolean, a bit string, a duration's text, {\"re\", \"im\"}, or an array of them." } } } }, "timing": { "type": "object", "description": "A program that states durations (delay, box, stretch) the method does not apply: said so, with the reader's code.", "required": [ "applied", "why" ], "properties": { "applied": { "type": "boolean" }, "code": { "type": "string" }, "why": { "type": "string" } } }, "diagnostics": { "type": "array", "description": "The reader's warnings and notes on the program, each with its code.", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "compiled": { "description": "How the program was compiled before it ran: on the person's own provider, to the device's gates; or, asked with compile, to a basis within a budget. Either way, basis is the gate set it was compiled to.", "anyOf": [ { "type": "object", "description": "A provider job: the program sent, compiled exactly to the device's own gates: its basis (the device's gate set), the BLAKE3 of its OpenQASM 3 text, its counts of gates and swaps, its layouts, and the check it passed before it was sent.", "required": [ "basis", "program" ], "properties": { "basis": { "type": "string" }, "program": { "type": "string" }, "hash": { "type": "string" }, "native_gates": { "type": "integer" }, "two_qubit_gates": { "type": "integer" }, "swaps": { "type": "integer" }, "layout": { "type": "array", "items": { "type": "integer" } }, "final_layout": { "type": "array", "items": { "type": "integer" } }, "checked": { "type": "string" }, "placement": { "type": "object", "description": "Where the program was placed on the device's qubits, and why." } } }, { "type": "object", "description": "A job asked to compile its program first: what ran is the compiled circuit, within distance of the program in the operator norm up to a global phase.", "required": [ "basis", "verdict" ], "properties": { "basis": { "enum": [ "clifford_t", "standard" ], "description": "The gate set the program was compiled to." }, "level": { "type": "integer", "minimum": 0 }, "epsilon": { "type": "number", "description": "The budget asked for." }, "distance": { "type": [ "number", "null" ], "description": "The bound the passes' distances add to." }, "verdict": { "type": "string" }, "source": { "type": "object", "description": "A circuit's counts, as the compiler counts them.", "properties": { "gates": { "type": "integer", "minimum": 0 }, "one_qubit": { "type": "integer", "minimum": 0 }, "two_qubit": { "type": "integer", "minimum": 0 }, "three_qubit": { "type": "integer", "minimum": 0 }, "cnots": { "type": "integer", "minimum": 0 }, "t_count": { "type": "integer", "minimum": 0 }, "rotations": { "type": "integer", "minimum": 0 }, "depth": { "type": "integer", "minimum": 0 } } }, "output": { "type": "object", "description": "A circuit's counts, as the compiler counts them.", "properties": { "gates": { "type": "integer", "minimum": 0 }, "one_qubit": { "type": "integer", "minimum": 0 }, "two_qubit": { "type": "integer", "minimum": 0 }, "three_qubit": { "type": "integer", "minimum": 0 }, "cnots": { "type": "integer", "minimum": 0 }, "t_count": { "type": "integer", "minimum": 0 }, "rotations": { "type": "integer", "minimum": 0 }, "depth": { "type": "integer", "minimum": 0 } } }, "certificate": { "type": [ "string", "null" ], "description": "The BLAKE3 of the compile certificate's RFC 8785 text, in hex." }, "note": { "type": "string" } } } ] }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } }, "target": { "type": "object", "description": "A run on a device target: which target (its hash, as its receipt binds it), its calibration snapshot, where the program was placed and why, and the noise derived from the target.", "required": [ "name", "hash" ], "properties": { "name": { "type": "string" }, "hash": { "type": "string" }, "hash_is": { "type": "string" }, "calibration": { "type": "object", "properties": { "id": { "type": "string" }, "timestamp": { "type": "string" } } }, "source": { "type": "object", "properties": { "format": { "type": "string" }, "note": { "type": "string" } } }, "placement": { "type": "object", "description": "The native gate set, the layout and routes chosen, the swaps, the expected success beside the fewest-swaps layout's, and the check of the compiled program." }, "noise": { "type": "object", "description": "The noise model derived from the target's calibration: its channels, durations and idling, and each qubit's readout." } } }, "repaired": { "type": "object", "description": "A job asked to repair its program first: the program that ran, each repair, and what needs a person.", "properties": { "qasm": { "type": "string" }, "repairs": { "type": "array", "items": { "type": "object", "required": [ "code", "by", "edits" ], "properties": { "code": { "type": "string" }, "rule": { "type": "string" }, "by": { "enum": [ "engine", "proposal" ] }, "flagged": { "type": "array", "items": { "type": "integer" } }, "edits": { "type": "array", "items": { "type": "object", "properties": { "line": { "type": "integer" }, "before": { "type": [ "string", "null" ] }, "after": { "type": [ "string", "null" ] } } } } } } }, "needs_person": { "type": "array", "items": { "type": "object" } } } }, "elapsed_ms": { "type": "integer", "minimum": 0, "description": "Wall time of the run, where the host has a clock (not in a browser tab)." }, "energy": { "description": "The CPU energy of the job's process as the kernel counts it, with its uncertainty and what it leaves out, or unmetered with the reason.", "anyOf": [ { "type": "object", "required": [ "unmetered" ], "properties": { "unmetered": { "type": "string" }, "service_kwh": { "type": "number", "description": "A provider job: the provider's own figure." }, "service_kwh_is": { "type": "string" } } }, { "type": "object", "required": [ "joules_micro", "energy_provenance", "coverage" ], "properties": { "joules_micro": { "type": "integer", "minimum": 1 }, "energy_provenance": { "type": "string" }, "energy_uncertainty": { "type": "object", "properties": { "relative_ppm": { "type": "integer" }, "window_us": { "type": "integer" } } }, "energy_counter_filtering": { "type": "string" }, "coverage": { "enum": [ "whole", "partial" ] }, "covers": { "type": "string" }, "excludes": { "type": "array", "items": { "type": "string" } }, "cpu_ms": { "type": "integer" }, "source": { "type": "string" }, "attribution": { "enum": [ "process", "none" ], "description": "Whose energy it is: the job's worker process, or none (the processor packages' over the job's window, every process on the host in it)." }, "packages": { "type": "integer", "minimum": 1, "description": "The processor packages read." }, "concurrent_jobs": { "type": "integer", "minimum": 0, "description": "Other jobs that ran on the host during the window." }, "counter": { "type": "object", "description": "The package counter as seen: the longest it went between updates, and the smallest step it took.", "properties": { "update_us": { "type": "integer", "minimum": 0 }, "step_uj": { "type": "integer", "minimum": 0 } } }, "declared": { "type": "string", "description": "What the stated uncertainty covers, and what it does not." } } } ] }, "receipt": { "anyOf": [ { "title": "wai.quantum.receipt/2", "description": "A result's receipt: an Ed25519 signature, by the key it names, over digest = BLAKE3(\"wai:quantum-service-receipt\\x02\" ‖ len ‖ request ‖ len ‖ result), each of request and result in its RFC 8785 canonical text (the result without its receipt member), each length 8 bytes big-endian. Whatever members the request and the result hold are sealed, the result's engine and schema among them. The first receipts (no canon member, $defs/first) signed serde_json's own text under the domain ending \\x01; they still verify.", "type": "object", "required": [ "alg", "canon", "key", "digest", "signature" ], "properties": { "alg": { "const": "ed25519" }, "canon": { "const": "rfc8785", "description": "The canonical form the digest is taken over." }, "key": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The signing key, 32 bytes in hex." }, "digest": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The digest signed, 32 bytes in hex." }, "signature": { "type": "string", "minLength": 128, "maxLength": 128, "description": "The signature, 64 bytes in hex." } } }, { "description": "The first form, before canon: the digest is over serde_json's own text of each, under the domain ending \\x01. Never written now; still verified.", "type": "object", "required": [ "alg", "key", "digest", "signature" ], "properties": { "alg": { "const": "ed25519" }, "key": { "type": "string", "minLength": 64, "maxLength": 64 }, "digest": { "type": "string", "minLength": 64, "maxLength": 64 }, "signature": { "type": "string", "minLength": 128, "maxLength": 128 } } } ] }, "provider": { "type": "object", "description": "A provider job: the provider's name, kind and protocol, the device, its provenance, and the hash of its description." }, "calibration": { "type": [ "string", "null" ], "description": "A provider job: the calibration snapshot it ran under." }, "job": { "type": "object", "description": "A provider job: the provider's job id and its status checks." }, "ideal": { "description": "A provider job: the circuit's exact distribution set beside the measured counts.", "anyOf": [ { "type": "object", "required": [ "computed", "total_variation_distance", "hellinger_fidelity" ], "properties": { "computed": { "const": true }, "method": { "type": "string" }, "total_variation_distance": { "type": "number" }, "hellinger_fidelity": { "type": "number" }, "sampling_tvd_expected": { "type": "number" }, "ideal_outcomes": { "type": "integer" }, "note": { "type": "string" } } }, { "type": "object", "required": [ "computed", "why" ], "properties": { "computed": { "const": false }, "why": { "type": "string" } } } ] }, "cost": { "type": "object", "description": "A provider job: the estimate shown before it was sent, what the provider says it charged, and whether the person confirmed a run that was not free." }, "provenance": { "title": "wai.quantum.provenance/1", "description": "What a result came from, under the five categories cross-platform provenance surveys use: the circuit, the computer, the compilation, the execution and the software. A host adds it to the results it seals (the job service does, and each item of a set); a result without it reads as it always did. wai-quantum-service/docs/provenance.md maps every field to where it is and whether the receipt seals it.", "type": "object", "required": [ "schema", "circuit", "computer", "compilation", "execution", "software" ], "properties": { "schema": { "const": "wai.quantum.provenance/1" }, "circuit": { "type": "object", "description": "The program: the BLAKE3 digest of its text as given, its qubits and its gates.", "required": [ "program" ], "properties": { "program": { "type": "string", "description": "BLAKE3 of the program's text, in hex." }, "qubits": { "type": "integer", "minimum": 0 }, "gates": { "type": [ "integer", "null" ] } } }, "computer": { "type": "object", "description": "What ran it: a classical simulator, the method and its accuracy class, and a device target's hash when the job named one.", "required": [ "kind", "method" ], "properties": { "kind": { "const": "simulator" }, "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "target": { "type": "string", "description": "The device target's hash; its layout, routes and noise are in the result's own target." } } }, "compilation": { "type": "object", "description": "Whether the job asked to be compiled; if it did, each pass in order with its check's verdict, the certificate's digest, the gate set compiled to (its basis), the level, the ε budget and the distance the result carries, and that no pass draws a random number.", "required": [ "asked" ], "properties": { "asked": { "type": "boolean" }, "passes": { "type": [ "array", "null" ], "items": { "type": "object", "properties": { "pass": { "type": "string" }, "verdict": { "type": [ "string", "null" ] } } } }, "certificate": { "type": [ "string", "null" ] }, "basis": { "type": [ "string", "null" ], "description": "The gate set compiled to: clifford_t or standard." }, "level": { "type": [ "integer", "null" ] }, "epsilon": { "type": [ "number", "null" ] }, "distance": { "type": [ "number", "null" ] }, "seeded": { "const": false }, "device": { "type": "string", "description": "A job on a device target, compiled exactly to its gates: where its layout and routes are." }, "status": { "const": "not-applicable" }, "why": { "type": "string" } } }, "execution": { "type": "object", "description": "The shots, the seed and the plan the job ran under; its identifier and times are the host's, outside the result.", "required": [ "plan" ], "properties": { "shots": { "type": [ "integer", "null" ] }, "seed": { "type": [ "integer", "null" ] }, "plan": { "type": "object", "properties": { "method": { "type": "string" }, "why": { "type": "string" }, "memory_bytes": { "type": "integer", "minimum": 0 }, "work": { "type": "integer", "minimum": 0 } } } } }, "software": { "type": "object", "description": "The engine's name and version, and the host's.", "required": [ "engine", "host" ], "properties": { "engine": { "type": "string" }, "host": { "type": "string" } } } } }, "mitigation": { "title": "wai.quantum.mitigation/1", "description": "A job's mitigation (its request's mitigate, engine::mitigate), in its result: the method and the options it ran with, its bias and variance assumptions, each observable raw and mitigated with a standard error each and the ideal value (or, for readout, the counts inverted as a quasi-distribution), the method's own details and what it spent. docs/qec.md describes each method.", "type": "object", "required": [ "method", "options", "assumptions" ], "properties": { "method": { "enum": [ "zne", "pea", "pec", "cdr", "vd", "readout" ] }, "options": { "type": "object", "description": "The options it ran with, the defaults filled in.", "properties": { "method": { "type": "string" }, "shots": { "type": "integer" }, "seed": { "type": "integer" }, "factors": { "type": "array", "items": { "type": "number" } }, "extrapolation": { "enum": [ "richardson", "linear", "exponential" ] }, "samples": { "type": "integer" }, "training": { "type": "integer" }, "keep": { "type": "integer" }, "learn_shots": { "type": "integer" } } }, "assumptions": { "type": "object", "properties": { "bias": { "type": "string" }, "variance": { "type": "string" } } }, "noise": { "type": "string", "description": "How the job's noise model is read for the method." }, "note": { "type": "string" }, "observables": { "type": "array", "items": { "type": "object", "description": "One observable: its raw value and the mitigated one, each with its standard error, and the ideal value a simulation knows.", "properties": { "observable": { "type": "string" }, "coeff": { "type": "number" }, "raw": { "type": "number" }, "raw_stderr": { "type": "number" }, "mitigated": { "type": "number" }, "stderr": { "type": "number" }, "ideal": { "type": "number" } } } }, "distribution": { "type": "array", "description": "readout: each outcome's raw share and its mitigated quasi-probability, with its standard error.", "items": { "type": "object", "properties": { "bits": { "type": "string" }, "raw": { "type": "number" }, "mitigated": { "type": "number" }, "stderr": { "type": "number" } } } }, "details": { "type": "object", "description": "The method's own: the folded scales and the folding check (zne), the learned model and the amplified values (pea), the quasi-probability and the value it converges to (pec), the training fits (cdr), the purity (vd), the flip and its amplification (readout).", "additionalProperties": true }, "cost": { "type": "object", "description": "The circuits and shots it spent beyond the job's own.", "properties": { "circuits": { "type": "integer", "minimum": 0 }, "shots": { "type": "integer", "minimum": 0 }, "note": { "type": "string" } } } } } } }, "error": { "type": "string" }, "code": { "type": "string", "description": "A failed item's refusal code (engine::refusal)." }, "path": { "type": "array", "items": { "type": "string" }, "description": "The item's leaf's sibling digests up to the root, in hex." } } } } } } ] }, "error": { "type": "string", "description": "Why a job failed." }, "submitted_ms": { "type": "integer", "description": "The job service: when it was submitted, in milliseconds since 1970." }, "started_ms": { "type": "integer" }, "finished_ms": { "type": "integer" }, "peak_rss_bytes": { "type": "integer", "description": "The job service: the most memory the job's process held." }, "digests": { "type": "object", "description": "The job service: the BLAKE3 digests its store keeps the job's objects under (the request, each program, the result and the receipt).", "properties": { "algorithm": { "const": "blake3" }, "request": { "type": [ "string", "null" ] }, "programs": { "type": "array", "items": { "type": "string" } }, "result": { "type": "string" }, "receipt": { "type": "string" } } } } }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } } ] } }, { "name": "qec_code", "title": "Show an error-correcting code and certify its distance", "description": "Show an error-correcting code and certify its distance: its checks (Z-type: they see X errors) and stabilizers (X-type), k counted by rank, a layout to draw it, the decoders it admits, and its distance certificate. In each sector the certificate gives the least weight of a logical found, a witness of that weight, and every lighter support ruled out by an exhaustive search over connected supports (a bivariate-bicycle code's translations checked as symmetries before use), re-checkable node for node. Give `certificate` to check one: its witnesses and the search run again. Sealed with this user's key. Quote the certificate's distance and its reading; a search stopped by `bound` settles nothing past it.", "inputSchema": { "type": "object", "required": [ "code" ], "properties": { "code": { "description": "A code by name: surface:D (the rotated surface code, odd D from 3 to 15), toric:L (2 to 12), steane, color:D (the triangular 6.6.6 colour code, odd D from 3 to 15), bb:72, bb:90, bb:108, bb:144 (or gross) or bb:288 (bivariate-bicycle codes); or {\"family\", \"distance\" | \"size\" | \"n\"}." }, "certify": { "type": "boolean", "description": "Certify the distance (default true)." }, "bound": { "type": "integer", "minimum": 1, "maximum": 24, "description": "The heaviest support to search (default the code's nominal distance)." }, "certificate": { "type": "object", "description": "A certificate (wai.quantum.distance/1) to check against the code." } } }, "annotations": { "readOnlyHint": true, "idempotentHint": true, "openWorldHint": false }, "outputSchema": { "$id": "wai-quantum://schemas/qec_code/1", "type": "object", "description": "An error-correction answer as every host gives it (engine::qec: qec_code, qec_decode and qec_threshold on both servers, wai-quantum qec, POST /v1/qec/*, the Studio and Python): the request, and the result sealed in a job's form. A code with its distance certificate (or a given certificate checked); a syndrome, an error or a circuit's detectors decoded, or shots sampled and decoded; logical failure rates over distances and physical rates. A result names the engine that made it and this schema (engine and schema). docs/qec.md explains each.", "anyOf": [ { "title": "wai.quantum.qec/1", "description": "An error-correction answer as every host gives it (engine::qec: qec_code, qec_decode and qec_threshold on both servers, wai-quantum qec, POST /v1/qec/*, the Studio and Python): the request, and the result sealed in a job's form. A code with its distance certificate (or a given certificate checked); a syndrome, an error or a circuit's detectors decoded, or shots sampled and decoded; logical failure rates over distances and physical rates. A result names the engine that made it and this schema (engine and schema). docs/qec.md explains each.", "type": "object", "required": [ "request", "result" ], "properties": { "request": { "type": "object", "description": "The call's request, as given." }, "result": { "description": "A code, a decode or a threshold, with its receipt.", "anyOf": [ { "type": "object", "description": "A code: its checks and stabilizers, k, its layout, the decoders it takes, and its distance certificate (or a given one's check).", "required": [ "ok", "code" ], "properties": { "engine": { "type": "object", "description": "The engine that made the result: the wai-quantum crate's name and version.", "required": [ "name", "version" ], "properties": { "name": { "const": "wai-quantum" }, "version": { "type": "string" } } }, "schema": { "const": "wai.quantum.qec/1" }, "ok": { "const": true }, "code": { "type": "object", "properties": { "name": { "type": "string" }, "family": { "type": "string" }, "n": { "type": "integer" }, "k": { "type": "integer" }, "nominal_distance": { "type": "integer" }, "checks": { "type": "array" }, "stabs": { "type": "array" }, "sectors": { "type": "string" }, "families_hash": { "type": "string" }, "layout": { "type": "object" }, "decoders": { "type": "array", "items": { "type": "string" } }, "colors": { "type": "array" } } }, "certificate": { "title": "wai.quantum.distance/1", "description": "A code's distance certificate (quantum_distance): in each sector, a witness logical of the least weight found and every lighter support ruled out by an exhaustive search over connected supports, re-checkable node for node; the code's families hash, the search's bound, the symmetries checked and used, and its reading. Given back to qec_code, it is checked against the code.", "type": "object", "required": [ "format", "code", "n", "k", "distance", "x", "z" ], "properties": { "format": { "const": "wai.quantum.distance/1" }, "code": { "type": "string" }, "n": { "type": "integer", "minimum": 1 }, "k": { "type": "integer", "minimum": 0 }, "families": { "type": "string", "description": "BLAKE3 of the code's check families, in hex." }, "distance": { "type": [ "integer", "null" ], "description": "The distance, when both sectors settle it; null when the search stopped at its bound first." }, "x": { "type": "object", "description": "One sector: the least weight of a logical found, a witness of that weight, and the weight below which the search ruled every support out.", "properties": { "distance": { "type": [ "integer", "null" ] }, "witness": { "type": [ "array", "null" ], "items": { "type": "integer", "minimum": 0 } }, "no_logical_below": { "type": [ "integer", "null" ] }, "nodes": { "type": "integer", "minimum": 0 } } }, "z": { "type": "object", "description": "One sector: the least weight of a logical found, a witness of that weight, and the weight below which the search ruled every support out.", "properties": { "distance": { "type": [ "integer", "null" ] }, "witness": { "type": [ "array", "null" ], "items": { "type": "integer", "minimum": 0 } }, "no_logical_below": { "type": [ "integer", "null" ] }, "nodes": { "type": "integer", "minimum": 0 } } }, "bound": { "type": "integer", "minimum": 1 }, "symmetries": { "type": [ "integer", "array", "null" ] }, "orbits": { "type": [ "integer", "array", "null" ] }, "method": { "type": "string" }, "reading": { "type": "string" } } }, "check": { "type": "object", "description": "A given certificate's check: its witnesses, and the search run again.", "properties": { "verified": { "type": "boolean" }, "witnesses": { "type": "boolean" }, "search_reproduced": { "type": "boolean" }, "why": { "type": "string" } } }, "receipt": { "title": "wai.quantum.receipt/2", "description": "A result's receipt: an Ed25519 signature, by the key it names, over digest = BLAKE3(\"wai:quantum-service-receipt\\x02\" ‖ len ‖ request ‖ len ‖ result), each of request and result in its RFC 8785 canonical text (the result without its receipt member), each length 8 bytes big-endian. Whatever members the request and the result hold are sealed, the result's engine and schema among them. The first receipts (no canon member, $defs/first) signed serde_json's own text under the domain ending \\x01; they still verify.", "type": "object", "required": [ "alg", "canon", "key", "digest", "signature" ], "properties": { "alg": { "const": "ed25519" }, "canon": { "const": "rfc8785", "description": "The canonical form the digest is taken over." }, "key": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The signing key, 32 bytes in hex." }, "digest": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The digest signed, 32 bytes in hex." }, "signature": { "type": "string", "minLength": 128, "maxLength": 128, "description": "The signature, 64 bytes in hex." } } } } }, { "type": "object", "description": "A decode: at code capacity the syndrome, the correction and whether it explains the syndrome (and with an error, its residual); at circuit level the model's size, the fired detectors and the observables predicted, or the shots sampled and their failure rate.", "required": [ "decoder" ], "properties": { "engine": { "type": "object", "description": "The engine that made the result: the wai-quantum crate's name and version.", "required": [ "name", "version" ], "properties": { "name": { "const": "wai-quantum" }, "version": { "type": "string" } } }, "schema": { "const": "wai.quantum.qec/1" }, "decoder": { "type": "string" }, "code": { "type": "string" }, "syndrome": { "type": "array", "items": { "type": "integer" } }, "correction": { "type": "array", "items": { "type": "integer" } }, "weight": { "type": "integer" }, "explains": { "type": "boolean" }, "error": { "type": "array", "items": { "type": "integer" } }, "residual": { "type": "object", "properties": { "qubits": { "type": "array", "items": { "type": "integer" } }, "logical": { "type": "boolean" }, "reading": { "type": "string" } } }, "detectors": { "type": "integer" }, "observables": { "type": "integer" }, "mechanisms": { "type": "integer" }, "fired": { "type": "array", "items": { "type": "integer" } }, "predicted": { "type": "array", "items": { "type": "integer" } }, "shots": { "type": "integer" }, "seed": { "type": "integer" }, "failures": { "type": "integer" }, "rate": { "type": "number" }, "stderr": { "type": "number" }, "detail": { "type": "object", "description": "The decoder's own: its passes, its convergence, its windows.", "additionalProperties": true }, "receipt": { "title": "wai.quantum.receipt/2", "description": "A result's receipt: an Ed25519 signature, by the key it names, over digest = BLAKE3(\"wai:quantum-service-receipt\\x02\" ‖ len ‖ request ‖ len ‖ result), each of request and result in its RFC 8785 canonical text (the result without its receipt member), each length 8 bytes big-endian. Whatever members the request and the result hold are sealed, the result's engine and schema among them. The first receipts (no canon member, $defs/first) signed serde_json's own text under the domain ending \\x01; they still verify.", "type": "object", "required": [ "alg", "canon", "key", "digest", "signature" ], "properties": { "alg": { "const": "ed25519" }, "canon": { "const": "rfc8785", "description": "The canonical form the digest is taken over." }, "key": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The signing key, 32 bytes in hex." }, "digest": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The digest signed, 32 bytes in hex." }, "signature": { "type": "string", "minLength": 128, "maxLength": 128, "description": "The signature, 64 bytes in hex." } } } } }, { "type": "object", "description": "Logical failure rates: each point's shots, failures, rate and standard error, the code model fitted at circuit level, and at each physical rate whether every larger distance failed less.", "required": [ "points", "below_threshold" ], "properties": { "engine": { "type": "object", "description": "The engine that made the result: the wai-quantum crate's name and version.", "required": [ "name", "version" ], "properties": { "name": { "const": "wai-quantum" }, "version": { "type": "string" } } }, "schema": { "const": "wai.quantum.qec/1" }, "family": { "type": "string" }, "decoder": { "type": [ "string", "null" ] }, "noise": { "type": [ "string", "object", "null" ] }, "seed": { "type": "integer" }, "points": { "type": "array", "items": { "type": "object", "properties": { "distance": { "type": "integer" }, "p": { "type": "number" }, "rounds": { "type": "integer" }, "shots": { "type": "integer" }, "failures": { "type": "integer" }, "rate": { "type": "number" }, "stderr": { "type": "number" }, "per_round": { "type": [ "number", "null" ] } } } }, "fit": { "type": [ "object", "null" ], "properties": { "model": { "type": "string" }, "prefactor": { "type": "number" }, "threshold": { "type": "number" } } }, "below_threshold": { "type": "array", "items": { "type": "object", "properties": { "p": { "type": "number" }, "distance_helps": { "type": "boolean" } } } }, "reading": { "type": "string" }, "receipt": { "title": "wai.quantum.receipt/2", "description": "A result's receipt: an Ed25519 signature, by the key it names, over digest = BLAKE3(\"wai:quantum-service-receipt\\x02\" ‖ len ‖ request ‖ len ‖ result), each of request and result in its RFC 8785 canonical text (the result without its receipt member), each length 8 bytes big-endian. Whatever members the request and the result hold are sealed, the result's engine and schema among them. The first receipts (no canon member, $defs/first) signed serde_json's own text under the domain ending \\x01; they still verify.", "type": "object", "required": [ "alg", "canon", "key", "digest", "signature" ], "properties": { "alg": { "const": "ed25519" }, "canon": { "const": "rfc8785", "description": "The canonical form the digest is taken over." }, "key": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The signing key, 32 bytes in hex." }, "digest": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The digest signed, 32 bytes in hex." }, "signature": { "type": "string", "minLength": 128, "maxLength": 128, "description": "The signature, 64 bytes in hex." } } } } } ] } } }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } } ] } }, { "name": "qec_decode", "title": "Decode a syndrome or a circuit's detectors", "description": "Decode with the engine's decoders. At code capacity, give `code` and a `syndrome` (the violated checks) or an `error` (the flipped qubits: its syndrome is taken and its residual judged, logical or not): matching (exact) and union_find for codes whose qubits sit in at most two checks; color for colour codes (restriction to matching on the three restricted lattices, lifted at each colour, completed below half the distance by an exact search); relay_bp for any code (it can stall on a degenerate error of a topological code, and then says it did not converge); search for the lightest error with the syndrome up to max_weight. At circuit level, give `memory` ({distance, rounds, p}: the rotated surface-code memory experiment), `circuit` (the circuit text: tags, Pauli-target observables and coordinates read) or `model` (detector error model text, decompositions with ^ read), with the fired `detectors` (the prediction: which observables flipped) or `shots` (sampled and decoded: the failure rate and its standard error): matching (exact), correlated (exact matching twice through the model's decomposed faults, the second answer kept only when the model's mechanisms explain it more cheaply), union_find, bp_osd, or window (a sliding window: `window` {commit, buffer} rounds; every edge set below half the distance is corrected once the buffer is at least (d + 1)/2). Sealed with this user's key.", "inputSchema": { "type": "object", "properties": { "code": { "description": "A code by name: surface:D (the rotated surface code, odd D from 3 to 15), toric:L (2 to 12), steane, color:D (the triangular 6.6.6 colour code, odd D from 3 to 15), bb:72, bb:90, bb:108, bb:144 (or gross) or bb:288 (bivariate-bicycle codes); or {\"family\", \"distance\" | \"size\" | \"n\"}." }, "decoder": { "type": "string", "enum": [ "matching", "union_find", "color", "relay_bp", "search", "correlated", "bp_osd", "window" ], "description": "The decoder (default: matching, or color for a colour code, relay_bp for a bivariate-bicycle code)." }, "syndrome": { "type": "array", "items": { "type": "integer", "minimum": 0 }, "description": "The violated checks, by index." }, "error": { "type": "array", "items": { "type": "integer", "minimum": 0 }, "description": "The flipped qubits, by index." }, "max_weight": { "type": "integer", "minimum": 0, "maximum": 8, "description": "search: the heaviest error to try." }, "memory": { "type": "object", "properties": { "distance": { "type": "integer" }, "rounds": { "type": "integer" }, "p": { "type": "number" } }, "description": "The rotated surface-code memory experiment at circuit level." }, "circuit": { "type": "string", "description": "A noisy Clifford circuit in the circuit text." }, "model": { "type": "string", "description": "A detector error model in its text." }, "detectors": { "type": "array", "items": { "type": "integer", "minimum": 0 }, "description": "The detectors that fired." }, "shots": { "type": "integer", "minimum": 1, "description": "Sample this many shots of the circuit and decode each." }, "seed": { "type": "integer", "minimum": 0, "description": "The sampling seed (default 1)." }, "window": { "type": "object", "properties": { "commit": { "type": "integer" }, "buffer": { "type": "integer" }, "budget_ns": { "type": "integer" } }, "description": "window: rounds each window commits and the rounds after them it sees." } } }, "annotations": { "readOnlyHint": true, "idempotentHint": true, "openWorldHint": false }, "outputSchema": { "$id": "wai-quantum://schemas/qec_decode/1", "type": "object", "description": "An error-correction answer as every host gives it (engine::qec: qec_code, qec_decode and qec_threshold on both servers, wai-quantum qec, POST /v1/qec/*, the Studio and Python): the request, and the result sealed in a job's form. A code with its distance certificate (or a given certificate checked); a syndrome, an error or a circuit's detectors decoded, or shots sampled and decoded; logical failure rates over distances and physical rates. A result names the engine that made it and this schema (engine and schema). docs/qec.md explains each.", "anyOf": [ { "title": "wai.quantum.qec/1", "description": "An error-correction answer as every host gives it (engine::qec: qec_code, qec_decode and qec_threshold on both servers, wai-quantum qec, POST /v1/qec/*, the Studio and Python): the request, and the result sealed in a job's form. A code with its distance certificate (or a given certificate checked); a syndrome, an error or a circuit's detectors decoded, or shots sampled and decoded; logical failure rates over distances and physical rates. A result names the engine that made it and this schema (engine and schema). docs/qec.md explains each.", "type": "object", "required": [ "request", "result" ], "properties": { "request": { "type": "object", "description": "The call's request, as given." }, "result": { "description": "A code, a decode or a threshold, with its receipt.", "anyOf": [ { "type": "object", "description": "A code: its checks and stabilizers, k, its layout, the decoders it takes, and its distance certificate (or a given one's check).", "required": [ "ok", "code" ], "properties": { "engine": { "type": "object", "description": "The engine that made the result: the wai-quantum crate's name and version.", "required": [ "name", "version" ], "properties": { "name": { "const": "wai-quantum" }, "version": { "type": "string" } } }, "schema": { "const": "wai.quantum.qec/1" }, "ok": { "const": true }, "code": { "type": "object", "properties": { "name": { "type": "string" }, "family": { "type": "string" }, "n": { "type": "integer" }, "k": { "type": "integer" }, "nominal_distance": { "type": "integer" }, "checks": { "type": "array" }, "stabs": { "type": "array" }, "sectors": { "type": "string" }, "families_hash": { "type": "string" }, "layout": { "type": "object" }, "decoders": { "type": "array", "items": { "type": "string" } }, "colors": { "type": "array" } } }, "certificate": { "title": "wai.quantum.distance/1", "description": "A code's distance certificate (quantum_distance): in each sector, a witness logical of the least weight found and every lighter support ruled out by an exhaustive search over connected supports, re-checkable node for node; the code's families hash, the search's bound, the symmetries checked and used, and its reading. Given back to qec_code, it is checked against the code.", "type": "object", "required": [ "format", "code", "n", "k", "distance", "x", "z" ], "properties": { "format": { "const": "wai.quantum.distance/1" }, "code": { "type": "string" }, "n": { "type": "integer", "minimum": 1 }, "k": { "type": "integer", "minimum": 0 }, "families": { "type": "string", "description": "BLAKE3 of the code's check families, in hex." }, "distance": { "type": [ "integer", "null" ], "description": "The distance, when both sectors settle it; null when the search stopped at its bound first." }, "x": { "type": "object", "description": "One sector: the least weight of a logical found, a witness of that weight, and the weight below which the search ruled every support out.", "properties": { "distance": { "type": [ "integer", "null" ] }, "witness": { "type": [ "array", "null" ], "items": { "type": "integer", "minimum": 0 } }, "no_logical_below": { "type": [ "integer", "null" ] }, "nodes": { "type": "integer", "minimum": 0 } } }, "z": { "type": "object", "description": "One sector: the least weight of a logical found, a witness of that weight, and the weight below which the search ruled every support out.", "properties": { "distance": { "type": [ "integer", "null" ] }, "witness": { "type": [ "array", "null" ], "items": { "type": "integer", "minimum": 0 } }, "no_logical_below": { "type": [ "integer", "null" ] }, "nodes": { "type": "integer", "minimum": 0 } } }, "bound": { "type": "integer", "minimum": 1 }, "symmetries": { "type": [ "integer", "array", "null" ] }, "orbits": { "type": [ "integer", "array", "null" ] }, "method": { "type": "string" }, "reading": { "type": "string" } } }, "check": { "type": "object", "description": "A given certificate's check: its witnesses, and the search run again.", "properties": { "verified": { "type": "boolean" }, "witnesses": { "type": "boolean" }, "search_reproduced": { "type": "boolean" }, "why": { "type": "string" } } }, "receipt": { "title": "wai.quantum.receipt/2", "description": "A result's receipt: an Ed25519 signature, by the key it names, over digest = BLAKE3(\"wai:quantum-service-receipt\\x02\" ‖ len ‖ request ‖ len ‖ result), each of request and result in its RFC 8785 canonical text (the result without its receipt member), each length 8 bytes big-endian. Whatever members the request and the result hold are sealed, the result's engine and schema among them. The first receipts (no canon member, $defs/first) signed serde_json's own text under the domain ending \\x01; they still verify.", "type": "object", "required": [ "alg", "canon", "key", "digest", "signature" ], "properties": { "alg": { "const": "ed25519" }, "canon": { "const": "rfc8785", "description": "The canonical form the digest is taken over." }, "key": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The signing key, 32 bytes in hex." }, "digest": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The digest signed, 32 bytes in hex." }, "signature": { "type": "string", "minLength": 128, "maxLength": 128, "description": "The signature, 64 bytes in hex." } } } } }, { "type": "object", "description": "A decode: at code capacity the syndrome, the correction and whether it explains the syndrome (and with an error, its residual); at circuit level the model's size, the fired detectors and the observables predicted, or the shots sampled and their failure rate.", "required": [ "decoder" ], "properties": { "engine": { "type": "object", "description": "The engine that made the result: the wai-quantum crate's name and version.", "required": [ "name", "version" ], "properties": { "name": { "const": "wai-quantum" }, "version": { "type": "string" } } }, "schema": { "const": "wai.quantum.qec/1" }, "decoder": { "type": "string" }, "code": { "type": "string" }, "syndrome": { "type": "array", "items": { "type": "integer" } }, "correction": { "type": "array", "items": { "type": "integer" } }, "weight": { "type": "integer" }, "explains": { "type": "boolean" }, "error": { "type": "array", "items": { "type": "integer" } }, "residual": { "type": "object", "properties": { "qubits": { "type": "array", "items": { "type": "integer" } }, "logical": { "type": "boolean" }, "reading": { "type": "string" } } }, "detectors": { "type": "integer" }, "observables": { "type": "integer" }, "mechanisms": { "type": "integer" }, "fired": { "type": "array", "items": { "type": "integer" } }, "predicted": { "type": "array", "items": { "type": "integer" } }, "shots": { "type": "integer" }, "seed": { "type": "integer" }, "failures": { "type": "integer" }, "rate": { "type": "number" }, "stderr": { "type": "number" }, "detail": { "type": "object", "description": "The decoder's own: its passes, its convergence, its windows.", "additionalProperties": true }, "receipt": { "title": "wai.quantum.receipt/2", "description": "A result's receipt: an Ed25519 signature, by the key it names, over digest = BLAKE3(\"wai:quantum-service-receipt\\x02\" ‖ len ‖ request ‖ len ‖ result), each of request and result in its RFC 8785 canonical text (the result without its receipt member), each length 8 bytes big-endian. Whatever members the request and the result hold are sealed, the result's engine and schema among them. The first receipts (no canon member, $defs/first) signed serde_json's own text under the domain ending \\x01; they still verify.", "type": "object", "required": [ "alg", "canon", "key", "digest", "signature" ], "properties": { "alg": { "const": "ed25519" }, "canon": { "const": "rfc8785", "description": "The canonical form the digest is taken over." }, "key": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The signing key, 32 bytes in hex." }, "digest": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The digest signed, 32 bytes in hex." }, "signature": { "type": "string", "minLength": 128, "maxLength": 128, "description": "The signature, 64 bytes in hex." } } } } }, { "type": "object", "description": "Logical failure rates: each point's shots, failures, rate and standard error, the code model fitted at circuit level, and at each physical rate whether every larger distance failed less.", "required": [ "points", "below_threshold" ], "properties": { "engine": { "type": "object", "description": "The engine that made the result: the wai-quantum crate's name and version.", "required": [ "name", "version" ], "properties": { "name": { "const": "wai-quantum" }, "version": { "type": "string" } } }, "schema": { "const": "wai.quantum.qec/1" }, "family": { "type": "string" }, "decoder": { "type": [ "string", "null" ] }, "noise": { "type": [ "string", "object", "null" ] }, "seed": { "type": "integer" }, "points": { "type": "array", "items": { "type": "object", "properties": { "distance": { "type": "integer" }, "p": { "type": "number" }, "rounds": { "type": "integer" }, "shots": { "type": "integer" }, "failures": { "type": "integer" }, "rate": { "type": "number" }, "stderr": { "type": "number" }, "per_round": { "type": [ "number", "null" ] } } } }, "fit": { "type": [ "object", "null" ], "properties": { "model": { "type": "string" }, "prefactor": { "type": "number" }, "threshold": { "type": "number" } } }, "below_threshold": { "type": "array", "items": { "type": "object", "properties": { "p": { "type": "number" }, "distance_helps": { "type": "boolean" } } } }, "reading": { "type": "string" }, "receipt": { "title": "wai.quantum.receipt/2", "description": "A result's receipt: an Ed25519 signature, by the key it names, over digest = BLAKE3(\"wai:quantum-service-receipt\\x02\" ‖ len ‖ request ‖ len ‖ result), each of request and result in its RFC 8785 canonical text (the result without its receipt member), each length 8 bytes big-endian. Whatever members the request and the result hold are sealed, the result's engine and schema among them. The first receipts (no canon member, $defs/first) signed serde_json's own text under the domain ending \\x01; they still verify.", "type": "object", "required": [ "alg", "canon", "key", "digest", "signature" ], "properties": { "alg": { "const": "ed25519" }, "canon": { "const": "rfc8785", "description": "The canonical form the digest is taken over." }, "key": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The signing key, 32 bytes in hex." }, "digest": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The digest signed, 32 bytes in hex." }, "signature": { "type": "string", "minLength": 128, "maxLength": 128, "description": "The signature, 64 bytes in hex." } } } } } ] } } }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } } ] } }, { "name": "qec_threshold", "title": "Measure logical failure rates over distances", "description": "Measure logical failure rates over distances and physical error rates: family surface at circuit level (decoders matching, correlated or union_find; the code model P(d) = a·(p/p*)^((d+1)/2) per round fitted to the points), or color, toric or surface_capacity at code capacity. Each point gives its shots, failures, rate and standard error; below_threshold says, at each p, whether every larger distance failed less. Sealed with this user's key. Report rates with their errors: a crossing measured on few shots is not a threshold.", "inputSchema": { "type": "object", "properties": { "family": { "type": "string", "enum": [ "surface", "color", "toric", "surface_capacity" ], "description": "surface (circuit level, the default) or a code at code capacity." }, "distances": { "type": "array", "items": { "type": "integer" }, "description": "Odd distances (default 3, 5, 7)." }, "p": { "type": "array", "items": { "type": "number", "minimum": 0, "maximum": 0.5 }, "description": "Physical error rates." }, "shots": { "type": "integer", "minimum": 1, "description": "Shots at each point (default 10000)." }, "decoder": { "type": "string", "enum": [ "matching", "correlated", "union_find" ], "description": "surface: the decoder (default matching)." }, "rounds": { "type": "integer", "minimum": 1, "description": "surface: rounds (default the distance)." }, "seed": { "type": "integer", "minimum": 0 } } }, "annotations": { "readOnlyHint": true, "idempotentHint": true, "openWorldHint": false }, "outputSchema": { "$id": "wai-quantum://schemas/qec_threshold/1", "type": "object", "description": "An error-correction answer as every host gives it (engine::qec: qec_code, qec_decode and qec_threshold on both servers, wai-quantum qec, POST /v1/qec/*, the Studio and Python): the request, and the result sealed in a job's form. A code with its distance certificate (or a given certificate checked); a syndrome, an error or a circuit's detectors decoded, or shots sampled and decoded; logical failure rates over distances and physical rates. A result names the engine that made it and this schema (engine and schema). docs/qec.md explains each.", "anyOf": [ { "title": "wai.quantum.qec/1", "description": "An error-correction answer as every host gives it (engine::qec: qec_code, qec_decode and qec_threshold on both servers, wai-quantum qec, POST /v1/qec/*, the Studio and Python): the request, and the result sealed in a job's form. A code with its distance certificate (or a given certificate checked); a syndrome, an error or a circuit's detectors decoded, or shots sampled and decoded; logical failure rates over distances and physical rates. A result names the engine that made it and this schema (engine and schema). docs/qec.md explains each.", "type": "object", "required": [ "request", "result" ], "properties": { "request": { "type": "object", "description": "The call's request, as given." }, "result": { "description": "A code, a decode or a threshold, with its receipt.", "anyOf": [ { "type": "object", "description": "A code: its checks and stabilizers, k, its layout, the decoders it takes, and its distance certificate (or a given one's check).", "required": [ "ok", "code" ], "properties": { "engine": { "type": "object", "description": "The engine that made the result: the wai-quantum crate's name and version.", "required": [ "name", "version" ], "properties": { "name": { "const": "wai-quantum" }, "version": { "type": "string" } } }, "schema": { "const": "wai.quantum.qec/1" }, "ok": { "const": true }, "code": { "type": "object", "properties": { "name": { "type": "string" }, "family": { "type": "string" }, "n": { "type": "integer" }, "k": { "type": "integer" }, "nominal_distance": { "type": "integer" }, "checks": { "type": "array" }, "stabs": { "type": "array" }, "sectors": { "type": "string" }, "families_hash": { "type": "string" }, "layout": { "type": "object" }, "decoders": { "type": "array", "items": { "type": "string" } }, "colors": { "type": "array" } } }, "certificate": { "title": "wai.quantum.distance/1", "description": "A code's distance certificate (quantum_distance): in each sector, a witness logical of the least weight found and every lighter support ruled out by an exhaustive search over connected supports, re-checkable node for node; the code's families hash, the search's bound, the symmetries checked and used, and its reading. Given back to qec_code, it is checked against the code.", "type": "object", "required": [ "format", "code", "n", "k", "distance", "x", "z" ], "properties": { "format": { "const": "wai.quantum.distance/1" }, "code": { "type": "string" }, "n": { "type": "integer", "minimum": 1 }, "k": { "type": "integer", "minimum": 0 }, "families": { "type": "string", "description": "BLAKE3 of the code's check families, in hex." }, "distance": { "type": [ "integer", "null" ], "description": "The distance, when both sectors settle it; null when the search stopped at its bound first." }, "x": { "type": "object", "description": "One sector: the least weight of a logical found, a witness of that weight, and the weight below which the search ruled every support out.", "properties": { "distance": { "type": [ "integer", "null" ] }, "witness": { "type": [ "array", "null" ], "items": { "type": "integer", "minimum": 0 } }, "no_logical_below": { "type": [ "integer", "null" ] }, "nodes": { "type": "integer", "minimum": 0 } } }, "z": { "type": "object", "description": "One sector: the least weight of a logical found, a witness of that weight, and the weight below which the search ruled every support out.", "properties": { "distance": { "type": [ "integer", "null" ] }, "witness": { "type": [ "array", "null" ], "items": { "type": "integer", "minimum": 0 } }, "no_logical_below": { "type": [ "integer", "null" ] }, "nodes": { "type": "integer", "minimum": 0 } } }, "bound": { "type": "integer", "minimum": 1 }, "symmetries": { "type": [ "integer", "array", "null" ] }, "orbits": { "type": [ "integer", "array", "null" ] }, "method": { "type": "string" }, "reading": { "type": "string" } } }, "check": { "type": "object", "description": "A given certificate's check: its witnesses, and the search run again.", "properties": { "verified": { "type": "boolean" }, "witnesses": { "type": "boolean" }, "search_reproduced": { "type": "boolean" }, "why": { "type": "string" } } }, "receipt": { "title": "wai.quantum.receipt/2", "description": "A result's receipt: an Ed25519 signature, by the key it names, over digest = BLAKE3(\"wai:quantum-service-receipt\\x02\" ‖ len ‖ request ‖ len ‖ result), each of request and result in its RFC 8785 canonical text (the result without its receipt member), each length 8 bytes big-endian. Whatever members the request and the result hold are sealed, the result's engine and schema among them. The first receipts (no canon member, $defs/first) signed serde_json's own text under the domain ending \\x01; they still verify.", "type": "object", "required": [ "alg", "canon", "key", "digest", "signature" ], "properties": { "alg": { "const": "ed25519" }, "canon": { "const": "rfc8785", "description": "The canonical form the digest is taken over." }, "key": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The signing key, 32 bytes in hex." }, "digest": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The digest signed, 32 bytes in hex." }, "signature": { "type": "string", "minLength": 128, "maxLength": 128, "description": "The signature, 64 bytes in hex." } } } } }, { "type": "object", "description": "A decode: at code capacity the syndrome, the correction and whether it explains the syndrome (and with an error, its residual); at circuit level the model's size, the fired detectors and the observables predicted, or the shots sampled and their failure rate.", "required": [ "decoder" ], "properties": { "engine": { "type": "object", "description": "The engine that made the result: the wai-quantum crate's name and version.", "required": [ "name", "version" ], "properties": { "name": { "const": "wai-quantum" }, "version": { "type": "string" } } }, "schema": { "const": "wai.quantum.qec/1" }, "decoder": { "type": "string" }, "code": { "type": "string" }, "syndrome": { "type": "array", "items": { "type": "integer" } }, "correction": { "type": "array", "items": { "type": "integer" } }, "weight": { "type": "integer" }, "explains": { "type": "boolean" }, "error": { "type": "array", "items": { "type": "integer" } }, "residual": { "type": "object", "properties": { "qubits": { "type": "array", "items": { "type": "integer" } }, "logical": { "type": "boolean" }, "reading": { "type": "string" } } }, "detectors": { "type": "integer" }, "observables": { "type": "integer" }, "mechanisms": { "type": "integer" }, "fired": { "type": "array", "items": { "type": "integer" } }, "predicted": { "type": "array", "items": { "type": "integer" } }, "shots": { "type": "integer" }, "seed": { "type": "integer" }, "failures": { "type": "integer" }, "rate": { "type": "number" }, "stderr": { "type": "number" }, "detail": { "type": "object", "description": "The decoder's own: its passes, its convergence, its windows.", "additionalProperties": true }, "receipt": { "title": "wai.quantum.receipt/2", "description": "A result's receipt: an Ed25519 signature, by the key it names, over digest = BLAKE3(\"wai:quantum-service-receipt\\x02\" ‖ len ‖ request ‖ len ‖ result), each of request and result in its RFC 8785 canonical text (the result without its receipt member), each length 8 bytes big-endian. Whatever members the request and the result hold are sealed, the result's engine and schema among them. The first receipts (no canon member, $defs/first) signed serde_json's own text under the domain ending \\x01; they still verify.", "type": "object", "required": [ "alg", "canon", "key", "digest", "signature" ], "properties": { "alg": { "const": "ed25519" }, "canon": { "const": "rfc8785", "description": "The canonical form the digest is taken over." }, "key": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The signing key, 32 bytes in hex." }, "digest": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The digest signed, 32 bytes in hex." }, "signature": { "type": "string", "minLength": 128, "maxLength": 128, "description": "The signature, 64 bytes in hex." } } } } }, { "type": "object", "description": "Logical failure rates: each point's shots, failures, rate and standard error, the code model fitted at circuit level, and at each physical rate whether every larger distance failed less.", "required": [ "points", "below_threshold" ], "properties": { "engine": { "type": "object", "description": "The engine that made the result: the wai-quantum crate's name and version.", "required": [ "name", "version" ], "properties": { "name": { "const": "wai-quantum" }, "version": { "type": "string" } } }, "schema": { "const": "wai.quantum.qec/1" }, "family": { "type": "string" }, "decoder": { "type": [ "string", "null" ] }, "noise": { "type": [ "string", "object", "null" ] }, "seed": { "type": "integer" }, "points": { "type": "array", "items": { "type": "object", "properties": { "distance": { "type": "integer" }, "p": { "type": "number" }, "rounds": { "type": "integer" }, "shots": { "type": "integer" }, "failures": { "type": "integer" }, "rate": { "type": "number" }, "stderr": { "type": "number" }, "per_round": { "type": [ "number", "null" ] } } } }, "fit": { "type": [ "object", "null" ], "properties": { "model": { "type": "string" }, "prefactor": { "type": "number" }, "threshold": { "type": "number" } } }, "below_threshold": { "type": "array", "items": { "type": "object", "properties": { "p": { "type": "number" }, "distance_helps": { "type": "boolean" } } } }, "reading": { "type": "string" }, "receipt": { "title": "wai.quantum.receipt/2", "description": "A result's receipt: an Ed25519 signature, by the key it names, over digest = BLAKE3(\"wai:quantum-service-receipt\\x02\" ‖ len ‖ request ‖ len ‖ result), each of request and result in its RFC 8785 canonical text (the result without its receipt member), each length 8 bytes big-endian. Whatever members the request and the result hold are sealed, the result's engine and schema among them. The first receipts (no canon member, $defs/first) signed serde_json's own text under the domain ending \\x01; they still verify.", "type": "object", "required": [ "alg", "canon", "key", "digest", "signature" ], "properties": { "alg": { "const": "ed25519" }, "canon": { "const": "rfc8785", "description": "The canonical form the digest is taken over." }, "key": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The signing key, 32 bytes in hex." }, "digest": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The digest signed, 32 bytes in hex." }, "signature": { "type": "string", "minLength": 128, "maxLength": 128, "description": "The signature, 64 bytes in hex." } } } } } ] } } }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } } ] } }, { "name": "providers_list", "title": "List the person's quantum providers", "description": "The person's own quantum providers, as their registry lists them: each one's name, kind, protocol, endpoint or command, and where its credential is kept (never the credential itself). With free: true, also what anyone can use at no cost: the engine's methods on this machine with their limits, the free job service, and each provider whose own description states free use (this asks each provider to describe itself).", "inputSchema": { "type": "object", "properties": { "free": { "type": "boolean", "description": "Also list what is free, asking each provider (default false)." } } }, "outputSchema": { "$id": "wai-quantum://schemas/providers_list/1", "type": "object", "description": "The person's providers, and where each one's credential is; with free, what is free.", "anyOf": [ { "type": "object", "description": "The person's providers, and where each one's credential is; with free, what is free.", "required": [ "registry", "providers" ], "properties": { "registry": { "type": "string", "description": "The registry file's path." }, "providers": { "type": "array", "items": { "type": "object" } }, "free": { "type": "object" } } }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } } ] } }, { "name": "provider_estimate", "title": "Plan a run on a provider, and its cost", "description": "The dry run of a program on one of the person's own providers: the device, the exact compile to its native gates and connectivity, the check of the compiled program against the circuit by simulation, the provider's estimate of what it costs and how long it takes, its billing unit, and whether it is free. Nothing is submitted and nothing is spent. Show the person the estimate before any run_on_provider that is not free.", "inputSchema": { "type": "object", "required": [ "provider", "qasm" ], "properties": { "provider": { "type": "string", "description": "The provider's name in the person's registry (providers_list)." }, "qasm": { "type": "string", "description": "The program, OpenQASM 3: its measurements all at the end, every angle a dyadic multiple of 2π (pi/4, 3*pi/8, …), so it compiles exactly to the device's gates." }, "inputs": { "type": "object", "additionalProperties": { "type": "integer" }, "description": "A generator's inputs' values, as {\"n\": 5}." }, "shots": { "type": "integer", "minimum": 1, "description": "Shots (default 1024)." }, "seed": { "type": "integer", "minimum": 0, "description": "A seed, for a provider that is a seeded simulator; a device ignores it." } } }, "outputSchema": { "$id": "wai-quantum://schemas/provider_estimate/1", "type": "object", "description": "The dry run of a job on a provider: nothing submitted, nothing spent.", "anyOf": [ { "type": "object", "description": "The dry run of a job on a provider: nothing submitted, nothing spent.", "required": [ "dry_run", "provider", "plan", "estimate", "free", "confirm" ], "properties": { "dry_run": { "const": true }, "provider": { "type": "object" }, "calibration": { "type": [ "string", "null" ] }, "billing": { "type": "object" }, "plan": { "type": "object" }, "estimate": { "type": "object" }, "free": { "type": "boolean" }, "confirm": { "type": "string", "description": "What the person reads before confirming a run that is not free." } } }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } } ] } }, { "name": "run_on_provider", "title": "Run on a provider (can spend the person's money)", "description": "Runs a program on one of the person's own quantum providers: their device, their account or their simulator. THIS CAN SPEND THE PERSON'S MONEY OR QUOTA. A run that is not free, or whose cost is unknown, is refused unless confirm_cost is true; set it only after the person has seen the estimate (provider_estimate) and agreed to that run. The answer is a job in the service's form: counts keyed by the classical bits, measured on the device and not reproducible by recomputation, with the circuit's exact distribution beside them, sealed in a receipt with the compiled program's hash, the provider, its protocol and the device's calibration snapshot (verify_quantum_result checks it).", "inputSchema": { "type": "object", "required": [ "provider", "qasm" ], "properties": { "provider": { "type": "string", "description": "The provider's name in the person's registry (providers_list)." }, "qasm": { "type": "string", "description": "The program, OpenQASM 3: its measurements all at the end, every angle a dyadic multiple of 2π (pi/4, 3*pi/8, …), so it compiles exactly to the device's gates." }, "inputs": { "type": "object", "additionalProperties": { "type": "integer" }, "description": "A generator's inputs' values, as {\"n\": 5}." }, "shots": { "type": "integer", "minimum": 1, "description": "Shots (default 1024)." }, "seed": { "type": "integer", "minimum": 0, "description": "A seed, for a provider that is a seeded simulator; a device ignores it." }, "confirm_cost": { "type": "boolean", "description": "true only when the person has agreed to this run's cost. A run that is not free is refused without it." } } }, "outputSchema": { "$id": "wai-quantum://schemas/run_on_provider/1", "type": "object", "description": "A job as a host returns it: its status, the method its plan chose and why, the request as submitted, and, once it is done, the result with its receipt: a job's result, or for a set (a request with programs or a sweep, its method set) the set's result. The command line's run --json, the local MCP server's run_quantum_circuit and a run on the person's own provider give a finished job; the job service also gives its id and times, and a job still queued or running, or failed with its error. A job's receipt verifies from this document alone: request and result.", "anyOf": [ { "title": "wai.quantum.job/1", "description": "A job as a host returns it: its status, the method its plan chose and why, the request as submitted, and, once it is done, the result with its receipt: a job's result, or for a set (a request with programs or a sweep, its method set) the set's result. The command line's run --json, the local MCP server's run_quantum_circuit and a run on the person's own provider give a finished job; the job service also gives its id and times, and a job still queued or running, or failed with its error. A job's receipt verifies from this document alone: request and result.", "type": "object", "required": [ "status", "request" ], "properties": { "id": { "type": "string", "description": "The job service's id for the job." }, "status": { "enum": [ "queued", "running", "done", "failed", "cancelled" ] }, "method": { "type": "string", "description": "The method the plan chose; set for a set." }, "why": { "type": "string", "description": "Why the plan chose the method." }, "estimate": { "type": "object", "description": "What the plan admitted the job with.", "required": [ "memory_bytes", "work" ], "properties": { "memory_bytes": { "type": "integer", "minimum": 0 }, "work": { "type": "integer", "minimum": 0, "description": "In the method's own unit." } } }, "request": { "title": "wai.quantum.job-request/1", "description": "A job as a client submits it: a program and what is asked of it, or a set: many programs (programs), or one over a grid of its inputs (sweep), run as one job. The command line, both MCP servers, the job service, the desktop app and the Studio read it alike, and a receipt seals it as it was given. A member the engine does not read is ignored, and sealed with the rest.", "type": "object", "anyOf": [ { "required": [ "qasm" ] }, { "required": [ "programs" ] } ], "properties": { "qasm": { "type": "string", "description": "The program, in OpenQASM 3 or the OpenQASM 2 forms in common use." }, "shots": { "type": "integer", "minimum": 0, "maximum": 1000000, "description": "Measurement shots; 1024 when no observables or amplitudes are asked for, otherwise 0." }, "seed": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "The sampling seed (1 when not given): the same job and seed give the same counts." }, "method": { "type": "string", "description": "auto (the default: the strongest method the program admits), or a method by its name as the methods list names it." }, "observables": { "type": "array", "maxItems": 256, "description": "Pauli observables to take the expectation values of.", "items": { "anyOf": [ { "type": "string", "description": "A Pauli string, as \"Z0 Z1\"; qubits count from 0." }, { "type": "object", "required": [ "pauli" ], "properties": { "pauli": { "type": "string", "description": "A Pauli string, as \"X3\"." }, "coeff": { "type": "number", "description": "Its coefficient (1 when not given)." } } } ] } }, "amplitudes": { "type": "array", "maxItems": 64, "description": "Basis states whose amplitudes to return: one 0 or 1 per qubit, qubit n-1 first.", "items": { "type": "string" } }, "noise": { "type": "object", "description": "A noise model, each channel a probability. A channel not listed here is refused.", "additionalProperties": false, "properties": { "depolarizing_1q": { "type": "number", "minimum": 0, "maximum": 1 }, "depolarizing_2q": { "type": "number", "minimum": 0, "maximum": 1 }, "amplitude_damping": { "type": "number", "minimum": 0, "maximum": 1 }, "dephasing": { "type": "number", "minimum": 0, "maximum": 1 }, "readout": { "type": "number", "minimum": 0, "maximum": 1 } } }, "options": { "type": "object", "description": "Options of the method that runs the job, as the methods list names them (max_bond, cutoff, fusion, trajectories, threshold, max_weight, ladder, max_terms, path_restarts), and memory_gb." }, "compile": { "type": "object", "description": "What a compile is asked for, each optional: the most the output may differ from the program (epsilon, in the operator norm up to a global phase), the level (0 lowers and approximates; 1 also rewrites and folds phases; 2 also resynthesises), the basis, the gate set it writes the program in (clifford_t: every rotation off the multiples of π/4 a Clifford+T word; standard: nothing approximated), whether to give the circuit after each pass (stages), and the twirl and dd passes, last (twirl, with its seed; dd, with its sequence).", "properties": { "epsilon": { "type": "number", "exclusiveMinimum": 0 }, "level": { "type": "integer", "minimum": 0, "maximum": 2 }, "basis": { "enum": [ "clifford_t", "standard" ] }, "stages": { "type": "boolean" }, "twirl": { "description": "Twirl each two-qubit Clifford gate with Paulis drawn from a seeded stream: true (seed 1), or {\"seed\": N}. One seed is one instance, checked to be the same circuit.", "anyOf": [ { "type": "boolean" }, { "type": "object", "required": [ "seed" ], "properties": { "seed": { "type": "integer", "minimum": 0 } } } ] }, "dd": { "description": "Dynamical decoupling in each window where a qubit idles long enough: xx or xy4 (or {\"sequence\": …}), checked to change nothing without noise.", "anyOf": [ { "enum": [ "xx", "xy4" ] }, { "type": "boolean" }, { "type": "object", "properties": { "sequence": { "enum": [ "xx", "xy4" ] } } } ] } } }, "intent": { "description": "What the program must do, checked with the run: one intent or a list. The result's verdict says how far it was checked.", "anyOf": [ { "type": "object", "description": "One of distribution, equivalent, prepares or sampled, with its options.", "properties": { "distribution": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 } }, "tolerance": { "type": "number", "minimum": 0, "maximum": 1 }, "equivalent": { "type": "string" }, "prepares": { "type": "string" }, "sampled": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 } }, "test": { "enum": [ "chi_squared", "g_test" ] }, "alpha": { "type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 1 }, "shots": { "type": "integer", "minimum": 1 }, "seed": { "type": "integer", "minimum": 0 }, "require": { "const": "proof" }, "note": { "type": "string" }, "name": { "type": "string" } } }, { "type": "array", "minItems": 1, "items": { "type": "object", "description": "One of distribution, equivalent, prepares or sampled, with its options.", "properties": { "distribution": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 } }, "tolerance": { "type": "number", "minimum": 0, "maximum": 1 }, "equivalent": { "type": "string" }, "prepares": { "type": "string" }, "sampled": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 } }, "test": { "enum": [ "chi_squared", "g_test" ] }, "alpha": { "type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 1 }, "shots": { "type": "integer", "minimum": 1 }, "seed": { "type": "integer", "minimum": 0 }, "require": { "const": "proof" }, "note": { "type": "string" }, "name": { "type": "string" } } } } ] }, "verdict": { "type": "boolean", "description": "true: the result carries a verdict even with no intent." }, "target": { "description": "A device target: a built-in target's name, or a target document. The program is compiled to it, placed and simulated under its noise; noise may not be given beside it.", "anyOf": [ { "type": "string" }, { "title": "wai.quantum.target/1", "description": "A device target: its qubits, the pairs it couples, its native gates with their errors and durations, and the calibration snapshot they come from. A value not known is left out, never written as zero. Every field but format, name, source, qubits, gates and coupling is optional, and a field the format does not name is refused, so a misspelt one never reads as absent. Its canonical text is its RFC 8785 form, and the BLAKE3 of that text, the target's hash, names the snapshot in a receipt.", "type": "object", "required": [ "format", "name", "source", "qubits", "gates", "coupling" ], "additionalProperties": false, "properties": { "format": { "const": "wai.quantum.target/1" }, "name": { "type": "string", "minLength": 1, "maxLength": 200 }, "source": { "type": "object", "required": [ "format" ], "additionalProperties": false, "properties": { "format": { "type": "string", "description": "The format the target was read from (wai-quantum targets import --help lists them)." }, "note": { "type": "string", "maxLength": 400 } } }, "calibration": { "type": "object", "additionalProperties": false, "properties": { "id": { "type": "string", "maxLength": 400, "description": "The calibration snapshot's id, as the source names it, or a content id of the snapshot read." }, "timestamp": { "type": "string", "maxLength": 400, "description": "When the snapshot was taken, as the source writes it." } } }, "qubits": { "type": "array", "minItems": 1, "maxItems": 2048, "description": "Every qubit, in order.", "items": { "type": "object", "required": [ "qubit" ], "additionalProperties": false, "properties": { "qubit": { "type": "integer", "minimum": 0, "description": "Its index: its place in the list." }, "label": { "type": "string", "description": "The source's own name for it, when that is not its index." }, "t1_us": { "type": "number", "minimum": 0, "description": "T1, microseconds." }, "t2_us": { "type": "number", "minimum": 0, "description": "T2 (the echo or Ramsey time the source reports), microseconds." }, "frequency_ghz": { "type": "number", "minimum": 0, "description": "Its frequency, gigahertz." }, "readout": { "type": "object", "required": [ "p01", "p10" ], "additionalProperties": false, "properties": { "p01": { "type": "number", "minimum": 0, "maximum": 1, "description": "P(reads 1 | holds 0)." }, "p10": { "type": "number", "minimum": 0, "maximum": 1, "description": "P(reads 0 | holds 1)." } } }, "measure_ns": { "type": "number", "minimum": 0, "description": "The measurement's duration, nanoseconds." } } } }, "gates": { "type": "array", "maxItems": 262144, "description": "Each native gate where the device runs it, sorted by gate then qubits.", "items": { "type": "object", "required": [ "gate", "qubits" ], "additionalProperties": false, "properties": { "gate": { "type": "string", "pattern": "^[a-z0-9_]{1,40}$" }, "qubits": { "type": "array", "minItems": 1, "maxItems": 2, "items": { "type": "integer", "minimum": 0 } }, "error": { "type": "number", "minimum": 0, "maximum": 1, "description": "The average gate infidelity." }, "duration_ns": { "type": "number", "minimum": 0, "description": "Nanoseconds." } } } }, "coupling": { "type": "array", "description": "The pairs a two-qubit gate may act on, each once, the lower qubit first, sorted.", "items": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "type": "integer", "minimum": 0 } } } } } ] }, "repair": { "description": "Repair the program first on its flagged lines: true, or the choices.", "anyOf": [ { "type": "boolean" }, { "type": "object", "properties": { "max_iterations": { "type": "integer", "minimum": 1 }, "dyadic_bits": { "type": "integer", "minimum": 1, "maximum": 32 }, "sizes": { "type": "object", "additionalProperties": { "type": "integer", "minimum": 1 } } } } ] }, "history": { "type": "object", "description": "The program's history's account of the version the job runs: its digest, and the gates and lines in each hand. The receipt binds it; a history recomputes and checks it." }, "provider": { "type": "string", "description": "The person's own provider to run on, by the name their registry gives it. Only a host that holds their credentials runs such a job; every other host refuses it." }, "programs": { "type": "array", "minItems": 1, "items": { "anyOf": [ { "type": "string", "description": "A program's text." }, { "type": "object", "required": [ "qasm" ], "description": "A job of its own, read as a job request is (no programs or sweep in it); each item of the set's result holds its request in full." } ] }, "description": "A set (engine::sets): the programs to run as one job, each a program's text or a job of its own; the request's other fields apply to every item that does not set them itself." }, "sweep": { "type": "object", "additionalProperties": { "type": "array", "minItems": 1, "items": { "type": "number" } }, "description": "A set over the request's own qasm: values for each of the program's inputs (integer, float or angle), every combination run, the names in sorted order and the first varying slowest." }, "dry_run": { "type": "boolean", "description": "With true: what the host would do with the job or set, running nothing." }, "mitigate": { "description": "Mitigate the job's expectation values (or, for readout, its counts) under its noise (engine::mitigate): zne, pea, pec, cdr, vd or readout, or {\"method\", …} with its options. The result's mitigation gives each value raw and mitigated.", "anyOf": [ { "enum": [ "zne", "pea", "pec", "cdr", "vd", "readout" ] }, { "type": "object", "required": [ "method" ] } ] } } }, "result": { "anyOf": [ { "title": "wai.quantum.job-result/1", "description": "A job's result as the engine gives it, on every host: what was asked of the program, computed by the method its plan chose, with that method's accuracy class. The receipt seals the result without its receipt member, beside the request. A result names the engine that made it and this schema (engine and schema); results made before results carried them have neither and follow this schema all the same.", "type": "object", "required": [ "method", "qubits", "gates", "accuracy" ], "properties": { "engine": { "type": "object", "description": "The engine that made the result: the wai-quantum crate's name and version.", "required": [ "name", "version" ], "properties": { "name": { "const": "wai-quantum" }, "version": { "type": "string", "description": "Its semantic version, as MAJOR.MINOR.PATCH." } } }, "schema": { "const": "wai.quantum.job-result/1", "description": "The schema the result follows." }, "method": { "type": "string", "description": "The method that ran the job (provider for a run on the person's own provider)." }, "qubits": { "type": "integer", "minimum": 0 }, "gates": { "type": "integer", "minimum": 0 }, "accuracy": { "type": "object", "description": "What the method promises of the numbers it gave.", "required": [ "class" ], "properties": { "class": { "enum": [ "bit-exact", "exact", "single", "bounded", "estimate", "heuristic", "measured" ], "description": "bit-exact: the same bits on every machine; exact: no approximation beyond double-precision rounding; single: single-precision arithmetic; bounded: a rigorous bound beside each value; estimate: a statistical estimate with its standard error; heuristic: an approximation with an estimate of its error, not a bound; measured: counts a device returned, not reproducible by recomputation." }, "note": { "type": "string" }, "fusion": { "type": "integer" }, "device": { "type": "string" }, "threshold": { "type": "number" }, "max_weight": { "type": [ "integer", "null" ] }, "max_bond": { "type": "integer" }, "max_bond_used": { "type": "integer" }, "discarded_weight": { "type": "number" }, "fidelity_estimate": { "type": "number" }, "truncations": { "type": "integer" }, "shots": { "type": "integer" }, "trajectories": { "type": "integer" }, "histories": { "type": "integer" }, "gate_applications": { "type": "integer" }, "max_cut": { "type": "integer" }, "order_work": { "type": "number" }, "batch": { "type": "integer" } } }, "state_hash": { "type": "string", "description": "The bit-exact method's statevector hash (BLAKE3, hex): the same on every machine." }, "counts": { "type": "object", "description": "Outcomes and their counts, keyed by the program's classical bits, the highest bit first. At most 65536 outcomes are listed; omitted_shots holds the rest.", "additionalProperties": { "type": "integer", "minimum": 0 } }, "distinct_outcomes": { "type": "integer", "minimum": 0 }, "omitted_shots": { "type": "integer", "minimum": 0 }, "outcome_dimension": { "type": "integer", "minimum": 0, "description": "The stabilizer method: the dimension of the measured outcomes' affine space." }, "shots": { "type": "integer", "minimum": 0, "description": "The shots, where the method names them in the result (trajectories, provider)." }, "expectations": { "type": "array", "items": { "type": "object", "required": [ "observable", "coeff", "value" ], "properties": { "observable": { "type": "string" }, "coeff": { "type": "number" }, "value": { "type": "number", "description": "The coefficient times the expectation value." }, "stderr": { "type": "number", "description": "The standard error, for an estimate." }, "bound": { "type": "number", "description": "A rigorous bound on |exact − value|, for the bounded class." }, "peak_terms": { "type": "integer" }, "threshold_reached": { "type": "number" }, "max_terms": { "type": "integer" }, "ladder": { "type": "array", "description": "The value at thresholds a decade apart, the asked one last.", "items": { "type": "object", "required": [ "threshold", "value", "bound" ], "properties": { "threshold": { "type": "number" }, "value": { "type": "number" }, "bound": { "type": "number" }, "peak_terms": { "type": "integer" }, "threshold_reached": { "type": "number" } } } } } } }, "amplitudes": { "type": "array", "items": { "type": "object", "required": [ "bits", "re", "im" ], "properties": { "bits": { "type": "string", "description": "One 0 or 1 per qubit, qubit n-1 first." }, "re": { "type": "number" }, "im": { "type": "number" } } } }, "global_phase": { "type": "string", "description": "Why the amplitudes' global phase is not fixed, when it is not." }, "warning": { "type": "string" }, "contraction_flops": { "type": "number", "description": "The tensor network's contraction cost." }, "dynamic": { "type": "object", "description": "A program that measures in the middle, resets or branches on a measured bit: how it ran.", "properties": { "measurements_and_resets": { "type": "integer", "minimum": 0 }, "branches_run": { "type": "integer", "minimum": 0 }, "states_at_once": { "type": "integer", "minimum": 0 }, "branches_weighed": { "type": "integer", "minimum": 0 } } }, "outputs": { "type": "array", "description": "The program's output declarations: each its name and type, and its value, or the places of its bits in each outcome.", "items": { "type": "object", "required": [ "name", "type" ], "properties": { "name": { "type": "string" }, "type": { "type": "string" }, "bits": { "type": "array", "items": { "type": "integer", "minimum": 0 } }, "value": { "description": "A number, a boolean, a bit string, a duration's text, {\"re\", \"im\"}, or an array of them." } } } }, "timing": { "type": "object", "description": "A program that states durations (delay, box, stretch) the method does not apply: said so, with the reader's code.", "required": [ "applied", "why" ], "properties": { "applied": { "type": "boolean" }, "code": { "type": "string" }, "why": { "type": "string" } } }, "diagnostics": { "type": "array", "description": "The reader's warnings and notes on the program, each with its code.", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "compiled": { "description": "How the program was compiled before it ran: on the person's own provider, to the device's gates; or, asked with compile, to a basis within a budget. Either way, basis is the gate set it was compiled to.", "anyOf": [ { "type": "object", "description": "A provider job: the program sent, compiled exactly to the device's own gates: its basis (the device's gate set), the BLAKE3 of its OpenQASM 3 text, its counts of gates and swaps, its layouts, and the check it passed before it was sent.", "required": [ "basis", "program" ], "properties": { "basis": { "type": "string" }, "program": { "type": "string" }, "hash": { "type": "string" }, "native_gates": { "type": "integer" }, "two_qubit_gates": { "type": "integer" }, "swaps": { "type": "integer" }, "layout": { "type": "array", "items": { "type": "integer" } }, "final_layout": { "type": "array", "items": { "type": "integer" } }, "checked": { "type": "string" }, "placement": { "type": "object", "description": "Where the program was placed on the device's qubits, and why." } } }, { "type": "object", "description": "A job asked to compile its program first: what ran is the compiled circuit, within distance of the program in the operator norm up to a global phase.", "required": [ "basis", "verdict" ], "properties": { "basis": { "enum": [ "clifford_t", "standard" ], "description": "The gate set the program was compiled to." }, "level": { "type": "integer", "minimum": 0 }, "epsilon": { "type": "number", "description": "The budget asked for." }, "distance": { "type": [ "number", "null" ], "description": "The bound the passes' distances add to." }, "verdict": { "type": "string" }, "source": { "type": "object", "description": "A circuit's counts, as the compiler counts them.", "properties": { "gates": { "type": "integer", "minimum": 0 }, "one_qubit": { "type": "integer", "minimum": 0 }, "two_qubit": { "type": "integer", "minimum": 0 }, "three_qubit": { "type": "integer", "minimum": 0 }, "cnots": { "type": "integer", "minimum": 0 }, "t_count": { "type": "integer", "minimum": 0 }, "rotations": { "type": "integer", "minimum": 0 }, "depth": { "type": "integer", "minimum": 0 } } }, "output": { "type": "object", "description": "A circuit's counts, as the compiler counts them.", "properties": { "gates": { "type": "integer", "minimum": 0 }, "one_qubit": { "type": "integer", "minimum": 0 }, "two_qubit": { "type": "integer", "minimum": 0 }, "three_qubit": { "type": "integer", "minimum": 0 }, "cnots": { "type": "integer", "minimum": 0 }, "t_count": { "type": "integer", "minimum": 0 }, "rotations": { "type": "integer", "minimum": 0 }, "depth": { "type": "integer", "minimum": 0 } } }, "certificate": { "type": [ "string", "null" ], "description": "The BLAKE3 of the compile certificate's RFC 8785 text, in hex." }, "note": { "type": "string" } } } ] }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } }, "target": { "type": "object", "description": "A run on a device target: which target (its hash, as its receipt binds it), its calibration snapshot, where the program was placed and why, and the noise derived from the target.", "required": [ "name", "hash" ], "properties": { "name": { "type": "string" }, "hash": { "type": "string" }, "hash_is": { "type": "string" }, "calibration": { "type": "object", "properties": { "id": { "type": "string" }, "timestamp": { "type": "string" } } }, "source": { "type": "object", "properties": { "format": { "type": "string" }, "note": { "type": "string" } } }, "placement": { "type": "object", "description": "The native gate set, the layout and routes chosen, the swaps, the expected success beside the fewest-swaps layout's, and the check of the compiled program." }, "noise": { "type": "object", "description": "The noise model derived from the target's calibration: its channels, durations and idling, and each qubit's readout." } } }, "repaired": { "type": "object", "description": "A job asked to repair its program first: the program that ran, each repair, and what needs a person.", "properties": { "qasm": { "type": "string" }, "repairs": { "type": "array", "items": { "type": "object", "required": [ "code", "by", "edits" ], "properties": { "code": { "type": "string" }, "rule": { "type": "string" }, "by": { "enum": [ "engine", "proposal" ] }, "flagged": { "type": "array", "items": { "type": "integer" } }, "edits": { "type": "array", "items": { "type": "object", "properties": { "line": { "type": "integer" }, "before": { "type": [ "string", "null" ] }, "after": { "type": [ "string", "null" ] } } } } } } }, "needs_person": { "type": "array", "items": { "type": "object" } } } }, "elapsed_ms": { "type": "integer", "minimum": 0, "description": "Wall time of the run, where the host has a clock (not in a browser tab)." }, "energy": { "description": "The CPU energy of the job's process as the kernel counts it, with its uncertainty and what it leaves out, or unmetered with the reason.", "anyOf": [ { "type": "object", "required": [ "unmetered" ], "properties": { "unmetered": { "type": "string" }, "service_kwh": { "type": "number", "description": "A provider job: the provider's own figure." }, "service_kwh_is": { "type": "string" } } }, { "type": "object", "required": [ "joules_micro", "energy_provenance", "coverage" ], "properties": { "joules_micro": { "type": "integer", "minimum": 1 }, "energy_provenance": { "type": "string" }, "energy_uncertainty": { "type": "object", "properties": { "relative_ppm": { "type": "integer" }, "window_us": { "type": "integer" } } }, "energy_counter_filtering": { "type": "string" }, "coverage": { "enum": [ "whole", "partial" ] }, "covers": { "type": "string" }, "excludes": { "type": "array", "items": { "type": "string" } }, "cpu_ms": { "type": "integer" }, "source": { "type": "string" }, "attribution": { "enum": [ "process", "none" ], "description": "Whose energy it is: the job's worker process, or none (the processor packages' over the job's window, every process on the host in it)." }, "packages": { "type": "integer", "minimum": 1, "description": "The processor packages read." }, "concurrent_jobs": { "type": "integer", "minimum": 0, "description": "Other jobs that ran on the host during the window." }, "counter": { "type": "object", "description": "The package counter as seen: the longest it went between updates, and the smallest step it took.", "properties": { "update_us": { "type": "integer", "minimum": 0 }, "step_uj": { "type": "integer", "minimum": 0 } } }, "declared": { "type": "string", "description": "What the stated uncertainty covers, and what it does not." } } } ] }, "receipt": { "anyOf": [ { "title": "wai.quantum.receipt/2", "description": "A result's receipt: an Ed25519 signature, by the key it names, over digest = BLAKE3(\"wai:quantum-service-receipt\\x02\" ‖ len ‖ request ‖ len ‖ result), each of request and result in its RFC 8785 canonical text (the result without its receipt member), each length 8 bytes big-endian. Whatever members the request and the result hold are sealed, the result's engine and schema among them. The first receipts (no canon member, $defs/first) signed serde_json's own text under the domain ending \\x01; they still verify.", "type": "object", "required": [ "alg", "canon", "key", "digest", "signature" ], "properties": { "alg": { "const": "ed25519" }, "canon": { "const": "rfc8785", "description": "The canonical form the digest is taken over." }, "key": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The signing key, 32 bytes in hex." }, "digest": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The digest signed, 32 bytes in hex." }, "signature": { "type": "string", "minLength": 128, "maxLength": 128, "description": "The signature, 64 bytes in hex." } } }, { "description": "The first form, before canon: the digest is over serde_json's own text of each, under the domain ending \\x01. Never written now; still verified.", "type": "object", "required": [ "alg", "key", "digest", "signature" ], "properties": { "alg": { "const": "ed25519" }, "key": { "type": "string", "minLength": 64, "maxLength": 64 }, "digest": { "type": "string", "minLength": 64, "maxLength": 64 }, "signature": { "type": "string", "minLength": 128, "maxLength": 128 } } } ] }, "provider": { "type": "object", "description": "A provider job: the provider's name, kind and protocol, the device, its provenance, and the hash of its description." }, "calibration": { "type": [ "string", "null" ], "description": "A provider job: the calibration snapshot it ran under." }, "job": { "type": "object", "description": "A provider job: the provider's job id and its status checks." }, "ideal": { "description": "A provider job: the circuit's exact distribution set beside the measured counts.", "anyOf": [ { "type": "object", "required": [ "computed", "total_variation_distance", "hellinger_fidelity" ], "properties": { "computed": { "const": true }, "method": { "type": "string" }, "total_variation_distance": { "type": "number" }, "hellinger_fidelity": { "type": "number" }, "sampling_tvd_expected": { "type": "number" }, "ideal_outcomes": { "type": "integer" }, "note": { "type": "string" } } }, { "type": "object", "required": [ "computed", "why" ], "properties": { "computed": { "const": false }, "why": { "type": "string" } } } ] }, "cost": { "type": "object", "description": "A provider job: the estimate shown before it was sent, what the provider says it charged, and whether the person confirmed a run that was not free." }, "provenance": { "title": "wai.quantum.provenance/1", "description": "What a result came from, under the five categories cross-platform provenance surveys use: the circuit, the computer, the compilation, the execution and the software. A host adds it to the results it seals (the job service does, and each item of a set); a result without it reads as it always did. wai-quantum-service/docs/provenance.md maps every field to where it is and whether the receipt seals it.", "type": "object", "required": [ "schema", "circuit", "computer", "compilation", "execution", "software" ], "properties": { "schema": { "const": "wai.quantum.provenance/1" }, "circuit": { "type": "object", "description": "The program: the BLAKE3 digest of its text as given, its qubits and its gates.", "required": [ "program" ], "properties": { "program": { "type": "string", "description": "BLAKE3 of the program's text, in hex." }, "qubits": { "type": "integer", "minimum": 0 }, "gates": { "type": [ "integer", "null" ] } } }, "computer": { "type": "object", "description": "What ran it: a classical simulator, the method and its accuracy class, and a device target's hash when the job named one.", "required": [ "kind", "method" ], "properties": { "kind": { "const": "simulator" }, "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "target": { "type": "string", "description": "The device target's hash; its layout, routes and noise are in the result's own target." } } }, "compilation": { "type": "object", "description": "Whether the job asked to be compiled; if it did, each pass in order with its check's verdict, the certificate's digest, the gate set compiled to (its basis), the level, the ε budget and the distance the result carries, and that no pass draws a random number.", "required": [ "asked" ], "properties": { "asked": { "type": "boolean" }, "passes": { "type": [ "array", "null" ], "items": { "type": "object", "properties": { "pass": { "type": "string" }, "verdict": { "type": [ "string", "null" ] } } } }, "certificate": { "type": [ "string", "null" ] }, "basis": { "type": [ "string", "null" ], "description": "The gate set compiled to: clifford_t or standard." }, "level": { "type": [ "integer", "null" ] }, "epsilon": { "type": [ "number", "null" ] }, "distance": { "type": [ "number", "null" ] }, "seeded": { "const": false }, "device": { "type": "string", "description": "A job on a device target, compiled exactly to its gates: where its layout and routes are." }, "status": { "const": "not-applicable" }, "why": { "type": "string" } } }, "execution": { "type": "object", "description": "The shots, the seed and the plan the job ran under; its identifier and times are the host's, outside the result.", "required": [ "plan" ], "properties": { "shots": { "type": [ "integer", "null" ] }, "seed": { "type": [ "integer", "null" ] }, "plan": { "type": "object", "properties": { "method": { "type": "string" }, "why": { "type": "string" }, "memory_bytes": { "type": "integer", "minimum": 0 }, "work": { "type": "integer", "minimum": 0 } } } } }, "software": { "type": "object", "description": "The engine's name and version, and the host's.", "required": [ "engine", "host" ], "properties": { "engine": { "type": "string" }, "host": { "type": "string" } } } } }, "mitigation": { "title": "wai.quantum.mitigation/1", "description": "A job's mitigation (its request's mitigate, engine::mitigate), in its result: the method and the options it ran with, its bias and variance assumptions, each observable raw and mitigated with a standard error each and the ideal value (or, for readout, the counts inverted as a quasi-distribution), the method's own details and what it spent. docs/qec.md describes each method.", "type": "object", "required": [ "method", "options", "assumptions" ], "properties": { "method": { "enum": [ "zne", "pea", "pec", "cdr", "vd", "readout" ] }, "options": { "type": "object", "description": "The options it ran with, the defaults filled in.", "properties": { "method": { "type": "string" }, "shots": { "type": "integer" }, "seed": { "type": "integer" }, "factors": { "type": "array", "items": { "type": "number" } }, "extrapolation": { "enum": [ "richardson", "linear", "exponential" ] }, "samples": { "type": "integer" }, "training": { "type": "integer" }, "keep": { "type": "integer" }, "learn_shots": { "type": "integer" } } }, "assumptions": { "type": "object", "properties": { "bias": { "type": "string" }, "variance": { "type": "string" } } }, "noise": { "type": "string", "description": "How the job's noise model is read for the method." }, "note": { "type": "string" }, "observables": { "type": "array", "items": { "type": "object", "description": "One observable: its raw value and the mitigated one, each with its standard error, and the ideal value a simulation knows.", "properties": { "observable": { "type": "string" }, "coeff": { "type": "number" }, "raw": { "type": "number" }, "raw_stderr": { "type": "number" }, "mitigated": { "type": "number" }, "stderr": { "type": "number" }, "ideal": { "type": "number" } } } }, "distribution": { "type": "array", "description": "readout: each outcome's raw share and its mitigated quasi-probability, with its standard error.", "items": { "type": "object", "properties": { "bits": { "type": "string" }, "raw": { "type": "number" }, "mitigated": { "type": "number" }, "stderr": { "type": "number" } } } }, "details": { "type": "object", "description": "The method's own: the folded scales and the folding check (zne), the learned model and the amplified values (pea), the quasi-probability and the value it converges to (pec), the training fits (cdr), the purity (vd), the flip and its amplification (readout).", "additionalProperties": true }, "cost": { "type": "object", "description": "The circuits and shots it spent beyond the job's own.", "properties": { "circuits": { "type": "integer", "minimum": 0 }, "shots": { "type": "integer", "minimum": 0 }, "note": { "type": "string" } } } } } } }, { "title": "wai.quantum.set/1", "description": "A set's result: many programs, or one program over a grid of its inputs, run as one job (engine::sets). Its head holds the count, how many items finished and failed, the Merkle root over the items' leaves, the set's energy and time; the set's receipt seals the set's request and its head. Each item is a plain job with its own receipt, its index, its point in a sweep, and its path to the root, so it is shown sealed by the set alone. A result names the engine that made it and this schema (engine and schema).", "type": "object", "required": [ "format", "count", "done", "failed", "root", "items" ], "properties": { "engine": { "type": "object", "description": "The engine that made the result: the wai-quantum crate's name and version.", "required": [ "name", "version" ], "properties": { "name": { "const": "wai-quantum" }, "version": { "type": "string" } } }, "schema": { "const": "wai.quantum.set/1" }, "format": { "const": "wai.quantum.set/1" }, "count": { "type": "integer", "minimum": 1 }, "done": { "type": "integer", "minimum": 0 }, "failed": { "type": "integer", "minimum": 0 }, "root": { "type": "string", "description": "The Merkle root of the items' leaves, in hex (domains moq-jwp:merkle-leaf and moq-jwp:merkle-node, version 1)." }, "energy": { "description": "The CPU energy of the job's process as the kernel counts it, with its uncertainty and what it leaves out, or unmetered with the reason.", "anyOf": [ { "type": "object", "required": [ "unmetered" ], "properties": { "unmetered": { "type": "string" }, "service_kwh": { "type": "number", "description": "A provider job: the provider's own figure." }, "service_kwh_is": { "type": "string" } } }, { "type": "object", "required": [ "joules_micro", "energy_provenance", "coverage" ], "properties": { "joules_micro": { "type": "integer", "minimum": 1 }, "energy_provenance": { "type": "string" }, "energy_uncertainty": { "type": "object", "properties": { "relative_ppm": { "type": "integer" }, "window_us": { "type": "integer" } } }, "energy_counter_filtering": { "type": "string" }, "coverage": { "enum": [ "whole", "partial" ] }, "covers": { "type": "string" }, "excludes": { "type": "array", "items": { "type": "string" } }, "cpu_ms": { "type": "integer" }, "source": { "type": "string" }, "attribution": { "enum": [ "process", "none" ], "description": "Whose energy it is: the job's worker process, or none (the processor packages' over the job's window, every process on the host in it)." }, "packages": { "type": "integer", "minimum": 1, "description": "The processor packages read." }, "concurrent_jobs": { "type": "integer", "minimum": 0, "description": "Other jobs that ran on the host during the window." }, "counter": { "type": "object", "description": "The package counter as seen: the longest it went between updates, and the smallest step it took.", "properties": { "update_us": { "type": "integer", "minimum": 0 }, "step_uj": { "type": "integer", "minimum": 0 } } }, "declared": { "type": "string", "description": "What the stated uncertainty covers, and what it does not." } } } ] }, "elapsed_ms": { "type": "integer", "minimum": 0 }, "receipt": { "title": "wai.quantum.receipt/2", "description": "A result's receipt: an Ed25519 signature, by the key it names, over digest = BLAKE3(\"wai:quantum-service-receipt\\x02\" ‖ len ‖ request ‖ len ‖ result), each of request and result in its RFC 8785 canonical text (the result without its receipt member), each length 8 bytes big-endian. Whatever members the request and the result hold are sealed, the result's engine and schema among them. The first receipts (no canon member, $defs/first) signed serde_json's own text under the domain ending \\x01; they still verify.", "type": "object", "required": [ "alg", "canon", "key", "digest", "signature" ], "properties": { "alg": { "const": "ed25519" }, "canon": { "const": "rfc8785", "description": "The canonical form the digest is taken over." }, "key": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The signing key, 32 bytes in hex." }, "digest": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The digest signed, 32 bytes in hex." }, "signature": { "type": "string", "minLength": 128, "maxLength": 128, "description": "The signature, 64 bytes in hex." } } }, "items": { "type": "array", "items": { "type": "object", "description": "One item: its index, its point in a sweep, its request (a plain job, complete in itself), and its result with its own receipt, or why it failed; and its path to the set's root.", "required": [ "index", "request", "status", "path" ], "properties": { "index": { "type": "integer", "minimum": 0 }, "point": { "type": "object", "description": "A sweep's item: the value of each input it was run at." }, "status": { "enum": [ "done", "failed" ] }, "method": { "type": "string" }, "why": { "type": "string" }, "request": { "title": "wai.quantum.job-request/1", "description": "A job as a client submits it: a program and what is asked of it, or a set: many programs (programs), or one over a grid of its inputs (sweep), run as one job. The command line, both MCP servers, the job service, the desktop app and the Studio read it alike, and a receipt seals it as it was given. A member the engine does not read is ignored, and sealed with the rest.", "type": "object", "anyOf": [ { "required": [ "qasm" ] }, { "required": [ "programs" ] } ], "properties": { "qasm": { "type": "string", "description": "The program, in OpenQASM 3 or the OpenQASM 2 forms in common use." }, "shots": { "type": "integer", "minimum": 0, "maximum": 1000000, "description": "Measurement shots; 1024 when no observables or amplitudes are asked for, otherwise 0." }, "seed": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "The sampling seed (1 when not given): the same job and seed give the same counts." }, "method": { "type": "string", "description": "auto (the default: the strongest method the program admits), or a method by its name as the methods list names it." }, "observables": { "type": "array", "maxItems": 256, "description": "Pauli observables to take the expectation values of.", "items": { "anyOf": [ { "type": "string", "description": "A Pauli string, as \"Z0 Z1\"; qubits count from 0." }, { "type": "object", "required": [ "pauli" ], "properties": { "pauli": { "type": "string", "description": "A Pauli string, as \"X3\"." }, "coeff": { "type": "number", "description": "Its coefficient (1 when not given)." } } } ] } }, "amplitudes": { "type": "array", "maxItems": 64, "description": "Basis states whose amplitudes to return: one 0 or 1 per qubit, qubit n-1 first.", "items": { "type": "string" } }, "noise": { "type": "object", "description": "A noise model, each channel a probability. A channel not listed here is refused.", "additionalProperties": false, "properties": { "depolarizing_1q": { "type": "number", "minimum": 0, "maximum": 1 }, "depolarizing_2q": { "type": "number", "minimum": 0, "maximum": 1 }, "amplitude_damping": { "type": "number", "minimum": 0, "maximum": 1 }, "dephasing": { "type": "number", "minimum": 0, "maximum": 1 }, "readout": { "type": "number", "minimum": 0, "maximum": 1 } } }, "options": { "type": "object", "description": "Options of the method that runs the job, as the methods list names them (max_bond, cutoff, fusion, trajectories, threshold, max_weight, ladder, max_terms, path_restarts), and memory_gb." }, "compile": { "type": "object", "description": "What a compile is asked for, each optional: the most the output may differ from the program (epsilon, in the operator norm up to a global phase), the level (0 lowers and approximates; 1 also rewrites and folds phases; 2 also resynthesises), the basis, the gate set it writes the program in (clifford_t: every rotation off the multiples of π/4 a Clifford+T word; standard: nothing approximated), whether to give the circuit after each pass (stages), and the twirl and dd passes, last (twirl, with its seed; dd, with its sequence).", "properties": { "epsilon": { "type": "number", "exclusiveMinimum": 0 }, "level": { "type": "integer", "minimum": 0, "maximum": 2 }, "basis": { "enum": [ "clifford_t", "standard" ] }, "stages": { "type": "boolean" }, "twirl": { "description": "Twirl each two-qubit Clifford gate with Paulis drawn from a seeded stream: true (seed 1), or {\"seed\": N}. One seed is one instance, checked to be the same circuit.", "anyOf": [ { "type": "boolean" }, { "type": "object", "required": [ "seed" ], "properties": { "seed": { "type": "integer", "minimum": 0 } } } ] }, "dd": { "description": "Dynamical decoupling in each window where a qubit idles long enough: xx or xy4 (or {\"sequence\": …}), checked to change nothing without noise.", "anyOf": [ { "enum": [ "xx", "xy4" ] }, { "type": "boolean" }, { "type": "object", "properties": { "sequence": { "enum": [ "xx", "xy4" ] } } } ] } } }, "intent": { "description": "What the program must do, checked with the run: one intent or a list. The result's verdict says how far it was checked.", "anyOf": [ { "type": "object", "description": "One of distribution, equivalent, prepares or sampled, with its options.", "properties": { "distribution": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 } }, "tolerance": { "type": "number", "minimum": 0, "maximum": 1 }, "equivalent": { "type": "string" }, "prepares": { "type": "string" }, "sampled": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 } }, "test": { "enum": [ "chi_squared", "g_test" ] }, "alpha": { "type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 1 }, "shots": { "type": "integer", "minimum": 1 }, "seed": { "type": "integer", "minimum": 0 }, "require": { "const": "proof" }, "note": { "type": "string" }, "name": { "type": "string" } } }, { "type": "array", "minItems": 1, "items": { "type": "object", "description": "One of distribution, equivalent, prepares or sampled, with its options.", "properties": { "distribution": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 } }, "tolerance": { "type": "number", "minimum": 0, "maximum": 1 }, "equivalent": { "type": "string" }, "prepares": { "type": "string" }, "sampled": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 } }, "test": { "enum": [ "chi_squared", "g_test" ] }, "alpha": { "type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 1 }, "shots": { "type": "integer", "minimum": 1 }, "seed": { "type": "integer", "minimum": 0 }, "require": { "const": "proof" }, "note": { "type": "string" }, "name": { "type": "string" } } } } ] }, "verdict": { "type": "boolean", "description": "true: the result carries a verdict even with no intent." }, "target": { "description": "A device target: a built-in target's name, or a target document. The program is compiled to it, placed and simulated under its noise; noise may not be given beside it.", "anyOf": [ { "type": "string" }, { "title": "wai.quantum.target/1", "description": "A device target: its qubits, the pairs it couples, its native gates with their errors and durations, and the calibration snapshot they come from. A value not known is left out, never written as zero. Every field but format, name, source, qubits, gates and coupling is optional, and a field the format does not name is refused, so a misspelt one never reads as absent. Its canonical text is its RFC 8785 form, and the BLAKE3 of that text, the target's hash, names the snapshot in a receipt.", "type": "object", "required": [ "format", "name", "source", "qubits", "gates", "coupling" ], "additionalProperties": false, "properties": { "format": { "const": "wai.quantum.target/1" }, "name": { "type": "string", "minLength": 1, "maxLength": 200 }, "source": { "type": "object", "required": [ "format" ], "additionalProperties": false, "properties": { "format": { "type": "string", "description": "The format the target was read from (wai-quantum targets import --help lists them)." }, "note": { "type": "string", "maxLength": 400 } } }, "calibration": { "type": "object", "additionalProperties": false, "properties": { "id": { "type": "string", "maxLength": 400, "description": "The calibration snapshot's id, as the source names it, or a content id of the snapshot read." }, "timestamp": { "type": "string", "maxLength": 400, "description": "When the snapshot was taken, as the source writes it." } } }, "qubits": { "type": "array", "minItems": 1, "maxItems": 2048, "description": "Every qubit, in order.", "items": { "type": "object", "required": [ "qubit" ], "additionalProperties": false, "properties": { "qubit": { "type": "integer", "minimum": 0, "description": "Its index: its place in the list." }, "label": { "type": "string", "description": "The source's own name for it, when that is not its index." }, "t1_us": { "type": "number", "minimum": 0, "description": "T1, microseconds." }, "t2_us": { "type": "number", "minimum": 0, "description": "T2 (the echo or Ramsey time the source reports), microseconds." }, "frequency_ghz": { "type": "number", "minimum": 0, "description": "Its frequency, gigahertz." }, "readout": { "type": "object", "required": [ "p01", "p10" ], "additionalProperties": false, "properties": { "p01": { "type": "number", "minimum": 0, "maximum": 1, "description": "P(reads 1 | holds 0)." }, "p10": { "type": "number", "minimum": 0, "maximum": 1, "description": "P(reads 0 | holds 1)." } } }, "measure_ns": { "type": "number", "minimum": 0, "description": "The measurement's duration, nanoseconds." } } } }, "gates": { "type": "array", "maxItems": 262144, "description": "Each native gate where the device runs it, sorted by gate then qubits.", "items": { "type": "object", "required": [ "gate", "qubits" ], "additionalProperties": false, "properties": { "gate": { "type": "string", "pattern": "^[a-z0-9_]{1,40}$" }, "qubits": { "type": "array", "minItems": 1, "maxItems": 2, "items": { "type": "integer", "minimum": 0 } }, "error": { "type": "number", "minimum": 0, "maximum": 1, "description": "The average gate infidelity." }, "duration_ns": { "type": "number", "minimum": 0, "description": "Nanoseconds." } } } }, "coupling": { "type": "array", "description": "The pairs a two-qubit gate may act on, each once, the lower qubit first, sorted.", "items": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "type": "integer", "minimum": 0 } } } } } ] }, "repair": { "description": "Repair the program first on its flagged lines: true, or the choices.", "anyOf": [ { "type": "boolean" }, { "type": "object", "properties": { "max_iterations": { "type": "integer", "minimum": 1 }, "dyadic_bits": { "type": "integer", "minimum": 1, "maximum": 32 }, "sizes": { "type": "object", "additionalProperties": { "type": "integer", "minimum": 1 } } } } ] }, "history": { "type": "object", "description": "The program's history's account of the version the job runs: its digest, and the gates and lines in each hand. The receipt binds it; a history recomputes and checks it." }, "provider": { "type": "string", "description": "The person's own provider to run on, by the name their registry gives it. Only a host that holds their credentials runs such a job; every other host refuses it." }, "programs": { "type": "array", "minItems": 1, "items": { "anyOf": [ { "type": "string", "description": "A program's text." }, { "type": "object", "required": [ "qasm" ], "description": "A job of its own, read as a job request is (no programs or sweep in it); each item of the set's result holds its request in full." } ] }, "description": "A set (engine::sets): the programs to run as one job, each a program's text or a job of its own; the request's other fields apply to every item that does not set them itself." }, "sweep": { "type": "object", "additionalProperties": { "type": "array", "minItems": 1, "items": { "type": "number" } }, "description": "A set over the request's own qasm: values for each of the program's inputs (integer, float or angle), every combination run, the names in sorted order and the first varying slowest." }, "dry_run": { "type": "boolean", "description": "With true: what the host would do with the job or set, running nothing." }, "mitigate": { "description": "Mitigate the job's expectation values (or, for readout, its counts) under its noise (engine::mitigate): zne, pea, pec, cdr, vd or readout, or {\"method\", …} with its options. The result's mitigation gives each value raw and mitigated.", "anyOf": [ { "enum": [ "zne", "pea", "pec", "cdr", "vd", "readout" ] }, { "type": "object", "required": [ "method" ] } ] } } }, "result": { "title": "wai.quantum.job-result/1", "description": "A job's result as the engine gives it, on every host: what was asked of the program, computed by the method its plan chose, with that method's accuracy class. The receipt seals the result without its receipt member, beside the request. A result names the engine that made it and this schema (engine and schema); results made before results carried them have neither and follow this schema all the same.", "type": "object", "required": [ "method", "qubits", "gates", "accuracy" ], "properties": { "engine": { "type": "object", "description": "The engine that made the result: the wai-quantum crate's name and version.", "required": [ "name", "version" ], "properties": { "name": { "const": "wai-quantum" }, "version": { "type": "string", "description": "Its semantic version, as MAJOR.MINOR.PATCH." } } }, "schema": { "const": "wai.quantum.job-result/1", "description": "The schema the result follows." }, "method": { "type": "string", "description": "The method that ran the job (provider for a run on the person's own provider)." }, "qubits": { "type": "integer", "minimum": 0 }, "gates": { "type": "integer", "minimum": 0 }, "accuracy": { "type": "object", "description": "What the method promises of the numbers it gave.", "required": [ "class" ], "properties": { "class": { "enum": [ "bit-exact", "exact", "single", "bounded", "estimate", "heuristic", "measured" ], "description": "bit-exact: the same bits on every machine; exact: no approximation beyond double-precision rounding; single: single-precision arithmetic; bounded: a rigorous bound beside each value; estimate: a statistical estimate with its standard error; heuristic: an approximation with an estimate of its error, not a bound; measured: counts a device returned, not reproducible by recomputation." }, "note": { "type": "string" }, "fusion": { "type": "integer" }, "device": { "type": "string" }, "threshold": { "type": "number" }, "max_weight": { "type": [ "integer", "null" ] }, "max_bond": { "type": "integer" }, "max_bond_used": { "type": "integer" }, "discarded_weight": { "type": "number" }, "fidelity_estimate": { "type": "number" }, "truncations": { "type": "integer" }, "shots": { "type": "integer" }, "trajectories": { "type": "integer" }, "histories": { "type": "integer" }, "gate_applications": { "type": "integer" }, "max_cut": { "type": "integer" }, "order_work": { "type": "number" }, "batch": { "type": "integer" } } }, "state_hash": { "type": "string", "description": "The bit-exact method's statevector hash (BLAKE3, hex): the same on every machine." }, "counts": { "type": "object", "description": "Outcomes and their counts, keyed by the program's classical bits, the highest bit first. At most 65536 outcomes are listed; omitted_shots holds the rest.", "additionalProperties": { "type": "integer", "minimum": 0 } }, "distinct_outcomes": { "type": "integer", "minimum": 0 }, "omitted_shots": { "type": "integer", "minimum": 0 }, "outcome_dimension": { "type": "integer", "minimum": 0, "description": "The stabilizer method: the dimension of the measured outcomes' affine space." }, "shots": { "type": "integer", "minimum": 0, "description": "The shots, where the method names them in the result (trajectories, provider)." }, "expectations": { "type": "array", "items": { "type": "object", "required": [ "observable", "coeff", "value" ], "properties": { "observable": { "type": "string" }, "coeff": { "type": "number" }, "value": { "type": "number", "description": "The coefficient times the expectation value." }, "stderr": { "type": "number", "description": "The standard error, for an estimate." }, "bound": { "type": "number", "description": "A rigorous bound on |exact − value|, for the bounded class." }, "peak_terms": { "type": "integer" }, "threshold_reached": { "type": "number" }, "max_terms": { "type": "integer" }, "ladder": { "type": "array", "description": "The value at thresholds a decade apart, the asked one last.", "items": { "type": "object", "required": [ "threshold", "value", "bound" ], "properties": { "threshold": { "type": "number" }, "value": { "type": "number" }, "bound": { "type": "number" }, "peak_terms": { "type": "integer" }, "threshold_reached": { "type": "number" } } } } } } }, "amplitudes": { "type": "array", "items": { "type": "object", "required": [ "bits", "re", "im" ], "properties": { "bits": { "type": "string", "description": "One 0 or 1 per qubit, qubit n-1 first." }, "re": { "type": "number" }, "im": { "type": "number" } } } }, "global_phase": { "type": "string", "description": "Why the amplitudes' global phase is not fixed, when it is not." }, "warning": { "type": "string" }, "contraction_flops": { "type": "number", "description": "The tensor network's contraction cost." }, "dynamic": { "type": "object", "description": "A program that measures in the middle, resets or branches on a measured bit: how it ran.", "properties": { "measurements_and_resets": { "type": "integer", "minimum": 0 }, "branches_run": { "type": "integer", "minimum": 0 }, "states_at_once": { "type": "integer", "minimum": 0 }, "branches_weighed": { "type": "integer", "minimum": 0 } } }, "outputs": { "type": "array", "description": "The program's output declarations: each its name and type, and its value, or the places of its bits in each outcome.", "items": { "type": "object", "required": [ "name", "type" ], "properties": { "name": { "type": "string" }, "type": { "type": "string" }, "bits": { "type": "array", "items": { "type": "integer", "minimum": 0 } }, "value": { "description": "A number, a boolean, a bit string, a duration's text, {\"re\", \"im\"}, or an array of them." } } } }, "timing": { "type": "object", "description": "A program that states durations (delay, box, stretch) the method does not apply: said so, with the reader's code.", "required": [ "applied", "why" ], "properties": { "applied": { "type": "boolean" }, "code": { "type": "string" }, "why": { "type": "string" } } }, "diagnostics": { "type": "array", "description": "The reader's warnings and notes on the program, each with its code.", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "compiled": { "description": "How the program was compiled before it ran: on the person's own provider, to the device's gates; or, asked with compile, to a basis within a budget. Either way, basis is the gate set it was compiled to.", "anyOf": [ { "type": "object", "description": "A provider job: the program sent, compiled exactly to the device's own gates: its basis (the device's gate set), the BLAKE3 of its OpenQASM 3 text, its counts of gates and swaps, its layouts, and the check it passed before it was sent.", "required": [ "basis", "program" ], "properties": { "basis": { "type": "string" }, "program": { "type": "string" }, "hash": { "type": "string" }, "native_gates": { "type": "integer" }, "two_qubit_gates": { "type": "integer" }, "swaps": { "type": "integer" }, "layout": { "type": "array", "items": { "type": "integer" } }, "final_layout": { "type": "array", "items": { "type": "integer" } }, "checked": { "type": "string" }, "placement": { "type": "object", "description": "Where the program was placed on the device's qubits, and why." } } }, { "type": "object", "description": "A job asked to compile its program first: what ran is the compiled circuit, within distance of the program in the operator norm up to a global phase.", "required": [ "basis", "verdict" ], "properties": { "basis": { "enum": [ "clifford_t", "standard" ], "description": "The gate set the program was compiled to." }, "level": { "type": "integer", "minimum": 0 }, "epsilon": { "type": "number", "description": "The budget asked for." }, "distance": { "type": [ "number", "null" ], "description": "The bound the passes' distances add to." }, "verdict": { "type": "string" }, "source": { "type": "object", "description": "A circuit's counts, as the compiler counts them.", "properties": { "gates": { "type": "integer", "minimum": 0 }, "one_qubit": { "type": "integer", "minimum": 0 }, "two_qubit": { "type": "integer", "minimum": 0 }, "three_qubit": { "type": "integer", "minimum": 0 }, "cnots": { "type": "integer", "minimum": 0 }, "t_count": { "type": "integer", "minimum": 0 }, "rotations": { "type": "integer", "minimum": 0 }, "depth": { "type": "integer", "minimum": 0 } } }, "output": { "type": "object", "description": "A circuit's counts, as the compiler counts them.", "properties": { "gates": { "type": "integer", "minimum": 0 }, "one_qubit": { "type": "integer", "minimum": 0 }, "two_qubit": { "type": "integer", "minimum": 0 }, "three_qubit": { "type": "integer", "minimum": 0 }, "cnots": { "type": "integer", "minimum": 0 }, "t_count": { "type": "integer", "minimum": 0 }, "rotations": { "type": "integer", "minimum": 0 }, "depth": { "type": "integer", "minimum": 0 } } }, "certificate": { "type": [ "string", "null" ], "description": "The BLAKE3 of the compile certificate's RFC 8785 text, in hex." }, "note": { "type": "string" } } } ] }, "verdict": { "title": "wai.quantum.verdict/1", "description": "How far the engine checked an answer about a program, as one level of an ordered ladder (wai-quantum://docs/verdicts): refused, parsed, executed, evidence, proof. A level says how far the engine checked, not that the answer is good: holds says whether the intents held (true, false, or null when none was decided). A job's result carries one under verdict when the job gives an intent or asks for one, and the receipt seals it; both MCP servers state one beside every answer about a program.", "type": "object", "required": [ "schema", "level", "rank", "holds", "statement", "parsed", "executed", "intent", "critique", "repairs" ], "properties": { "schema": { "const": "wai.quantum.verdict/1" }, "level": { "enum": [ "refused", "parsed", "executed", "evidence", "proof" ] }, "rank": { "type": "integer", "minimum": 0, "maximum": 4, "description": "The level's place on the ladder, from 0 (refused) to 4 (proof)." }, "holds": { "type": [ "boolean", "null" ] }, "statement": { "type": "string", "description": "The level in one plain line." }, "parsed": { "type": "object", "description": "Whether the reader took the program, and its warnings and notes with their codes, or its refusal.", "required": [ "ok" ], "properties": { "ok": { "type": "boolean" }, "diagnostics": { "type": "array", "items": { "type": "object", "description": "One of the reader's diagnostics: its code, what happens to the construct it is about, its message (without the line or the code), and where it stands.", "required": [ "code", "outcome", "message" ], "properties": { "code": { "type": "string" }, "outcome": { "enum": [ "refused", "lowered", "carried", "preserved", "warned" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 } } } }, "code": { "type": "string" }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "message": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 }, "length": { "type": "integer", "minimum": 0 }, "text": { "type": "string", "description": "The refusal as the reader wrote it, with its line and code." } } }, "executed": { "type": [ "object", "null" ], "description": "The method that ran and its accuracy class, and the distance a compile put between the program and what ran.", "properties": { "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "compiled_distance": { "type": [ "number", "null" ] } } }, "intent": { "type": "array", "items": { "type": "object", "description": "One intent's check: what it asked, whether it held, how strong the check was and how it was made.", "required": [ "kind", "outcome", "strength", "how" ], "properties": { "kind": { "enum": [ "distribution", "equivalent", "prepares", "sampled", "compiled" ] }, "outcome": { "enum": [ "holds", "fails", "unchecked" ] }, "strength": { "enum": [ "proof", "evidence", "none" ] }, "how": { "type": "string" }, "why": { "type": "string" }, "distance": { "type": "number" }, "tolerance": { "type": "number" }, "outcomes": { "type": "integer", "description": "The outcomes the distribution holds, or the samples' distinct outcomes." }, "distribution": { "type": "object", "additionalProperties": { "type": "number" }, "description": "The program's distribution, when its outcomes are few enough to list." }, "largest_gaps": { "type": "array", "items": { "type": "object", "properties": { "outcome": { "type": "string" }, "program": { "type": "number" }, "intent": { "type": "number" } } } }, "global_phase": { "type": [ "number", "null" ] }, "method": { "type": "string", "description": "A sampled intent: the method the samples were run by." }, "seed": { "type": "integer" }, "shots": { "type": "integer" }, "alpha": { "type": "number" }, "fit": { "type": "object", "description": "A sampled intent: the test, its statistic, degrees of freedom and p-value, the level, and whether it rejected.", "properties": { "test": { "type": "string" }, "statistic": { "type": "number" }, "dof": { "type": "integer" }, "p_value": { "type": "number" }, "alpha": { "type": "number" }, "shots": { "type": "integer" }, "rejected": { "type": "boolean" }, "smallest_expected": { "type": [ "number", "null" ] }, "impossible": { "type": [ "integer", "array", "boolean" ] }, "note": { "type": "string" } } }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "note": { "type": "string" } } } }, "critique": { "type": "array", "description": "The program's smells, each with its lines.", "items": { "type": "object" } }, "repairs": { "type": "array", "description": "Each edit a repair made, with the code it answered and the lines it changed.", "items": { "type": "object" } }, "refusal": { "type": "object", "description": "For a refused job: its message and its codes.", "properties": { "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } }, "sealed": { "type": "boolean" } } }, "target": { "type": "object", "description": "A run on a device target: which target (its hash, as its receipt binds it), its calibration snapshot, where the program was placed and why, and the noise derived from the target.", "required": [ "name", "hash" ], "properties": { "name": { "type": "string" }, "hash": { "type": "string" }, "hash_is": { "type": "string" }, "calibration": { "type": "object", "properties": { "id": { "type": "string" }, "timestamp": { "type": "string" } } }, "source": { "type": "object", "properties": { "format": { "type": "string" }, "note": { "type": "string" } } }, "placement": { "type": "object", "description": "The native gate set, the layout and routes chosen, the swaps, the expected success beside the fewest-swaps layout's, and the check of the compiled program." }, "noise": { "type": "object", "description": "The noise model derived from the target's calibration: its channels, durations and idling, and each qubit's readout." } } }, "repaired": { "type": "object", "description": "A job asked to repair its program first: the program that ran, each repair, and what needs a person.", "properties": { "qasm": { "type": "string" }, "repairs": { "type": "array", "items": { "type": "object", "required": [ "code", "by", "edits" ], "properties": { "code": { "type": "string" }, "rule": { "type": "string" }, "by": { "enum": [ "engine", "proposal" ] }, "flagged": { "type": "array", "items": { "type": "integer" } }, "edits": { "type": "array", "items": { "type": "object", "properties": { "line": { "type": "integer" }, "before": { "type": [ "string", "null" ] }, "after": { "type": [ "string", "null" ] } } } } } } }, "needs_person": { "type": "array", "items": { "type": "object" } } } }, "elapsed_ms": { "type": "integer", "minimum": 0, "description": "Wall time of the run, where the host has a clock (not in a browser tab)." }, "energy": { "description": "The CPU energy of the job's process as the kernel counts it, with its uncertainty and what it leaves out, or unmetered with the reason.", "anyOf": [ { "type": "object", "required": [ "unmetered" ], "properties": { "unmetered": { "type": "string" }, "service_kwh": { "type": "number", "description": "A provider job: the provider's own figure." }, "service_kwh_is": { "type": "string" } } }, { "type": "object", "required": [ "joules_micro", "energy_provenance", "coverage" ], "properties": { "joules_micro": { "type": "integer", "minimum": 1 }, "energy_provenance": { "type": "string" }, "energy_uncertainty": { "type": "object", "properties": { "relative_ppm": { "type": "integer" }, "window_us": { "type": "integer" } } }, "energy_counter_filtering": { "type": "string" }, "coverage": { "enum": [ "whole", "partial" ] }, "covers": { "type": "string" }, "excludes": { "type": "array", "items": { "type": "string" } }, "cpu_ms": { "type": "integer" }, "source": { "type": "string" }, "attribution": { "enum": [ "process", "none" ], "description": "Whose energy it is: the job's worker process, or none (the processor packages' over the job's window, every process on the host in it)." }, "packages": { "type": "integer", "minimum": 1, "description": "The processor packages read." }, "concurrent_jobs": { "type": "integer", "minimum": 0, "description": "Other jobs that ran on the host during the window." }, "counter": { "type": "object", "description": "The package counter as seen: the longest it went between updates, and the smallest step it took.", "properties": { "update_us": { "type": "integer", "minimum": 0 }, "step_uj": { "type": "integer", "minimum": 0 } } }, "declared": { "type": "string", "description": "What the stated uncertainty covers, and what it does not." } } } ] }, "receipt": { "anyOf": [ { "title": "wai.quantum.receipt/2", "description": "A result's receipt: an Ed25519 signature, by the key it names, over digest = BLAKE3(\"wai:quantum-service-receipt\\x02\" ‖ len ‖ request ‖ len ‖ result), each of request and result in its RFC 8785 canonical text (the result without its receipt member), each length 8 bytes big-endian. Whatever members the request and the result hold are sealed, the result's engine and schema among them. The first receipts (no canon member, $defs/first) signed serde_json's own text under the domain ending \\x01; they still verify.", "type": "object", "required": [ "alg", "canon", "key", "digest", "signature" ], "properties": { "alg": { "const": "ed25519" }, "canon": { "const": "rfc8785", "description": "The canonical form the digest is taken over." }, "key": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The signing key, 32 bytes in hex." }, "digest": { "type": "string", "minLength": 64, "maxLength": 64, "description": "The digest signed, 32 bytes in hex." }, "signature": { "type": "string", "minLength": 128, "maxLength": 128, "description": "The signature, 64 bytes in hex." } } }, { "description": "The first form, before canon: the digest is over serde_json's own text of each, under the domain ending \\x01. Never written now; still verified.", "type": "object", "required": [ "alg", "key", "digest", "signature" ], "properties": { "alg": { "const": "ed25519" }, "key": { "type": "string", "minLength": 64, "maxLength": 64 }, "digest": { "type": "string", "minLength": 64, "maxLength": 64 }, "signature": { "type": "string", "minLength": 128, "maxLength": 128 } } } ] }, "provider": { "type": "object", "description": "A provider job: the provider's name, kind and protocol, the device, its provenance, and the hash of its description." }, "calibration": { "type": [ "string", "null" ], "description": "A provider job: the calibration snapshot it ran under." }, "job": { "type": "object", "description": "A provider job: the provider's job id and its status checks." }, "ideal": { "description": "A provider job: the circuit's exact distribution set beside the measured counts.", "anyOf": [ { "type": "object", "required": [ "computed", "total_variation_distance", "hellinger_fidelity" ], "properties": { "computed": { "const": true }, "method": { "type": "string" }, "total_variation_distance": { "type": "number" }, "hellinger_fidelity": { "type": "number" }, "sampling_tvd_expected": { "type": "number" }, "ideal_outcomes": { "type": "integer" }, "note": { "type": "string" } } }, { "type": "object", "required": [ "computed", "why" ], "properties": { "computed": { "const": false }, "why": { "type": "string" } } } ] }, "cost": { "type": "object", "description": "A provider job: the estimate shown before it was sent, what the provider says it charged, and whether the person confirmed a run that was not free." }, "provenance": { "title": "wai.quantum.provenance/1", "description": "What a result came from, under the five categories cross-platform provenance surveys use: the circuit, the computer, the compilation, the execution and the software. A host adds it to the results it seals (the job service does, and each item of a set); a result without it reads as it always did. wai-quantum-service/docs/provenance.md maps every field to where it is and whether the receipt seals it.", "type": "object", "required": [ "schema", "circuit", "computer", "compilation", "execution", "software" ], "properties": { "schema": { "const": "wai.quantum.provenance/1" }, "circuit": { "type": "object", "description": "The program: the BLAKE3 digest of its text as given, its qubits and its gates.", "required": [ "program" ], "properties": { "program": { "type": "string", "description": "BLAKE3 of the program's text, in hex." }, "qubits": { "type": "integer", "minimum": 0 }, "gates": { "type": [ "integer", "null" ] } } }, "computer": { "type": "object", "description": "What ran it: a classical simulator, the method and its accuracy class, and a device target's hash when the job named one.", "required": [ "kind", "method" ], "properties": { "kind": { "const": "simulator" }, "method": { "type": "string" }, "accuracy": { "type": [ "string", "null" ] }, "target": { "type": "string", "description": "The device target's hash; its layout, routes and noise are in the result's own target." } } }, "compilation": { "type": "object", "description": "Whether the job asked to be compiled; if it did, each pass in order with its check's verdict, the certificate's digest, the gate set compiled to (its basis), the level, the ε budget and the distance the result carries, and that no pass draws a random number.", "required": [ "asked" ], "properties": { "asked": { "type": "boolean" }, "passes": { "type": [ "array", "null" ], "items": { "type": "object", "properties": { "pass": { "type": "string" }, "verdict": { "type": [ "string", "null" ] } } } }, "certificate": { "type": [ "string", "null" ] }, "basis": { "type": [ "string", "null" ], "description": "The gate set compiled to: clifford_t or standard." }, "level": { "type": [ "integer", "null" ] }, "epsilon": { "type": [ "number", "null" ] }, "distance": { "type": [ "number", "null" ] }, "seeded": { "const": false }, "device": { "type": "string", "description": "A job on a device target, compiled exactly to its gates: where its layout and routes are." }, "status": { "const": "not-applicable" }, "why": { "type": "string" } } }, "execution": { "type": "object", "description": "The shots, the seed and the plan the job ran under; its identifier and times are the host's, outside the result.", "required": [ "plan" ], "properties": { "shots": { "type": [ "integer", "null" ] }, "seed": { "type": [ "integer", "null" ] }, "plan": { "type": "object", "properties": { "method": { "type": "string" }, "why": { "type": "string" }, "memory_bytes": { "type": "integer", "minimum": 0 }, "work": { "type": "integer", "minimum": 0 } } } } }, "software": { "type": "object", "description": "The engine's name and version, and the host's.", "required": [ "engine", "host" ], "properties": { "engine": { "type": "string" }, "host": { "type": "string" } } } } }, "mitigation": { "title": "wai.quantum.mitigation/1", "description": "A job's mitigation (its request's mitigate, engine::mitigate), in its result: the method and the options it ran with, its bias and variance assumptions, each observable raw and mitigated with a standard error each and the ideal value (or, for readout, the counts inverted as a quasi-distribution), the method's own details and what it spent. docs/qec.md describes each method.", "type": "object", "required": [ "method", "options", "assumptions" ], "properties": { "method": { "enum": [ "zne", "pea", "pec", "cdr", "vd", "readout" ] }, "options": { "type": "object", "description": "The options it ran with, the defaults filled in.", "properties": { "method": { "type": "string" }, "shots": { "type": "integer" }, "seed": { "type": "integer" }, "factors": { "type": "array", "items": { "type": "number" } }, "extrapolation": { "enum": [ "richardson", "linear", "exponential" ] }, "samples": { "type": "integer" }, "training": { "type": "integer" }, "keep": { "type": "integer" }, "learn_shots": { "type": "integer" } } }, "assumptions": { "type": "object", "properties": { "bias": { "type": "string" }, "variance": { "type": "string" } } }, "noise": { "type": "string", "description": "How the job's noise model is read for the method." }, "note": { "type": "string" }, "observables": { "type": "array", "items": { "type": "object", "description": "One observable: its raw value and the mitigated one, each with its standard error, and the ideal value a simulation knows.", "properties": { "observable": { "type": "string" }, "coeff": { "type": "number" }, "raw": { "type": "number" }, "raw_stderr": { "type": "number" }, "mitigated": { "type": "number" }, "stderr": { "type": "number" }, "ideal": { "type": "number" } } } }, "distribution": { "type": "array", "description": "readout: each outcome's raw share and its mitigated quasi-probability, with its standard error.", "items": { "type": "object", "properties": { "bits": { "type": "string" }, "raw": { "type": "number" }, "mitigated": { "type": "number" }, "stderr": { "type": "number" } } } }, "details": { "type": "object", "description": "The method's own: the folded scales and the folding check (zne), the learned model and the amplified values (pea), the quasi-probability and the value it converges to (pec), the training fits (cdr), the purity (vd), the flip and its amplification (readout).", "additionalProperties": true }, "cost": { "type": "object", "description": "The circuits and shots it spent beyond the job's own.", "properties": { "circuits": { "type": "integer", "minimum": 0 }, "shots": { "type": "integer", "minimum": 0 }, "note": { "type": "string" } } } } } } }, "error": { "type": "string" }, "code": { "type": "string", "description": "A failed item's refusal code (engine::refusal)." }, "path": { "type": "array", "items": { "type": "string" }, "description": "The item's leaf's sibling digests up to the root, in hex." } } } } } } ] }, "error": { "type": "string", "description": "Why a job failed." }, "submitted_ms": { "type": "integer", "description": "The job service: when it was submitted, in milliseconds since 1970." }, "started_ms": { "type": "integer" }, "finished_ms": { "type": "integer" }, "peak_rss_bytes": { "type": "integer", "description": "The job service: the most memory the job's process held." }, "digests": { "type": "object", "description": "The job service: the BLAKE3 digests its store keeps the job's objects under (the request, each program, the result and the receipt).", "properties": { "algorithm": { "const": "blake3" }, "request": { "type": [ "string", "null" ] }, "programs": { "type": "array", "items": { "type": "string" } }, "result": { "type": "string" }, "receipt": { "type": "string" } } } } }, { "type": "object", "description": "A refusal as data: the message, every code in it (the last is the code), its outcome and meaning as the code's table gives them. A host that refuses for its own reasons gives the error alone.", "required": [ "error" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "code": { "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "string" } }, "outcome": { "enum": [ "refused", "retry", "failed", "lowered", "carried", "preserved", "warned", "dropped", "defaulted" ] }, "meaning": { "type": "string" } } } ] } } ] }