Simple Algorithm
Quantum Computing · Rydberg State · 26 min

Pulse-Level Control

Below the gate: shaping microwave and laser pulses.

A gate is a promise; a pulse is how the promise is kept. Under every X\sqrt X is a shaped microwave burst a few tens of nanoseconds long, designed against leakage, tuned by calibration loops, and sometimes discovered by numerical optimal control.

What you’ll learn

  • Derive the rotating-frame, rotating-wave Hamiltonian of a driven qubit, and relate pulse area, phase and I/Q quadratures to rotations.
  • Explain leakage in weakly anharmonic transmons, and derive the DRAG correction from a spectral argument.
  • State the Lie-algebraic controllability criterion and derive the GRAPE gradient with forward and backward propagators.
  • Design calibration sequences (Rabi, Ramsey, DRAG, error amplification) and estimate their sensitivity.

From pulses to rotations

Model a qubit of transition frequency ωq\omega_q driven by a microwave field with carrier frequency ωd\omega_d, envelope Ω(t)\Omega(t) and phase ϕ\phi (units with ℏ=1\hbar=1):

Hlab(t)=−ωq2Z+Ω(t)cos⁡(ωdt−ϕ) XH_{\text{lab}}(t)=-\frac{\omega_q}{2}Z+\Omega(t)\cos(\omega_dt-\phi)\,X
DerivationRotating frame and rotating-wave approximation
  1. H~=−ωq−ωd2Z+Ω(t)cos⁡(ωdt−ϕ)(Xcos⁡ωdt+Ysin⁡ωdt)\tilde H=-\frac{\omega_q-\omega_d}{2}Z+\Omega(t)\cos(\omega_dt-\phi)\big(X\cos\omega_dt+Y\sin\omega_dt\big)

    Move to the frame rotating at the drive frequency, ∣ψ~⟩=R(t)∣ψ⟩\ket{\tilde\psi}=R(t)\ket\psi with R(t)=e−iωdtZ/2R(t)=e^{-i\omega_dtZ/2}, so that H~=RHR†+iR˙R†\tilde H=RHR^\dagger+i\dot RR^\dagger. Since R X R†=Xcos⁡ωdt+Ysin⁡ωdtR\,X\,R^\dagger=X\cos\omega_dt+Y\sin\omega_dt:

  2. H~=−Δ2Z+Ω(t)2(cos⁡ϕ X+sin⁡ϕ Y)+(terms oscillating at 2ωd),Δ=ωq−ωd\tilde H=-\frac\Delta2Z+\frac{\Omega(t)}{2}\big(\cos\phi\,X+\sin\phi\,Y\big)+\big(\text{terms oscillating at }2\omega_d\big),\qquad\Delta=\omega_q-\omega_d

    Expand with cos⁡(a−ϕ)cos⁡a=12[cos⁡ϕ+cos⁡(2a−ϕ)]\cos(a-\phi)\cos a=\tfrac12[\cos\phi+\cos(2a-\phi)] and cos⁡(a−ϕ)sin⁡a=12[sin⁡ϕ+sin⁡(2a−ϕ)]\cos(a-\phi)\sin a=\tfrac12[\sin\phi+\sin(2a-\phi)]:

  3. HRWA=−Δ2Z+I(t)2X+Q(t)2YH_{\text{RWA}}=-\frac\Delta2Z+\frac{I(t)}{2}X+\frac{Q(t)}{2}Y

    For Ω≪ωd\Omega\ll\omega_d the fast terms average out: the rotating-wave approximation. Writing the drive as I(t)cos⁡ωdt+Q(t)sin⁡ωdtI(t)\cos\omega_dt+Q(t)\sin\omega_dt, with in-phase I=Ωcos⁡ϕI=\Omega\cos\phi and quadrature Q=Ωsin⁡ϕQ=\Omega\sin\phi:

  4. U=exp⁡(−i2[∫0TΩ(t) dt](cos⁡ϕ X+sin⁡ϕ Y))U=\exp\Big(-\frac i2\Big[\int_0^T\Omega(t)\,dt\Big]\big(\cos\phi\,X+\sin\phi\,Y\big)\Big)

    On resonance with a fixed phase, the Hamiltonian commutes with itself at all times, so

  5. This is a rotation by the pulse area θ=∫Ω dt\theta=\int\Omega\,dt about the equatorial axis at angle ϕ\phi; a π\pi pulse has area π\pi. Because RZ(α)R_Z(\alpha) rotates that axis to ϕ+α\phi+\alpha, a ZZ rotation can be implemented by shifting the phase of all later pulses: the virtual Z gate (McKay et al., 2017).

