Skip to content

Randomized benchmarking (RB) measures how reliably a processor returns to its starting state after random gates followed by their ideal inverse. Longer circuits magnify small errors. Averaging many circuits can produce a simple decay whose rate is less sensitive to fixed preparation and readout errors than a single-gate experiment.

For standard Clifford RB, the baseline model gives

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

where mm counts random Clifford gates, excluding the final inverse. The interpretation of pp depends on the noise model and the compiled gates. It is an error per sampled Clifford, not automatically an error per pulse or a prediction for an application.

Required background. Quantum channels describe noisy operations; stabilizer formalism explains Clifford gates and their inverses. Helpful background. Hardware metrics distinguishes average fidelity from worst-case error.

Draw G1,…,GmG_1,\ldots,G_m independently and uniformly from the Clifford group. Define

Cj=Gj⋯G1,Gm+1=Cm−1.C_j=G_j\cdots G_1, \qquad G_{m+1}=C_m^{-1}.

The rightmost gate acts first. The complete ideal product is the identity. Prepare a state ρ\rho, run the circuit, and measure a survival effect EE, such as the projector onto the initial state. Repeat both the shots for a circuit and the random circuit draws.

The experimental target is the mean over circuits,

F(m)=EGTr⁡[ES~G(ρ)].F(m)=\mathbb E_{\boldsymbol G} \operatorname{Tr}[E\widetilde{\mathcal S}_{\boldsymbol G}(\rho)].

A one-qubit Clifford group has 24 elements, up to global phase. A Clifford on several qubits generally requires many native operations. Its duration, decomposition, idles, and simultaneous activity determine what the experiment tests. An optimizer that cancels the entire ideal identity circuit would remove the intended test.

Assume the computational space has dimension dd, the noise is stationary and Markovian, and every Clifford, including the recovery, is implemented as

G~=Λ∘G,\widetilde{\mathcal G}=\Lambda\circ\mathcal G,

with the same completely positive, trace-preserving channel Λ\Lambda. Composition acts from right to left.

Moving into the cumulative Clifford frames gives the exact circuit channel

S~G=Λ∘ΛCm∘⋯∘ΛC1,\widetilde{\mathcal S}_{\boldsymbol G} =\Lambda\circ\Lambda_{C_m}\circ\cdots\circ\Lambda_{C_1},

where ΛC=C−1∘Λ∘C\Lambda_C=\mathcal C^{-1}\circ\Lambda\circ\mathcal C. The leading Λ\Lambda is the error after the final recovery.

Although adjacent cumulative products share gates, (C1,…,Cm)(C_1,\ldots,C_m) are independent uniform group elements. The change of variables is bijective: Gj=CjCj−1−1G_j=C_jC_{j-1}^{-1}, with C0=IC_0=I. Thus each interior factor averages independently to the group twirl

T(Λ)=1∣G∣∑C∈GC−1∘Λ∘C.\mathcal T(\Lambda) =\frac1{|\mathbb G|}\sum_{C\in\mathbb G} \mathcal C^{-1}\circ\Lambda\circ\mathcal C.

The Clifford group is a unitary 2-design. Its twirl removes preferred directions, including the displacement of a nonunital channel, and acts on density operators as

Dp(ρ)=pρ+(1−p)Id.\mathcal D_p(\rho)=p\rho+(1-p)\frac{I}{d}.

The identity component is fixed and every traceless component is multiplied by pp. Consequently,

