Skip to content

Randomized Benchmarking Simulation

Randomized-benchmarking simulation tests a protocol and its inference under a chosen gate-noise model. It should generate random sequences, construct the ideal recovery, apply physical noise to every implemented operation, and fit the resulting survival data. The decay parameter has an average-error interpretation only under stated assumptions.

Helpful background. Randomized benchmarking explains the protocol; noise models specify channel placement.

For independently and uniformly sampled Clifford gates C1,…,CmC_1,\ldots,C_m, the ideal product is Cm⋯C1C_m\cdots C_1. Append

Cinv=(Cm⋯C1)−1.C_{\rm inv}=(C_m\cdots C_1)^{-1}.

Track multiplication order carefully. Apply the same compilation and noise assumptions to the recovery gate as to other implemented gates; treating it as noiseless changes the model.

Uniform sampling from the Clifford group is not generally equivalent to applying a short random string of generators. If generator walks are used, demonstrate mixing or describe the resulting nonuniform protocol.

A zero-noise run must return the initial state for every sequence, up to global phase. This checks group multiplication, inversion, and qubit order before any decay is fitted.

For gate-independent Markovian noise, Clifford averaging gives a depolarizing decay model

F(m)=Apm+B.F(m)=A p^m+B.

Here A,BA,B absorb fixed preparation, measurement, and boundary-gate effects under the model. For a dd-dimensional depolarizing channel Dp(ρ)=pρ+(1−p)I/d\mathcal D_p(\rho)=p\rho+(1-p)I/d,

Favg=p+1−pd,r=1−Favg=d−1d(1−p).F_{\rm avg}=p+\frac{1-p}{d}, \qquad r=1-F_{\rm avg}=\frac{d-1}{d}(1-p).

This follows because the overlap with every pure input is the same. It relates the fitted pp to average infidelity in this model, not directly to a worst-case error probability.

For an ideal one-qubit preparation and measurement with a noisy recovery as well, survival is (1+pm+1)/2(1+p^{m+1})/2. Fitting as Apm+BAp^m+B gives A=p/2A=p/2, B=1/2B=1/2. This checks the treatment of the extra recovery gate.

For a general single-qubit gate-independent channel written in Bloch coordinates as r↦Mr+t\boldsymbol r\mapsto M\boldsymbol r+\boldsymbol t, uniform Clifford conjugation averages MM to pIpI, where p=Tr⁡M/3p=\operatorname{Tr}M/3, and averages the translation to zero. This supplies a deterministic check: enumerate all 24 Clifford rotations and compare their average with the depolarizing map before sampling sequences.

For amplitude damping of probability γ\gamma after each Clifford, M=diag⁡(1−γ,1−γ,1−γ)M=\operatorname{diag}(\sqrt{1-\gamma},\sqrt{1-\gamma},1-\gamma) and t=(0,0,γ)\boldsymbol t=(0,0,\gamma). With ∣0⟩|0\rangle preparation and measurement, including the same damping after recovery gives

p=21−γ+1−γ3,F(m)=1+γ+(1−γ)pm2.p=\frac{2\sqrt{1-\gamma}+1-\gamma}{3},\qquad F(m)=\frac{1+\gamma+(1-\gamma)p^m}{2}.

The twirled interior is unital, but the final physical noise is not. Consequently the asymptote is (1+γ)/2(1+\gamma)/2, not 1/21/2. Allowing A,BA,B to vary is essential even in this exactly gate-independent model.

At each length draw KK random sequences. For each sequence either compute its exact survival probability or generate NN Bernoulli shots. Between-sequence variability and within-sequence shot noise are distinct.

Let a randomly chosen sequence have exact survival psp_s, and let F^\widehat F be the mean of the KK measured sequence fractions. For independent identically distributed sequences, independent shots conditional on each sequence, equal NN, and stationary noise, the law of total variance gives

Var⁡(F^)=Var⁡s(ps)K+Es[ps(1−ps)]KN.\operatorname{Var}(\widehat F)= \frac{\operatorname{Var}_s(p_s)}{K} +\frac{\mathbb E_s[p_s(1-p_s)]}{KN}.

The first term remains as N→∞N\to\infty at fixed KK. Treating all KNKN shots as independent draws from their mean probability assigns variance pˉ(1−pˉ)/(KN)\bar p(1-\bar p)/(KN) and omits the covariance between shots sharing one sequence. It divides the between-sequence contribution by an extra factor NN. Conditional uncertainty for a fixed, deliberately reused sequence set is a different target from uncertainty over newly sampled sequences.

A nonparametric bootstrap over complete sequence records estimates the latter target, including their observed shot fluctuations. Do not automatically add a second naive shot bootstrap, which can double-count those fluctuations. A parametric or carefully calibrated hierarchical bootstrap can separately regenerate sequence probabilities and conditional counts when that extra model is specified. Correlated drift, shared sequence prefixes across lengths, and unequal shot allocation require their covariance structure to be retained in the fit and resampling procedure.

Choose lengths spanning visible decay rather than fitting only values near one or near the asymptote. Fit probabilities with a likelihood or suitable variance model and inspect parameter correlations. A visually plausible exponential can leave pp poorly identified.

Add coherent overrotation, gate dependence, temporal drift, leakage, or correlated noise one at a time. Inspect residuals and compare inferred error with a directly computed channel metric on the small simulated system. Nonexponential decay can be a physical model failure, not an optimizer failure.

Interleaved benchmarking inserts a target gate between random Cliffords and compares decays. The ratio of fitted parameters is an estimator under additional assumptions; it is not an exact identity for arbitrary gate-dependent noise. Keep its uncertainty and systematic limitations explicit.

Report what is averaged: Clifford operations, compiled primitive gates, or a particular gate family. Converting Clifford error to primitive-gate error by dividing by a mean gate count requires a noise-composition model.

A qubit depolarizing benchmark gives p=0.998p=0.998. What average infidelity does the ideal model assign, and what does it not establish?

Solution

r=(1−p)/2=10−3r=(1-p)/2=10^{-3}. It does not establish a worst-case error of 10−310^{-3}, the error of every primitive gate, or performance under correlated noise. Those conclusions require further assumptions or separate characterization.

  • Magesan, E., Gambetta, J. M., and Emerson, J., “Scalable and robust randomized benchmarking of quantum processes,” Physical Review Letters 106, 180504 (2011), doi:10.1103/PhysRevLett.106.180504.
  • Magesan, E., Gambetta, J. M., and Emerson, J., “Characterizing quantum gates via randomized benchmarking,” Physical Review A 85, 042311 (2012), arXiv:1109.6887.
  • Wallman, J. J., and Flammia, S. T., “Randomized benchmarking with confidence,” New Journal of Physics 16, 103032 (2014), arXiv:1404.6025.