open-standards/wai/wai-quantum/schemas/qec.v1.json
Transaction Science b9af554c7c wai-quantum contract over error correction and mitigation: their answers' schemas, distinct refusal codes, the basis in the new passes, and the smoke within one window
Error correction and mitigation join the version contract. An error-correction
answer (wai.quantum.qec/1: a code, a decode or a threshold), a code's distance
certificate (wai.quantum.distance/1) and a job's mitigation
(wai.quantum.mitigation/1) are engine schemas; every answer engine::qec::call
gives names the engine and its schema, inside what a host seals. The job
request names mitigate, and a compile's options and certificate twirl and dd.
qec_code, qec_decode and qec_threshold answer to output schemas on both
servers; the strict tests call each, a mitigated run and a compile with both
passes, the engine's test holds every decoder's answer and each mitigation
method to its schema, the contract workflow requires it by name, and
check_schemas.py holds the command line's answers too.

Refusal codes: the set branch and this one had each taken J007. A set that
does not read keeps J007; mitigation's refusals are J008 and error
correction's J009, in the table, its page, the tests, the docs and the
changelog.

The basis rename reaches the new passes: compile::Options carries twirl and
dd beside basis, and the command line's compile, both servers' compile
options and their tests name the gate set basis.

The service smoke test made 32 submissions with both branches' checks, past
the 30 a client may make in a window (it is also run against production after
a deploy). It now makes 28 (29 on a host with a GPU, whose single-precision
run is held to the exact values instead of a second run): the code-capacity
decode against its error, the changed estimate, the counts document and the
classical shortcuts are left to the MCP servers' tests, which hold each.

The agent docs are regenerated.

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

375 lines
9.3 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://git.transaction.science/Transaction-Science/open-standards/raw/branch/main/wai/wai-quantum/schemas/qec.v1.json",
"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": {
"$ref": "#/$defs/result"
}
},
"$defs": {
"result": {
"description": "A code, a decode or a threshold, with its receipt.",
"anyOf": [
{
"$ref": "#/$defs/code"
},
{
"$ref": "#/$defs/decode"
},
{
"$ref": "#/$defs/threshold"
}
]
},
"code": {
"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": {
"$ref": "distance.v1.json"
},
"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": {
"$ref": "receipt.v2.json"
}
}
},
"decode": {
"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": {
"$ref": "receipt.v2.json"
}
}
},
"threshold": {
"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": {
"$ref": "receipt.v2.json"
}
}
}
}
}