Randomized Benchmarking
Randomized benchmarking estimates an average gate error rate from how quickly random gate sequences decay, in a way that is robust to state-preparation and measurement errors.
The Problem It Solves
Measuring gate error is tricky because the measurement itself has errors. If you run one gate and measure, you cannot tell whether an error came from the gate, from imperfect state preparation, or from readout. Randomized benchmarking separates gate error from these by looking at how error accumulates over sequences of increasing length rather than at any single operation.
The Protocol
Random sequences of Clifford gates are applied to a qubit, each sequence followed by a final gate that, in the ideal case, inverts the whole sequence and returns the qubit to its initial state. The probability of recovering the initial state is measured as a function of sequence length. For longer sequences more error accumulates, so this survival probability decays. Fitting the decay to an exponential gives a decay parameter, and the average error per Clifford is derived from it.
import numpy as np
# Fit survival probability p(m) = A * r**m + B to extract error per gate
m = np.array([1,2,4,8,16,32,64,128]) # sequence lengths
p = np.array([0.98,0.96,0.93,0.87,0.78,0.63,0.44,0.24])
# linearize around the offset B (illustrative simple fit)
from numpy.polynomial import polynomial as P
# r is the decay base; average error per Clifford:
# eps = (1 - r) * (d - 1) / d, with d = 2 for one qubit
r = 0.985 # obtained from a proper nonlinear fit
eps = (1 - r) * (2 - 1) / 2
print(eps)
Why the Averaging Helps
- Random Clifford sequences twirl arbitrary errors into a depolarizing channel, giving a single meaningful number.
- State-preparation and measurement errors affect only the fit constants A and B, not the decay rate r.
- The result is an average gate fidelity, robust and reproducible across labs.
Variants
Interleaved randomized benchmarking inserts a specific gate of interest into every sequence to isolate that gate's error. Simultaneous randomized benchmarking runs the protocol on several qubits at once to expose crosstalk. Purity benchmarking separates coherent from incoherent error. Together these make randomized benchmarking the standard first-line metric for gate quality, though it reports only an average and can miss some coherent error, which gate-set tomography addresses in more detail.