Case Study: Calibrating a Rotation Gate with a Rabi Sweep

Executive Summary

A qubit does not come with an $X$ gate. It comes with a microwave source, and someone has to determine how long to leave that source on to rotate the Bloch vector by exactly $\pi$. Get it wrong by 2% and every circuit on that qubit inherits a 2% error that compounds with depth.

This case study is the calibration routine that turns physics into a gate. You will sweep a pulse amplitude, fit the resulting oscillation, extract the $\pi$-pulse point, and then confront the fact that the naive fit is biased — and that a cleverer experiment, error amplification, beats it by an order of magnitude. Everything rests on Chapter 2's Bloch-sphere picture of rotation.

Skills applied

  • Relating a driven qubit's evolution to rotation on the Bloch sphere (§2.8).
  • Reading $P(1) = \sin^2(\theta/2)$ as the measurement signature of a rotation (§2.5, §2.8).
  • Fitting oscillation data and understanding what limits fit precision.
  • Designing an error-amplification sequence to beat shot noise.

Background

Physics in one paragraph

Drive a qubit on resonance and its Bloch vector rotates about an axis in the equatorial plane at the Rabi frequency $\Omega$, proportional to the drive amplitude. Starting from $|0\rangle$ (Bloch vector at $+z$), after a drive of duration $t$ the state is

$$|\psi(t)\rangle = \cos\!\left(\frac{\Omega t}{2}\right)|0\rangle - i\sin\!\left(\frac{\Omega t}{2}\right)|1\rangle$$

so the excited-state probability is

$$P(1) = \sin^2\!\left(\frac{\Omega t}{2}\right)$$

An $X$ gate is a $\pi$ rotation: the amplitude $A_\pi$ at which $\Omega t = \pi$, i.e. where $P(1)$ first reaches 1. Finding $A_\pi$ is the calibration.

The data

Fixed pulse duration, amplitude swept in arbitrary DAC units, 2,048 shots per point:

Amplitude $P(1)$ Amplitude $P(1)$
0.00 0.004 0.60 0.905
0.10 0.028 0.70 0.985
0.20 0.104 0.80 0.968
0.30 0.238 0.90 0.858
0.40 0.442 1.00 0.671
0.50 0.681 1.10 0.428

Phase 1: Confirm the model before fitting

Before fitting anything, check that the data looks like $\sin^2$. It should rise from ~0, peak near 1, and fall symmetrically. It does: rising through 0.442 at $A = 0.40$, peaking around $A \approx 0.70$–$0.75$, falling to 0.428 at $A = 1.10$.

The peak being $0.985$ rather than $1.000$ is expected — readout infidelity and decoherence during the pulse both cap the visibility. Model it explicitly rather than ignoring it:

$$P(1) = \frac{V}{2}\Big[1 - \cos\big(\pi A/A_\pi\big)\Big] + c$$

with visibility $V$, offset $c$, and the parameter we want, $A_\pi$.

Modelling note. Fitting $P(1) = \sin^2(\pi A / 2A_\pi)$ with visibility forced to 1 would push the fit to compensate for readout error by distorting $A_\pi$ — a systematic bias disguised as a good fit. Let the visibility float.

Phase 2: Fit and extract

A least-squares fit to the twelve points gives approximately

$$A_\pi \approx 0.715, \qquad V \approx 0.981, \qquad c \approx 0.006$$

The offset $c \approx 0.006$ is the probability of reading $1$ when the qubit is in $|0\rangle$ — a readout error, not a gate error. The visibility deficit of ~2% is a combination of readout error on the $|1\rangle$ side and $T_1$ decay during the pulse.

So: set the $X$-gate amplitude to $0.715$, and the $\sqrt{X}$ gate to $0.3575$.

Phase 3: Why this is not good enough

How precisely do we know $A_\pi$? Near the peak, $P(1)$ is flat — that is what a maximum means. Expanding around $A_\pi$:

$$P(1) \approx 1 - \frac{1}{4}\left(\frac{\pi \delta A}{A_\pi}\right)^2$$

A 1% amplitude error, $\delta A/A_\pi = 0.01$, changes $P(1)$ by only $\frac{1}{4}(0.0314)^2 \approx 2.5\times10^{-4}$.