Detuning tilts the rotation axis out of the equator: with Δ≠0\Delta\ne0 the excited-state population oscillates as Ω2Ω2+Δ2sin⁡2 ⁣(12Ω2+Δ2 t)\frac{\Omega^2}{\Omega^2+\Delta^2}\sin^2\!\big(\tfrac12\sqrt{\Omega^2+\Delta^2}\,t\big) and never reaches 1. Feel both effects:

Leakage and DRAG

A transmon is not a two-level system but a weakly anharmonic oscillator: its 1→21\to2 transition sits at ω12=ωq+α\omega_{12}=\omega_q+\alpha, with anharmonicity α/2π\alpha/2\pi of roughly −200-200 to −350-350 MHz, only several percent of ωq/2π≈4\omega_q/2\pi\approx4–66 GHz. A short pulse has a broad spectrum and also drives the 1→21\to2 transition, causing leakage out of the qubit subspace and phase errors from AC Stark shifts. Long pulses avoid this but waste coherence: for gates of tens of nanoseconds, the anharmonicity is the speed limit.

DerivationDRAG from the pulse spectrum
  1. ε~(ν)=∫ε(t) eiνt dt\tilde\varepsilon(\nu)=\int\varepsilon(t)\,e^{i\nu t}\,dt

    Write the drive as a complex envelope ε(t)=I(t)+iQ(t)\varepsilon(t)=I(t)+iQ(t); in the RWA the drive term is 12(ε σ++ε∗σ−)\tfrac12(\varepsilon\,\sigma^++\varepsilon^*\sigma^-) on each transition (with relative matrix element λ≈2\lambda\approx\sqrt2 for 1→21\to2). To first order, a transition detuned by ν\nu from the carrier is driven with amplitude proportional to

  2. ε~(ν)=I~(ν)(1+ic⋅(−iν))=I~(ν) (1+c ν)\tilde\varepsilon(\nu)=\tilde I(\nu)\big(1+ic\cdot(-i\nu)\big)=\tilde I(\nu)\,(1+c\,\nu)

    For a resonant drive the leakage transition sits at ν=α\nu=\alpha. A Gaussian I(t)I(t) of width σ\sigma has ∣I~(ν)∣∝e−ν2σ2/2\abs{\tilde I(\nu)}\propto e^{-\nu^2\sigma^2/2}: small but nonzero at ν=α\nu=\alpha. Add a quadrature proportional to the derivative, Q=c I˙Q=c\,\dot I; integrating by parts, I˙~(ν)=−iν I~(ν)\widetilde{\dot I}(\nu)=-i\nu\,\tilde I(\nu), so

  3. Q(t)=−I˙(t)α⟹ε~(α)=0Q(t)=-\frac{\dot I(t)}{\alpha}\quad\Longrightarrow\quad\tilde\varepsilon(\alpha)=0

    Choose c=−1/αc=-1/\alpha to place an exact spectral zero on the leakage transition:

  4. This is the first-order DRAG pulse (Motzoi, Gambetta, Rebentrost & Wilhelm, 2009). Their derivation, an adiabatic frame transformation of the three-level Hamiltonian, also prescribes a small time-dependent detuning to cancel the AC Stark phase. Since ∫I˙ dt=0\int\dot I\,dt=0, the quadrature leaves the rotation angle unchanged. In practice one writes Q=−β I˙/αQ=-\beta\,\dot I/\alpha and calibrates the dimensionless β\beta, of order one, on the device.