F(m)=Tr⁡[E′Dpm(ρ)],E′=Λ†(E).\begin{aligned} F(m)&=\operatorname{Tr}[E'\mathcal D_p^m(\rho)],\\ E'&=\Lambda^\dagger(E). \end{aligned}

Here the adjoint moves the final recovery error into the measurement. Decomposing ρ\rho into its identity and traceless parts gives F(m)=Apm+BF(m)=Ap^m+B, with

A=Tr⁡[E′(ρ−I/d)],B=Tr⁡(E′I/d).\begin{aligned} A&=\operatorname{Tr}[E'(\rho-I/d)],\\ B&=\operatorname{Tr}(E'I/d). \end{aligned}

This is the standard gate-independent derivation (Magesan, Gambetta, and Emerson, 2012). Fixed preparation and measurement errors change A,BA,B; they do not change this interior pp. Poor contrast still makes pp difficult to estimate, and A=0A=0 leaves it unidentifiable.

The allowed completely positive depolarizing range is −1/(d2−1)≤p≤1-1/(d^2-1)\leq p\leq1. Experiments with small errors usually have pp close to one; a negative value would give alternating rather than monotonic traceless decay.

Converting the decay into an average error

Section titled “Converting the decay into an average error”

Twirling preserves average gate fidelity relative to the identity. For the depolarizing channel, every pure input has the same fidelity, giving

Favg=p+1−pd,rRB=d−1d(1−p).\begin{aligned} F_{\rm avg}&=p+\frac{1-p}{d},\\ r_{\rm RB}&=\frac{d-1}{d}(1-p). \end{aligned}

For a qubit, rRB=(1−p)/2r_{\rm RB}=(1-p)/2. This conversion is exact for the common channel in the baseline model.

For example, let every random gate and the recovery have depolarizing parameter p=0.998p=0.998, with ideal preparation and measurement. There are m+1m+1 noisy gates, so

F(m)=12pm+1+12.F(m)=\frac12p^{m+1}+\frac12.

Thus A=0.499A=0.499, B=0.5B=0.5, and rRB=0.001r_{\rm RB}=0.001. At m=100m=100, F≃0.9085F\simeq0.9085; at m=500m=500, F≃0.6834F\simeq0.6834. An ideal recovery would instead give A=1/2A=1/2. Absorbing the recovery into AA keeps the fitted rate unchanged, but the distinction matters when calculating the curve.

Two calculated survival curves have different contrasts and offsets but coincide after subtracting their asymptotes and dividing by their amplitudes.

Calculated curves with the same p=0.998p=0.998: (A,B)=(0.499,0.5)(A,B)=(0.499,0.5) and (0.42,0.47)(0.42,0.47). Both have normalized contrast (F−B)/A=pm(F-B)/A=p^m. The lower panel illustrates the model using known parameters; an experiment must estimate them with uncertainty.

A characteristic length is m∼1/(1−p)m\sim1/(1-p) when pp is near one. Include short lengths, lengths across the decay, and sufficiently long lengths to constrain the offset. All points near the initial plateau cannot determine three parameters reliably.

Random sequences and repeated shots have different roles

Section titled “Random sequences and repeated shots have different roles”

At a fixed length, circuit kk has survival probability qkq_k. Execute SS independent shots on each of KK independently sampled circuits. Write

σseq2=Var⁡(qk),v=E[qk(1−qk)].\begin{aligned} \sigma_{\rm seq}^2&=\operatorname{Var}(q_k),\\ v&=\mathbb E[q_k(1-q_k)]. \end{aligned}

The equal-weight mean of the observed circuit survival fractions obeys

Var⁡(F^)=σseq2K+vKS.\operatorname{Var}(\widehat F) =\frac{\sigma_{\rm seq}^2}{K}+\frac{v}{KS}.

The first term measures which circuits happened to be sampled; the second is conditional shot noise (Wallman and Flammia, 2014). Many repetitions of one circuit cannot replace independent circuit draws.

At a fixed total number of shots N=KSN=KS,

Var⁡(F^)=Sσseq2+vN.\operatorname{Var}(\widehat F) =\frac{S\sigma_{\rm seq}^2+v}{N}.

If new circuits have no extra cost, reducing SS cannot increase this variance. Large readout noise alone is not a reason to repeat fewer circuits. A practical reason is the overhead of generating, loading, or switching circuits. If that overhead is csc_s per circuit and a shot costs chc_h, an interior continuous optimum is

Sopt=vcsσseq2ch.S_{\rm opt}=\sqrt{\frac{v c_s}{\sigma_{\rm seq}^2 c_h}}.

Use at least one shot and account for integer counts and hardware limits. This is a design calculation under independent sampling, not a universal optimum for every RB experiment (Exercise 4).

For unequal shot counts, the equal-weight average of circuit fractions still targets the uniform circuit ensemble. Pooling all counts instead weights circuits by their shot counts; outcome-dependent allocation can then change the target.

Fit the original probabilities with an appropriate likelihood or weighted nonlinear regression. Taking log⁡(F^−B)\log(\widehat F-B) can fail when the noisy difference is nonpositive and changes the noise model. Do not fix B=1/dB=1/d unless the measurement model justifies it.

For uncertainty, resampling whole circuit records within a length captures the variation of their observed means, including shot noise. Blindly adding a second resampling of their shots can count shot noise twice. A hierarchical parametric bootstrap is another option when the latent circuit-probability model is specified. Preserve circuit identity, counts, and acquisition time; Harper and colleagues (2019) discuss RB experimental design and inference.

Interleaved RB inserts a target Clifford G⋆G_\star after every random reference Clifford and computes the inverse of the entire ideal product. Let the fitted rates be prefp_{\rm ref} and pintp_{\rm int}.

For independent depolarizing reference and target errors,

pint=prefp⋆,r⋆=d−1d(1−pintpref).\begin{aligned} p_{\rm int}&=p_{\rm ref}p_\star,\\ r_\star&=\frac{d-1}{d} \left(1-\frac{p_{\rm int}}{p_{\rm ref}}\right). \end{aligned}

For general errors this ratio is an estimate with systematic bounds, not a model-free fidelity identity (Magesan and colleagues, 2012). Reference and interleaved runs should be interwoven so drift is not confused with target error.

An exact coherent counterexample is instructive. Suppose every implementation is UθGU_\theta G, where Uθ=e−iθZ/2U_\theta=e^{-i\theta Z/2}, and interleave XX. Since XUθ=Uθ†XXU_\theta=U_\theta^\dagger X,

(UθX)(UθG)=XG.(U_\theta X)(U_\theta G)=XG.

The errors cancel within every interleaved pair. The remaining recovery error is a fixed edge contribution, so the interleaved curve has no interior decay: pint=1p_{\rm int}=1. Reference RB instead has

pref=1+2cos⁡θ3<1.p_{\rm ref}=\frac{1+2\cos\theta}{3}<1.

The ratio would assign a negative target infidelity, although the target’s actual average infidelity is (1−cos⁡θ)/3>0(1-\cos\theta)/3>0. Clipping that estimate to zero conceals the failure of the factorization assumption.

The noise mechanism. A coherent ZZ rotation and a stochastic ZZ error can have the same RB decay. For the rotation,

r=1−cos⁡θ3,D⋄=∣sin⁡(θ/2)∣,r=\frac{1-\cos\theta}{3}, \qquad D_\diamond=|\sin(\theta/2)|,

where D⋄D_\diamond is half the diamond norm distance. Small coherent errors have r∼θ2/6r\sim\theta^2/6 but D⋄∼∣θ∣/2D_\diamond\sim|\theta|/2. Hardware metrics develops these distinctions. Unitarity measurements add information about coherence, rather than converting one RB number into a universal guarantee (Wallman and colleagues, 2015).

Individual native-gate errors. If every Clifford contains exactly LL identical depolarizing native operations, then pC=pgLp_{\rm C}=p_g^L. Variable decompositions, different gates, idles, and coherent cancellations break that inference. Even a simplified random-length model averages pgLp_g^L, not pgELp_g^{\mathbb E L}.

A unique gate-by-gate fidelity. Gate dependence invalidates the elementary common-channel derivation. More general theory can justify a dominant exponential plus corrections under appropriate conditions (Wallman, 2018). Its relation to individually assigned gate errors depends on the gate-set representation (Proctor and colleagues, 2017). For example, implementing every Clifford as WGW†WGW^\dagger still makes every ideal identity sequence return exactly, although gates can differ from their nominal matrices.

Closure of the computational space. Leakage and return from leaked levels add population dynamics. Measure total computational population as well as target survival; an unusual asymptote alone is not decisive because SPAM also changes BB. A two-population leakage model is derived in Exercise 8 (Wood and Gambetta, 2018).

Stationarity or absence of memory. A mixture of rates can look nearly exponential over a short range. Randomize acquisition order, repeat reference lengths throughout the run, and inspect residuals and circuit distributions by time block. Length-dependent reset or readout can change the apparent rate. Noise with memory explains broader tests.

Question Useful additional measurement
Does parallel activity change the error? Compare isolated and simultaneous RB
Are errors coherent? Unitarity or phase-sensitive sequences
Is population leaving the qubit space? Leakage-resolving readout
How does a scheduled layer behave? Cycle benchmarking
What channel acts on selected inputs? Process tomography

These measurements address different questions. A precise RB fit is most useful when accompanied by its sampled gate set, compiler, timing context, and tested noise assumptions.

For qubit depolarizing noise with parameter pp after every gate, including the inverse, derive the survival from ∣0⟩|0\rangle. How do AA and BB change for an ideal inverse?

Solution

Depolarizing channels commute with unitary gates, and their parameters multiply. The ideal gates cancel, leaving Dpm+1\mathcal D_{p^{m+1}}. Thus F=(1+pm+1)/2F=(1+p^{m+1})/2, with A=p/2A=p/2 and B=1/2B=1/2. An ideal inverse removes one noise factor, so A=1/2A=1/2. The exponent fitted against the number of random gates is still controlled by the same pp.

A fit gives p=0.9920±0.0008p=0.9920\pm0.0008 as a one-standard-deviation statistical result. Convert to infidelity.

Solution

Here d=4d=4, hence

r=34(1−p)=0.0060,σr=34σp=0.0006.\begin{aligned} r&=\tfrac34(1-p)=0.0060,\\ \sigma_r&=\tfrac34\sigma_p=0.0006. \end{aligned}

The result is 0.0060±0.00060.0060\pm0.0006 under the RB model. This statistical uncertainty does not include model failure.

Take σseq2=0.0004\sigma_{\rm seq}^2=0.0004 and v=0.16v=0.16. Compare (K,S)=(40,100)(K,S)=(40,100) and (100,40)(100,40).

Solution

Both use 4,000 shots. Their variances are

V1=0.000440+0.164000=5.0×10−5,V2=0.0004100+0.164000=4.4×10−5.\begin{aligned} V_1&=\frac{0.0004}{40}+\frac{0.16}{4000} =5.0\times10^{-5},\\ V_2&=\frac{0.0004}{100}+\frac{0.16}{4000} =4.4\times10^{-5}. \end{aligned}

More circuits reduce the first term. With no switching overhead, one shot on each of 4,000 circuits gives variance (0.0004+0.16)/4000=4.01×10−5(0.0004+0.16)/4000=4.01\times10^{-5}. This compares total shots, not necessarily elapsed laboratory time.

For total time T=K(cs+Sch)T=K(c_s+Sc_h), derive SoptS_{\rm opt}. Use the preceding variances with cs=10c_s=10, ch=1c_h=1 in common time units.

Solution

Eliminating KK gives

TVar⁡(F^)=(σseq2+v/S)(cs+Sch).T\operatorname{Var}(\widehat F) =(\sigma_{\rm seq}^2+v/S)(c_s+Sc_h).

The terms depending on SS are σseq2chS+vcs/S\sigma_{\rm seq}^2c_hS+vc_s/S. Setting the derivative to zero gives the stated square root, about 63.2563.25 shots here. Compare feasible neighboring integers. If cs=0c_s=0, the optimum moves to the boundary S=1S=1 when σseq2>0\sigma_{\rm seq}^2>0.

Let pref=0.9980p_{\rm ref}=0.9980 and pint=0.9940p_{\rm int}=0.9940 for one qubit. Calculate the ratio estimate. Is the same formula justified by a clean exponential alone?

Solution p⋆=0.9940/0.9980≃0.995992,r⋆=(1−p⋆)/2≃0.002004.\begin{aligned} p_\star&=0.9940/0.9980\simeq0.995992,\\ r_\star&=(1-p_\star)/2\simeq0.002004. \end{aligned}

No. The coherent cancellation example gives exact exponential behavior but violates scalar error factorization. Statistical fit precision and systematic validity are separate.

Compare UθU_\theta with the channel (1−q)ρ+qZρZ(1-q)\rho+qZ\rho Z, taking q=sin⁡2(θ/2)q=\sin^2(\theta/2). Show that their RB parameters agree and compare their half-diamond distances.

Solution

The coherent Bloch matrix has trace 1+2cos⁡θ1+2\cos\theta. The stochastic Bloch matrix is diag⁡(1−2q,1−2q,1)\operatorname{diag}(1-2q,1-2q,1), with the same trace. Both twirl to

p=1+2cos⁡θ3.p=\frac{1+2\cos\theta}{3}.

The distances are ∣sin⁡(θ/2)∣|\sin(\theta/2)| for the rotation and q=sin⁡2(θ/2)q=\sin^2(\theta/2) for the stochastic channel. At θ=0.02\theta=0.02, the common infidelity is approximately 6.67×10−56.67\times10^{-5}, while the distances are approximately 0.010.01 and 0.00010.0001.

Every ideal Clifford GG is implemented perfectly as WGW†WGW^\dagger. What does an RB identity sequence do? For G=XG=X and W=e−iϕZ/2W=e^{-i\phi Z/2}, calculate its nominal average infidelity.

Solution

Adjacent W†WW^\dagger W factors cancel, so the whole circuit is WIW†=IWIW^\dagger=I. RB sees no decay. Relative to nominal XX, the error is a ZZ rotation through angle 2ϕ2\phi, up to sign, giving

rX=1−cos⁡(2ϕ)3.r_X=\frac{1-\cos(2\phi)}{3}.

A sequence-return experiment does not determine an absolute control frame. Relating its decay to nominal gate matrices needs a consistent choice of representation and complementary measurements.

In a population model, a computational state leaks with probability ℓ\ell per step, while a leaked state returns with probability ss. Starting inside the computational space, derive its population cmc_m.

Solution

The recurrence is

cm+1=(1−ℓ)cm+s(1−cm).c_{m+1}=(1-\ell)c_m+s(1-c_m).

For ℓ+s>0\ell+s>0,

cm=sℓ+s+ℓℓ+s(1−ℓ−s)m.c_m=\frac{s}{\ell+s} +\frac{\ell}{\ell+s}(1-\ell-s)^m.

For ℓ=0.02,s=0.01\ell=0.02,s=0.01, the limiting population is 1/31/3 and the decay parameter is 0.970.97. This is population exchange, not the qubit depolarizing parameter. Target-state survival also depends on how the remaining computational population is distributed.

Assume ideal recovery and independent random compilations using either one or three identical depolarizing native operations, equally likely for every Clifford. Find the effective parameter per Clifford and compare it with squaring pgp_g.

Solution

Each step averages independently, so

pC=12(pg+pg3).p_{\rm C}=\tfrac12(p_g+p_g^3).

The mean count is two, but

pC−pg2=12pg(1−pg)2.p_{\rm C}-p_g^2=\tfrac12p_g(1-p_g)^2.

Even this homogeneous model differs from using the mean exponent. The discrepancy is second order near pg=1p_g=1; real compilation-dependent errors need more information than a gate-count average.

  • Harper, R., I. Hincks, C. Ferrie, S. T. Flammia, and J. J. Wallman. “Statistical analysis of randomized benchmarking.” Physical Review A 99, 052350 (2019). arXiv:1901.00535.
  • Magesan, E., J. M. Gambetta, and J. Emerson. “Characterizing quantum gates via randomized benchmarking.” Physical Review A 85, 042311 (2012). arXiv:1109.6887.
  • Magesan, E., and colleagues. “Efficient measurement of quantum gate error by interleaved randomized benchmarking.” Physical Review Letters 109, 080505 (2012). arXiv:1203.4550.
  • Proctor, T., K. Rudinger, K. Young, M. Sarovar, and R. Blume-Kohout. “What randomized benchmarking actually measures.” Physical Review Letters 119, 130502 (2017). arXiv:1702.01853.
  • Wallman, J. J. “Randomized benchmarking with gate-dependent noise.” Quantum 2, 47 (2018). arXiv:1703.09835.
  • Wallman, J. J., and S. T. Flammia. “Randomized benchmarking with confidence.” New Journal of Physics 16, 103032 (2014). arXiv:1404.6025.
  • Wallman, J., C. Granade, R. Harper, and S. T. Flammia. “Estimating the coherence of noise.” New Journal of Physics 17, 113020 (2015). arXiv:1503.07865.
  • Wood, C. J., and J. M. Gambetta. “Quantification and characterization of leakage errors.” Physical Review A 97, 032306 (2018). arXiv:1704.03081.