|q⟩ Bad Qubits

advanced · Programming · Benchmarking, Noise Characterization & RB

Checkpoint: Estimate Gate Fidelity

This checkpoint ties the module together. You have an RB survival curve measured on a single-qubit device, and your job is the thing benchmarking exists to do: turn that raw data into a gate fidelity.

The data

A randomized benchmarking experiment on one qubit (d=2d = 2) reports the average survival probability of 0|0\rangle as a function of the Clifford sequence length mm. The decay follows the standard model

Fˉ(m)=Apm+B,\bar F(m) = A\,p^{\,m} + B,

where pp is the per-Clifford depolarizing parameter and B=1/d=0.5B = 1/d = 0.5 is the fully-depolarized floor for one qubit. You are handed two clean points on this curve:

Fˉ(1)=0.99,Fˉ(5)=0.95196.\bar F(1) = 0.99, \qquad \bar F(5) = 0.95196.

From the decay to pp

Subtract the floor BB from each point to expose the pure exponential ApmA p^m:

Fˉ(m2)BFˉ(m1)B=Apm2Apm1=pm2m1.\frac{\bar F(m_2) - B}{\bar F(m_1) - B} = \frac{A\,p^{\,m_2}}{A\,p^{\,m_1}} = p^{\,m_2 - m_1}.

The amplitude AA — which carries the SPAM errors — cancels, exactly the robustness RB promises. Solve for pp:

p=(Fˉ(m2)BFˉ(m1)B) ⁣1/(m2m1).p = \left(\frac{\bar F(m_2) - B}{\bar F(m_1) - B}\right)^{\!1/(m_2 - m_1)}.

From pp to the fidelity

The per-Clifford error rate for dimension dd is

r=(d1)(1p)d,r = \frac{(d-1)(1-p)}{d},

and the average gate fidelity per Clifford is its complement,

F=1r=1(d1)(1p)d.F = 1 - r = 1 - \frac{(d-1)(1-p)}{d}.

For one qubit, d=2d = 2, so r=(1p)/2r = (1-p)/2 and F=(1+p)/2F = (1+p)/2.

Try it

Given Fˉ(1)=0.99\bar F(1) = 0.99, Fˉ(5)=0.95196\bar F(5) = 0.95196, B=0.5B = 0.5, and d=2d = 2:

  1. Extract pp from the two survival points using the ratio formula.
  2. Convert pp to the average gate fidelity F=(1+p)/2F = (1+p)/2.
  3. Return FF.

The grader checks your returned fidelity against the value derived from the same formulas (it should come out essentially 0.990.99).

Run your code to see the quantum state.

Sign in on the full site to ask questions and join the discussion.