python
import numpy as np

def drag_envelope(duration, sigma, amp, beta, alpha, dt=0.25):
    """Complex DRAG envelope I + iQ (times in ns, alpha in rad/ns)."""
    t = np.arange(0.0, duration, dt)
    t0 = duration / 2
    I = amp * np.exp(-((t - t0) ** 2) / (2 * sigma**2))   # Gaussian in-phase part
    dI = -(t - t0) / sigma**2 * I                           # its time derivative
    Q = -beta * dI / alpha                                  # DRAG quadrature
    return t, I + 1j * Q

# a 24 ns pulse on a transmon with anharmonicity -2*pi*0.3 GHz
t, env = drag_envelope(24.0, 6.0, amp=0.1, beta=1.0, alpha=-2 * np.pi * 0.3)

Illustrative. Real devices truncate and offset the Gaussian so it starts and ends at zero, and calibrate amp and beta experimentally.

Check your understanding

Why does a shorter single-qubit pulse on a transmon need the DRAG correction more urgently?

  1. Its rotation angle is smaller
  2. The rotating-wave approximation becomes exact for short pulses
  3. Short pulses cannot be shaped
  4. Its spectrum is broader, so it puts more weight at the 1→21\to2 transition detuned by α\alpha
Show the answer

D. Its spectrum is broader, so it puts more weight at the 1→21\to2 transition detuned by α\alpha

Spectral width scales like 1/σ1/\sigma. For a Gaussian the weight at ν=α\nu=\alpha is ∝e−α2σ2/2\propto e^{-\alpha^2\sigma^2/2}, which grows rapidly as σ\sigma shrinks toward 1/∣α∣1/\abs\alpha. DRAG removes the first-order part of that leakage drive.

Optimal control and GRAPE

DRAG is an analytic answer to one problem. Optimal control asks the general question: given H(t)=H0+∑kuk(t)HkH(t)=H_0+\sum_ku_k(t)H_k, with drift H0H_0 and control Hamiltonians HkH_k, which control functions uk(t)u_k(t) produce a target unitary quickly and robustly? First, can they?

GRAPE (Khaneja et al., 2005) discretizes time into NN slices of length Δt\Delta t with piecewise-constant controls uk(j)u_k(j), so U=UN⋯U1U=U_N\cdots U_1 with Uj=e−iΔt(H0+∑kuk(j)Hk)U_j=e^{-i\Delta t(H_0+\sum_ku_k(j)H_k)}, and climbs the gradient of the gate fidelity.

DerivationThe GRAPE gradient
  1. Φ=∣g∣2d2,g=Tr⁡(W†UN⋯U1)\Phi=\frac{\abs{g}^2}{d^2},\qquad g=\Tr\big(W^\dagger U_N\cdots U_1\big)

    Fidelity to a target WW on a dd-dimensional space, insensitive to global phase:

  2. ∂Uj∂uk(j)≈−iΔt HkUj⟹∂g∂uk(j)≈−iΔt Tr⁡(Pj†HkXj)\frac{\partial U_j}{\partial u_k(j)}\approx-i\Delta t\,H_kU_j\quad\Longrightarrow\quad\frac{\partial g}{\partial u_k(j)}\approx-i\Delta t\,\Tr\big(P_j^\dagger H_kX_j\big)

    Split at slice jj: forward propagator Xj=Uj⋯U1X_j=U_j\cdots U_1 and backward propagator Pj=Uj+1†⋯UN†WP_j=U_{j+1}^\dagger\cdots U_N^\dagger W, so that g=Tr⁡(Pj†Xj)g=\Tr(P_j^\dagger X_j) for every jj. To first order in Δt\Delta t,

  3. ∂Φ∂uk(j)=2d2Re⁡(g∗∂g∂uk(j))≈2Δtd2Im⁡(g∗ Tr⁡(Pj†HkXj))\frac{\partial\Phi}{\partial u_k(j)}=\frac{2}{d^2}\operatorname{Re}\Big(g^*\frac{\partial g}{\partial u_k(j)}\Big)\approx\frac{2\Delta t}{d^2}\operatorname{Im}\Big(g^*\,\Tr\big(P_j^\dagger H_kX_j\big)\Big)

    Therefore

  4. One forward sweep (all XjX_j) and one backward sweep (all PjP_j) give all NKNK gradient components, at roughly the cost of two propagations: the adjoint trick that lets GRAPE optimize thousands of parameters. Exact gradients replace the first-order formula by the derivative of the matrix exponential, and quasi-Newton methods such as L-BFGS speed up convergence.

