Production-grade guide to quantum supremacy benchmarks covering architecture patterns, implementation strategies, testing approaches, and operational best practices for enterprise engineering teams.
Quantum supremacy benchmarks assess whether a quantum processor can solve a target problem faster than the best-known classical algorithms. They are deployed when validating hardware roadmaps, comparing platforms, or establishing a baseline for quantum algorithm research.
Most supremacy benchmarks, such as Random Circuit Sampling (RCS), begin with a circuit of N qubits and D layers of random gates, followed by computational basis measurements. The following Python snippet uses a widely available SDK to produce a circuit in the brickwork pattern typical of RCS benchmarks:
import numpy as np
from qiskit import QuantumCircuit
def make_rcs_circuit(n_qubits, depth):
qc = QuantumCircuit(n_qubits)
for _ in range(depth):
for q in range(n_qubits):
qc.h(q)
for q in range(n_qubits - 1):
qc.cx(q, q + 1)
for q in range(n_qubits):
qc.measure(q, q)
return qc
circuit = make_rcs_circuit(5, 12)
The generated circuit object can be transpiled for a specific backend or sent directly to a simulator. The brickwork connectivity (nearest‑neighbor CNOTs on a line) is a common choice because it stresses routing and connectivity without requiring full all‑to‑all coupling.
After the circuit is built, it must be run on a quantum processor or ideal simulator. The execution pattern is framework‑agnostic: serialize the circuit, submit it as a sampling job, and collect the resulting bitstring distribution. The following example uses Qiskit’s Runtime API to run on a QASM simulator:
python - << 'PYEOF'
from qiskit import Aer
from qiskit.transpile import transpile
qc = make_rcs_circuit(5, 12)
compiled = transpile(qc, backend=Aer.get_backend('qasm_simulator'))
job = backend.run(compiled, shots=20000)
result = job.result()
counts = result.get_counts()
print("Empirical distribution:", dict(sorted(counts.items())))
PYEOF
The shots parameter determines the number of independent circuit executions. Each shot returns a measurement outcome (a bitstring); the aggregate forms the empirical probability distribution used in fidelity computation. If the job is submitted to a cloud backend instead of a local simulator, the same job.result() pattern applies, though network latency and queue position affect wall‑clock time.
The canonical metric for supremacy validation is Cross‑Entropy Benchmarking (XEB) fidelity. Given an empirical distribution counts obtained from N shots on n qubits, and the ideal probability P_ideal(x) for each outcome string x, XEB fidelity is defined as:
\[ F_{\text{XEB}} = \frac{2^n}{N} \sum_{x \in \text{outcomes}} \text{counts}(x) \cdot P_{\text{ideal}}(x) - 1 \]
The ideal probabilities are obtained by contracting the unitary matrix of the circuit or by running a high‑fidelity state‑vector simulation. A practical Python implementation that consumes the counts dictionary from the previous step:
import numpy as np
def compute_xeb(counts, n_qubits, shots, ideal_probs):
"""Compute XEB fidelity given empirical counts and ideal probability mapping."""
fidelity = 0.0
for bitstring, n_count in counts.items():
p_ideal = ideal_probs.get(bitstring, 0.0)
fidelity += n_count * p_ideal
fidelity = (2**n_qubits / shots) * fidelity - 1.0
return max(fidelity, 0.0) # clip to [0, 1]
# ideal_probs would be a dict {bitstring: float} produced by a separate
# state‑vector simulation or analytical contraction.
The computation itself is generic; any SDK that can emit measurement counts and provide a mapping of ideal probabilities can plug into this pattern. The formula penalizes samples that have low ideal probability, and a value near 1 indicates the quantum processor’s output distribution closely matches the ideal.
qc.qasm()) and verify gate count and layout after transpilation; a mismatch between intended and compiled circuit is a frequent source of unexpected fidelity drops.A production‑grade workflow scripts the full loop: circuit generation → transpilation → execution → fidelity computation → result archival. The following Bash + Python driver pulls a pinned quantum SDK Docker image to guarantee environment consistency across runs:
#!/usr/bin/env bash
set -euo pipefail
docker run --rm -v "$PWD":/work -w /work quantum-sdk:stable \
python - << 'PYEOF'
import sys, json
from qiskit import QuantumCircuit
from qiskit.transpile import transpile
n = int(sys.argv[1]) if len(sys.argv) > 1 else 5
d = int(sys.argv[2]) if len(sys.argv) > 2 else 12
# 1. Generate brickwork RCS circuit
qc = QuantumCircuit(n)
for _ in range(d):
for q in range(n):
qc.h(q)
for q in range(n - 1):
qc.cx(q, q + 1)
for q in range(n):
qc.measure(q, q)
# 2. Transpile and dump compiled circuit for audit
compiled = transpile(qc)
with open("circuit_compiled.qc.json", "w") as f:
f.write(compiled.qasm())
# 3. Execute on simulator and collect counts
from qiskit import execute
job = execute(compiled, shots=20000)
result = job.result()
counts = result.get_counts()
output = {
"qubits": n,
"depth": d,
"shots": 20000,
"counts": counts
}
print(json.dumps(output, indent=2))
PYEOF
The driver pins the SDK Docker image tag so that circuit generation, transpilation, and execution use the same binary behavior across months of repeated runs. The JSON output can be ingested by a monitoring pipeline or stored in an artifact repository for trend analysis.
This page was rewritten on 13 October 2026. It replaced a templated version that was not specific to its own title. How these pages are written and checked. If anything here is wrong, tell us at [email protected] and we will correct it.
We use cookies for analytics (Google Analytics) and advertising (Google AdSense) to improve your experience and support free content. Privacy Policy