Result Schema¶
quantum-backend-bench writes JSON result bundles and flat CSV tables for research workflows.
For definitions of shots, counts, measurement distributions, success probability, and total variation distance, see THEORY.md.
Table of Contents¶
Neutral Translation Schemas¶
Translation workflows use four neutral JSON formats. Each format is versioned with
schema_version: "0.1". Importers remain tolerant of older local examples that omit the
field, but newly emitted neutral JSON includes it. Patch releases may clarify docs or add
optional fields; incompatible structural changes require a new schema version.
The published files declare JSON Schema Draft 2020-12 with stable $id values, and the
workflow schema references the shared Pauli schema rather than duplicating it.
CI checks each schema itself and validates every matching committed example through a
local schema registry, so relative cross-schema references are exercised without network access.
| Format | JSON Schema | Example | Purpose |
|---|---|---|---|
internal-circuit / internal-json |
internal-circuit.schema.json |
internal-circuit.example.json |
Static circuit operations, numeric/string parameters, measurement wires, register/key metadata, global phase, reset/barrier/delay annotations, and neutral local noise annotations. |
pauli-json |
pauli-json.schema.json |
pauli-json.example.json |
Weighted Pauli I, X, Y, and Z product terms. |
workflow-json |
workflow-json.schema.json |
workflow-json.example.json |
Parameterized circuits, bindings, local execution settings, and measurement requests. |
result-json |
result-json.schema.json |
result-json.example.json |
Portable counts, probabilities, expectations, and result metadata. |
Translation reports include schema_metadata with the neutral schema version and the
input/output schema identifiers when the selected CLI formats are neutral formats.
export --format internal-json and translate --to-format internal-json use the same
canonical serializer, so both commands emit exactly this schema surface.
internal-circuit¶
An internal circuit has n_qubits, ordered operations, and measurements. Operations
contain a gate, integer qubits, and optional params; numeric values cover angles/durations and string values cover small labels such as delay units. Optional metadata
fields preserve named quantum/classical register offsets, measurement keys, bit-order
labels, global phase, and neutral local noise-channel annotations. The v0.1 circuit gate
set is H, X, Y, Z, S, T, SX, P, RX, RY, RZ, U, CNOT,
CZ, SWAP, CCX, CRX, CRY, CRZ, CPHASE, plus preservable RESET,
BARRIER, and DELAY annotations.
pauli-json¶
A Pauli Hamiltonian has n_qubits and at least one weighted term. Each term contains a
numeric coefficient and a paulis object keyed by non-negative wire index strings.
Identity factors may be omitted.
workflow-json¶
A workflow adds symbolic parameters, numeric parameter_bindings, supported circuit
operations, measurement requests, shots, and an optional deterministic seed. Workflow
operations support the single-parameter subset of the circuit gate set plus Pauli
expectation requests; full three-parameter U belongs to internal-circuit.
Expectation requests embed a pauli-json observable payload.
result-json¶
A neutral result object contains counts, shots, normalized probabilities, optional
expectations, and free-form metadata. Runtime validation checks field types, non-negative
integer counts and shots, normalized finite probabilities, count totals equal to shots,
probabilities consistent with counts when both are present, and finite expectation values.
Expectation-only results may leave counts and probabilities empty.
Experiment Bundle¶
quantum-bench experiment run examples/manifests/runtime_scaling.json returns and optionally writes a JSON object:
{
"schema_version": "0.1",
"manifest_path": "examples/manifests/runtime_scaling.json",
"manifest": {},
"environment": {},
"results": []
}
Result Row¶
Each item in results has this structure:
benchmark: stable benchmark result name, such asghzorquantum_volumebackend: execution backend name, such ascirqn_qubits: logical qubit count for the benchmarkshots: shots per repeatrepeats: number of repeated executionstotal_shots:shots * repeatsparameters: benchmark parameters used to build the circuitmetrics: structural, runtime, and quality metricscounts: aggregate measurement counts across repeatsmetadata: analysis, environment, case labels, backend notes, and run context
Metrics¶
Common metric keys:
depth: structural circuit depth from pytket or the fallback estimatorgate_count: number of internal circuit operationstwo_qubit_gate_count: number of two-qubit internal operationsruntime_seconds: mean runtime across repeatsruntime_seconds_mean: same value asruntime_secondsruntime_seconds_stddev: sample standard deviation, or0.0for one repeatruntime_seconds_min: fastest repeatruntime_seconds_max: slowest repeatmeasurement_distribution: normalized aggregate distribution overtotal_shotssuccess_probability: target-state probability when the benchmark defines a targettotal_variation_distance: distance from the benchmark ideal distribution when defined
Metadata¶
Common metadata keys:
benchmark_family: broad category such asoracle,search, orsyntheticcase_label: stable human-readable label used in tables and plotsnoise_level: noise level when applicablenoise_requested: whether the benchmark requested a nonzero noise levelnoise_supported: whether the adapter reported support for the requested noise modenoise_applied: whether the adapter reported applying noiseoracle_type: oracle mode when applicableseed: random seed when applicableseed_supported: whether the adapter exposes seed control for this execution pathseed_applied: whether a requested seed was applieddepth: benchmark depth parameter when applicableruntime_includes_transpilation: whether adapter runtime includes compilation/transpilation workexternal_process: whether the backend depends on an external local processlocal_only: whether the integration is local-onlyshot_sampling: whether the backend reports shot-sampling behaviorexact_statevector: whether the backend is reported as exact-statevector orientedbackend_noise_support: capability-level noise support labelbackend_package_versions: package versions for backend-specific distributionsrepeats: repeated execution countshots_per_repeat: shots per repeattotal_shots: total aggregate shotsruntime_seconds_samples: raw runtime samplesenvironment: Python, platform, package, and git metadata captured at run time
Manifest¶
Experiment manifests are JSON by default. YAML is supported when PyYAML is installed.
{
"name": "runtime-scaling-local-simulators",
"backends": ["cirq"],
"shots": 256,
"repeats": 3,
"benchmarks": [
{"benchmark": "ghz", "n_qubits": 3},
{"benchmark": "random-circuit", "n_qubits": 4, "depth": 8, "seed": 42}
],
"outputs": {
"json": "artifacts/research/runtime_scaling.json",
"csv": "artifacts/research/runtime_scaling.csv",
"suite_plot": "artifacts/research/runtime_scaling.png"
}
}
Case-level backends, shots, and repeats override manifest-level values. A case may include noise_levels to expand one benchmark into a depolarizing noise sweep.
CSV¶
CSV output flattens the main fields for spreadsheet workflows. Nested parameters and counts are JSON-encoded strings.