Calibration loops

A gate set is a collection of numbers that drift. Calibration measures and corrects them in dependency order, typically:

ExperimentMeasuresTypical sequence
Spectroscopyqubit frequency ωq\omega_q (coarse)sweep the drive frequency, look for a response
Rabiπ\pi-pulse amplitudesweep the amplitude at fixed duration; P(1)P(1) oscillates with the area
Ramseyfrequency (fine), T2∗T_2^*π2\tfrac\pi2 pulse, wait τ\tau, π2\tfrac\pi2 pulse; fringes at the detuning Δ\Delta
DRAGβ\betasequences whose phase error flips sign with β\beta (e.g. XπYπ/2X_\pi Y_{\pi/2} versus YπXπ/2Y_\pi X_{\pi/2}, or repeated XπX−πX_\pi X_{-\pi} pairs); find where they agree
Error amplificationsmall amplitude and phase errorsrepeat a gate nn times so its errors add coherently
Randomized benchmarkingaverage gate fidelityrandom Clifford sequences of growing length
Predict before you look

Your π\pi pulse over-rotates by 1%: each application rotates by π(1+0.01)\pi(1+0.01) about xx. Starting from ∣0⟩\ket0, you apply it 20 times, which ideally returns the qubit to ∣0⟩\ket0. What is P(1)P(1), in percent?

Show the answer

9.5 %

Rotations about the same axis add, so the total error angle is 20×0.01π=0.2π20\times0.01\pi=0.2\pi and P(1)=sin⁡2(0.1π)≈0.095P(1)=\sin^2(0.1\pi)\approx0.095. A single pair of pulses would show only sin⁡2(0.01π)≈0.1%\sin^2(0.01\pi)\approx0.1\%. Error amplification turns an invisible 1% miscalibration into a 10% signal, growing linearly in the error angle with the number of repetitions.

Calibrations depend on each other (no Ramsey before a rough π\pi pulse, no DRAG tuning before a good frequency), so labs organize them as a directed acyclic graph of experiments, re-running nodes whose checks fail. Drift from defects in the materials, temperature changes and electronics means parts of the graph re-run on timescales of hours to days.

Key takeaways

  • In the rotating frame (RWA), a resonant pulse rotates about an equatorial axis: angle = pulse area, axis = drive phase (I/Q); ZZ rotations are virtual frame updates.
  • Weak anharmonicity causes leakage; DRAG adds Q=−βI˙/αQ=-\beta\dot I/\alpha, putting a spectral zero on the 1→21\to2 transition without changing the area.
  • Controllability holds iff the control Hamiltonians bracket-generate su(d)\mathfrak{su}(d); GRAPE climbs the fidelity gradient using forward and backward propagators.
  • Calibration is a dependency graph of experiments (Rabi, Ramsey, DRAG, error amplification, RB), re-run as parameters drift.

Check yourself

In the interactive lesson these are scored with your confidence, and what you miss comes back for review.

Question 1

A resonant pulse with area ∫Ω dt=π/2\int\Omega\,dt=\pi/2 and drive phase ϕ=π/2\phi=\pi/2 acts on ∣0⟩\ket0. Which rotation is it?

  1. RX(π/2)R_X(\pi/2)
  2. RY(π/2)R_Y(\pi/2)
  3. RY(π)R_Y(\pi)
  4. RZ(π/2)R_Z(\pi/2)
