|q⟩ Bad Qubits

advanced · Programming · Capstone Projects

Project: Error-Mitigated Estimation

Near-term devices are too noisy to trust a raw expectation value, yet too small to error-correct. Error mitigation bridges the gap: it does not fix the qubits, but it post-processes biased measurements into a better estimate of the noiseless observable. This capstone implements the most widely used technique — zero-noise extrapolation (ZNE) — end to end on an observable.

The idea: amplify, then extrapolate

A noisy device returns a biased expectation value E(λ)E(\lambda) that depends on the noise strength λ\lambda. We cannot reduce λ\lambda below the hardware floor, but we can increase it on purpose — by gate folding, replacing each gate GG with GGGG G^\dagger G (logically the identity insertion, physically more noise). Measuring at several scale factors λ,2λ,3λ,\lambda, 2\lambda, 3\lambda, \dots samples the curve E(λ)E(\lambda), and a fit extrapolated to λ0\lambda \to 0 estimates the ideal value:

Emitigated=lims0E(s).E_{\text{mitigated}} = \lim_{s \to 0} E(s).

Linear extrapolation

The simplest model assumes EE is approximately linear in the noise scale near the hardware floor:

E(s)=a+bs.E(s) = a + b\,s.

Two measurements pin down the line. With data (s1,e1)=(1,0.80)(s_1, e_1) = (1, 0.80) and (s2,e2)=(2,0.64)(s_2, e_2) = (2, 0.64),

b=e2e1s2s1=0.640.8021=0.16,a=e1bs1=0.80(0.16)(1)=0.96.b = \frac{e_2 - e_1}{s_2 - s_1} = \frac{0.64 - 0.80}{2 - 1} = -0.16, \qquad a = e_1 - b\,s_1 = 0.80 - (-0.16)(1) = 0.96.

The zero-noise estimate is the intercept E(0)=a=0.96E(0) = a = 0.96 — much closer to the ideal Z=1\langle Z\rangle = 1 than either raw point.

Try it

Implement zneLinear to fit the line through two scale points and return its zero-noise intercept. The grader checks you recover 0.960.96 from the scales 11 and 22.

Run your code to see the quantum state.

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