Shot noise on 2,048 shots is $\sigma \approx \sqrt{p(1-p)/N}$, which near $p=1$ is small but the signal is quadratically small too. The result: a single $\pi$-pulse experiment simply cannot resolve sub-percent amplitude errors. The quantity you most want to measure sits exactly where the measurement is least sensitive.

Finding. Peak-fitting is the wrong experiment for precision calibration. It is fine for a first estimate and useless for a final one.

Phase 4: Error amplification

The fix is elegant and is used on real hardware daily. Instead of applying the pulse once, apply it $2n+1$ times. If each pulse over-rotates by $\epsilon$, the total error is $(2n+1)\epsilon$ — the error grows linearly while the signal stays first-order sensitive.

Concretely, apply the sequence $X^{2n+1}$ to $|0\rangle$. Ideally every odd number of $\pi$ pulses lands on $|1\rangle$. With a per-pulse over-rotation $\epsilon$:

$$P(1) = \cos^2\!\left(\frac{(2n+1)\epsilon}{2}\right)$$

Now the deviation from 1 grows as $(2n+1)^2\epsilon^2$. With $n = 20$ (41 pulses), a 1% error produces

$$1 - \cos^2(41 \times 0.0314/2) \approx 1 - \cos^2(0.644) \approx 0.36$$

A 36% signal instead of a 0.025% signal — a factor of ~1,400 in sensitivity, for the cost of a longer pulse train.

The tradeoff

You cannot amplify indefinitely. Decoherence sets the ceiling: with $T_1 = 100\,\mu s$ and 40 ns pulses, 41 pulses take 1.6 μs, costing ~1.6% amplitude to relaxation. Beyond a few hundred pulses the decay swamps the signal. The optimum is roughly where accumulated coherent error is comparable to accumulated decoherence — typically tens to low hundreds of repetitions.

Phase 5: The calibration routine

The routine that ships:

  1. Coarse Rabi sweep (this case study, Phase 1–2) → $A_\pi \approx 0.715$, good to ~2%.
  2. Fine amplitude calibration by error amplification with $n = 5, 10, 20$ → refine to ~0.05%.
  3. Repeat for the $\sqrt{X}$ gate independently — do not assume it is exactly half, because pulse-shape nonlinearities break that assumption.
  4. Drift monitoring. Superconducting qubits drift on hour timescales; re-run step 2 periodically. This is why cloud quantum backends publish a "last calibrated" timestamp, and why results taken hours apart may not agree.

Discussion Questions

  1. Why does an over-rotation error accumulate linearly under repetition, while a random error accumulates as $\sqrt{n}$? What does that difference let you do?
  2. Error amplification uses $2n+1$ (odd) repetitions. What would you learn from an even number, and why is that a useful complementary experiment?
  3. Suppose the fitted visibility came out at 0.62 instead of 0.98. Would you proceed to fine calibration? What would you investigate first?
  4. The $\sqrt{X}$ gate must be calibrated separately. What does that tell you about treating gates as ideal mathematical rotations?

Your Turn: Extensions

  • Implement the fit in Python (scipy.optimize.curve_fit) against the twelve data points and reproduce $A_\pi \approx 0.715$; then add binomial error bars and report a confidence interval.
  • Simulate an error-amplification sequence in Qiskit with a deliberately mis-set rotation angle and confirm the $(2n+1)$ scaling.
  • Extend the model to include a detuning term and show how off-resonant driving tilts the rotation axis out of the equatorial plane, capping the achievable $P(1)$ below 1 even with perfect amplitude.

Key Takeaways

  • Gates are not given; they are calibrated. An $X$ gate is a specific pulse amplitude determined experimentally.
  • $P(1) = \sin^2(\Omega t/2)$ is the Bloch-sphere rotation of Chapter 2 read out as a measurement statistic.
  • Measuring at a maximum is measuring where sensitivity vanishes — a general experimental-design lesson well beyond quantum computing.
  • Error amplification converts a second-order signal into a first-order one by repeating the operation, bounded by decoherence.
  • Calibration drifts. Any claim about gate fidelity carries an implicit timestamp.