Show the answer

B. RY(π/2)R_Y(\pi/2)

The area sets the angle, π/2\pi/2; the phase sets the axis, cos⁡ϕ X+sin⁡ϕ Y=Y\cos\phi\,X+\sin\phi\,Y=Y for ϕ=π/2\phi=\pi/2. The result is RY(π/2)∣0⟩=∣+⟩R_Y(\pi/2)\ket0=\ket+.

Question 2

The first-order DRAG quadrature Q=−I˙/αQ=-\dot I/\alpha is chosen so that…

  1. …the pulse area doubles
  2. …the rotation axis aligns with ZZ
  3. …the complex envelope's spectrum vanishes at the 1→21\to2 transition, detuned by α\alpha from the carrier
  4. …the pulse becomes robust to T1T_1 decay
Show the answer

C. …the complex envelope's spectrum vanishes at the 1→21\to2 transition, detuned by α\alpha from the carrier

ε~(ν)=I~(ν)(1−ν/α)\tilde\varepsilon(\nu)=\tilde I(\nu)(1-\nu/\alpha) vanishes at ν=α\nu=\alpha, the leakage transition, to first order. The derivative term has zero area, so the rotation angle is unchanged.

Question 3

Why can GRAPE compute the gradient with respect to all N×KN\times K piecewise-constant controls at roughly the cost of two propagations?

  1. It uses finite differences in parallel
  2. The controls commute with the drift
  3. Only the last time slice matters
  4. Forward propagators XjX_j and backward propagators PjP_j are each accumulated in one sweep, and every component is a local trace Tr⁡(Pj†HkXj)\Tr(P_j^\dagger H_kX_j)
Show the answer

D. Forward propagators XjX_j and backward propagators PjP_j are each accumulated in one sweep, and every component is a local trace Tr⁡(Pj†HkXj)\Tr(P_j^\dagger H_kX_j)

This is the adjoint (backpropagation) method: store the forward products, sweep backward multiplying by Uj†U_j^\dagger, and read off each component locally. Finite differences would need NK+1NK+1 full propagations.

Question 4

A qubit has drift H0=Δ2ZH_0=\tfrac\Delta2Z (Δ≠0\Delta\ne0) and a single control u(t) Zu(t)\,Z. Is it controllable on SU(2)SU(2)?

  1. Yes, because both the drift and the control are nonzero
  2. No: both generators are proportional to ZZ, so the Lie algebra they generate is one-dimensional
  3. Yes, given enough time
  4. No, because a drift term always prevents controllability
Show the answer

B. No: both generators are proportional to ZZ, so the Lie algebra they generate is one-dimensional

[Z,Z]=0[Z,Z]=0, so the generated algebra is span{iZ}\mathrm{span}\{iZ\} and only ZZ rotations are reachable. Replace the control by u(t)Xu(t)X and [Z,X]=2iY[Z,X]=2iY completes su(2)\mathfrak{su}(2).

Further reading

  • F. Motzoi, J. M. Gambetta, P. Rebentrost & F. K. Wilhelm, "Simple pulses for elimination of leakage in weakly nonlinear qubits", Phys. Rev. Lett. 103, 110501 (2009).
  • N. Khaneja, T. Reiss, C. Kehlet, T. Schulte-Herbrüggen & S. J. Glaser, "Optimal control of coupled spin dynamics: design of NMR pulse sequences by gradient ascent algorithms", J. Magn. Reson. 172, 296 (2005).
  • P. Krantz et al., "A quantum engineer's guide to superconducting qubits", Applied Physics Reviews 6, 021318 (2019).
  • D. C. McKay, C. J. Wood, S. Sheldon, J. M. Chow & J. M. Gambetta, "Efficient Z gates for quantum computing", Phys. Rev. A 96, 022330 (2017).
  • V. Jurdjevic & H. J. Sussmann, "Control systems on Lie groups", J. Differential Equations (1972).