Randomized benchmarking is the real protocol hardware teams use to measure average gate fidelity without needing to know each gate's exact error. For a sequence length m, a random string of m single-qubit Clifford gates is drawn and applied, then the exact inverse of the whole sequence is computed and applied — with no noise, that always returns the qubit to its starting state, so any shortfall in survival probability is attributable to noise.
apply C1, C2, … Cm
compute Cinv = (Cm·…·C1)⁻¹ (exact matrix inverse)
apply Cinv, then measure
F(m) = A·r^m + B
The 24 single-qubit Clifford gates are represented exactly as the 24 proper rotations of a cube acting on the Bloch sphere (signed axis permutations with determinant +1) — composing and inverting them is plain 3×3 orthogonal-matrix algebra, so Cinv is the real matrix transpose of the accumulated product, not an approximation. Each physical gate shrinks the Bloch vector by a depolarizing factor (1 − p·(d−1)/d) with d = 2, so after m+1 real gates the survival probability of m random sequences, averaged over many noisy measurement shots, traces out a genuine exponential decay in m. This simulator fits that decay — via least-squares regression on ln(F(m) − 0.5) — to recover the decay parameter r and, from it, the average per-gate error p̂ = 2(1 − r), exactly as real RB experiments do on quantum hardware.
- Per-gate error rate p — the true depolarizing strength injected into every gate; the fit should recover a value close to this.
- Max sequence length — how far out in m the benchmark samples; longer sequences make the decay easier to see but take longer to decohere fully.
- Shots per data point — how many independent noisy measurements are averaged into each plotted dot; more shots means less binomial scatter around the true curve.