Calibration Loops
A calibration loop repeatedly measures a device, estimates how its parameters have changed, and adjusts the controls. For example, a Ramsey experiment can reveal a shifted qubit frequency; the next drive can then be retuned. The challenge is to follow real changes without mistaking measurement noise for drift or making a correction that harms another gate.
Calibration usually combines information from many experimental runs and changes later runs. This differs from a feedback pulse chosen from a measurement during one run, although the two can share hardware. We focus on estimation, update dynamics, interacting calibrations and independent checks of whether an adjustment helped.
Required background. Pulse-level control connects settings to gates; control and readout introduces calibration experiments; measurement as estimation explains uncertainty and likelihoods.
Measuring a frequency error
Section titled “Measuring a frequency error”Suppose a qubit has angular-frequency detuning from its drive reference. Choose the Ramsey analysis-phase convention so that the probability of one labeled outcome is
where is the contrast and is a controllable phase. Independent shots at fixed settings give a binomial count; drift or memory between shots can invalidate that simple likelihood.
At , positive and negative detuning give the same probability. Collecting more shots at that phase cannot distinguish their signs. Near zero detuning, choosing instead gives
The signal now changes linearly with signed detuning. A longer wait increases phase sensitivity, but usually reduces contrast and narrows the unambiguous frequency range: at one fixed , detunings separated by have identical statistics at every analysis phase. Combine suitable waiting times or a sufficiently narrow prior range before using a local linear estimator. Rabi and Ramsey control develops the experiment; the point here is that choosing the measurements is part of the calibration, not a preliminary detail.
Why calibrations depend on one another
Section titled “Why calibrations depend on one another”Calibration procedures are often bootstrapped. A readout classifier may depend on resonator frequency and amplifier state. A drive-amplitude calibration may depend on drive frequency, duration, transfer correction, and the classifier used to interpret outcomes. An entangling operation may depend on both single-qubit frames, coupler bias, neighbor state, and simultaneous-drive context.
Represent these dependencies by a directed graph . An arrow means that calibration uses setting .
If a set changes, the conservative invalidation set is
Rechecking every dependent setting can be expensive. Record which upstream quantities matter and the range over which their variation was tested. If a readout frequency shifts within a tolerance already covered by a classifier’s robust validation region, the classifier need not automatically be refit. The earlier tests must actually cover the changed conditions.
Coupled parameters may need a joint fit
Section titled “Coupled parameters may need a joint fit”An acyclic dependency graph gives an order for the experiments. Physical parameters can nevertheless depend on one another in both directions: drive amplitude affects measured detuning, while the detuning estimate affects the amplitude fit. Treating that as an impossible graph is unhelpful. Instead, either:
- group the coupled parameters into one calibration node;
- define a fixed-point iteration with a convergence and stopping policy; or
- break the cycle with a declared approximation and validate its residual.
The software dependency graph is also not the hardware resource graph. Two nodes can be logically independent yet unable to run concurrently because they share a readout line, laser, microwave source, cryogenic budget, or disturb one another through crosstalk.
Start a device from scratch with broader scans; maintain a working device with targeted checks near its current settings. These need different time and measurement budgets. Kelly and colleagues describe a practical dependency-graph approach.
Combining earlier estimates with new measurements
Section titled “Combining earlier estimates with new measurements”For an already localized frequency offset or gain, a scalar random-walk model is a useful starting point:
Assume independent zero-mean process and measurement noise, with variances and , independent of the initial estimation error. The process noise describes change between measurements; the measurement noise describes uncertainty in each observation. Raw Ramsey counts are nonlinear observations; this model applies to a locally valid frequency estimate or a suitably linearized measurement, not automatically to the raw counts.
If the previous estimate has mean and variance , predict the next mean as and variance as . On receiving , update by
A precise measurement has small and therefore receives more weight. A precise prior has small and changes less. With Gaussian initial uncertainty and Gaussian noises, these are exact Bayesian posterior moments. Under the corresponding second-moment assumptions without Gaussianity, the Kalman recursion gives the optimal linear estimate; a full nonlinear Bayesian estimate may differ. Kalman’s original paper develops the general vector formulation.
The covariance describes uncertainty within the chosen model. A wrong contrast, an aliased frequency, a sudden jump or a changed detector can make a very small reported variance misleading. Examine residuals and test the adjusted gate on independent data. Multimodal frequency estimates may require a distribution over several possible values rather than one mean and variance.
Drift can affect noise rates as well as control frequencies. Klimov and colleagues measured fluctuations in qubit relaxation times; a calibration model should track the quantities relevant to the operation being maintained.
Detecting drift without chasing noise
Section titled “Detecting drift without chasing noise”A monitor should detect operationally meaningful change without turning every statistical fluctuation into a parameter update. If a health measurement has prediction and innovation variance , define the standardized innovation
A single threshold on catches abrupt excursions but is insensitive to small persistent shifts. A two-sided cumulative-sum monitor can use
and trigger when either statistic exceeds . The allowance sets the shift scale of interest; trades detection delay against false alarms. Correlated data, estimated baselines, and repeated monitoring alter the nominal false-alarm rate, so thresholds should be calibrated under the actual acquisition protocol.
For the scalar model above, the innovation is and its predicted variance is . This includes both uncertainty in the predicted device state and measurement noise. Dividing only by can produce too many alarms. The cumulative-sum method traces back to Page; Proctor and colleagues discuss time-resolved drift tests for quantum processors.
Repeated monitoring changes the meaning of a significance threshold. Even independent tests with a five-percent false-alarm probability each have probability of at least one false alarm in twenty tests. Choose thresholds for a specified monitoring horizon or a sequential false-alarm criterion, and account for monitoring many devices. A correction for the number of qubits at one time does not by itself handle repeated looks over time.
A lower reset threshold than trigger threshold can prevent an alarm from rapidly switching on and off. More fundamentally, confirm that the monitor is connected, responsive and sensitive to the suspected drift. No alarm does not establish stability if the diagnostic has stopped working.
When several checks need attention, prioritize the likely effect on the upcoming computation together with the time and disturbance caused by recalibration. The oldest estimate is not necessarily the most consequential.
How strongly should a correction respond?
Section titled “How strongly should a correction respond?”Calibration software can destabilize an otherwise usable device by applying updates too aggressively. Consider a fixed true parameter , an estimate , and a noisy signed error observation
For the proportional update
the estimation error obeys
The noiseless loop is asymptotically stable exactly when
For independent measurement noise and a stationary true parameter, the steady-state error variance is
For , increasing gain removes a fixed offset faster; removes it in one noiseless update. For , the error alternates sign, and its magnitude decays more slowly as approaches two. Thus larger gain does not always mean faster response. Small gain reduces injected measurement noise but follows real drift slowly. Dead bands, regularization, bounded steps, and model-based filtering are ways to shape this tradeoff. They do not replace a stability analysis.
To quantify the drift cost, let the true value change by an independent increment of variance between updates, and write the measurement noise variance as . With the same timing convention,
The stationary variance before each measurement is
It diverges as when : averaging indefinitely cannot track a moving parameter. For , minimizing this variance gives
This optimum lies between zero and one. It is a result for independent random-walk drift, direct measurements and instantaneous updates; delays, colored noise and nonlinear control response change it. In particular, the interval is not a universal rule for delayed feedback.
The same is the steady gain of the scalar Kalman filter above. At stationarity, its prediction and update obey and . Solving gives
The smaller is uncertainty immediately after the measurement. The curve below shows at the optimum: uncertainty before the next measurement, after another drift increment has added variance . For , these are and . Comparing variances at the same time in the cycle therefore reconciles the two calculations.
The dashed curve has a fixed true parameter; the solid curve includes random-walk drift with . Their vertical scale is variance divided by measurement-noise variance. The drifting case has its minimum at ; very weak updates lag behind the changing parameter.
Designing measurements that identify the parameters
Section titled “Designing measurements that identify the parameters”Choose experiment settings that distinguish the changes you need to detect. The Ramsey sign ambiguity is one example. A measured Rabi amplitude can also be confounded with readout contrast or imperfect preparation. Adding more shots to an indistinguishable model does not make it identifiable.
Randomizing or interleaving experimental settings can reduce bias from monotonic drift. Keep their acquisition order, and check whether reset memory, leakage or thermal transients correlate observations. Failed fits, multiple solutions and large residuals are information about the model or experiment, rather than reasons to return the last fitted value as a successful calibration.
How uncertainty affects dependent settings
Section titled “How uncertainty affects dependent settings”If a derived parameter depends smoothly on upstream estimates, first-order covariance propagation using the full joint covariance gives
Shared data can correlate upstream estimates, so discarding off-diagonal covariances can overestimate or underestimate the derived uncertainty. This helps decide whether an upstream update matters for a dependent setting. However, first-order propagation is unreliable near nonlinear boundaries, discrete regime changes, or poorly identified directions. Replaying posterior samples or rerunning the descendant calibration may be safer.
Context must travel with uncertainty. A gate calibrated in isolation is not automatically valid during simultaneous operation. A readout classifier trained at one residual-excitation distribution is not automatically valid after a reset change. A transfer correction measured at one gain, temperature, or routing state may not extrapolate.
Error-Aware Compilation consumes these dated, context-qualified estimates. The compiler should not extend a calibration beyond its declared validity domain merely because no newer record exists.
Checking whether an adjustment helped
Section titled “Checking whether an adjustment helped”Use measurements not used for tuning to compare the old and new settings. Let and be losses measured on an interleaved held-out validation set, and define
For a required improvement margin , one possible policy is
where is a one-sided upper confidence bound constructed for the sampling plan. Paired comparisons must include their covariance; correlated shots require an appropriate standard error. A maintenance update may instead use a noninferiority condition
combined with a reason to prefer the candidate, such as restored validity, lower drift sensitivity, or reduced resource cost.
Neither rule is sufficient by itself. Hard constraints may include leakage, worst-case or tail behavior, reset performance, readout assignment, thermal load, simultaneous-context error, and controller legality. The acceptance metric must match the operation’s use. Optimizing a single-qubit average score does not certify an entangling gate, a measurement instrument, or a logical cycle.
Choose the comparison metric, sample size or sequential stopping rule before inspecting its result. Repeatedly trying candidates against the same small test set can overfit that set, even if it was initially separate from the tuning data. A second diagnostic may expose a different failure, such as leakage hidden by an apparently improved average gate score.
Apply related parameter changes consistently. For example, a pulse tuned using a new frequency should not accidentally run with the old frequency. Keep enough information to reconstruct which settings were used for each batch, and check whether queued work still assumes earlier settings.
If the new settings fail, restoring earlier values can be useful, but it does not restore yesterday’s temperature, wiring or device frequency. Recheck the earlier settings in the current conditions. If neither set is usable, pause the affected experiments and diagnose the change rather than cycling through failed adjustments indefinitely.
Worked example: retuning a qubit
Section titled “Worked example: retuning a qubit”Consider five quantities for one transmon:
Here is readout resonance, is the classifier, is drive frequency, is the -pulse amplitude, and is a qualified single-qubit gate. The edge records that the amplitude experiment used that classifier.
Ramsey measurements with a sign-sensitive analysis phase show a persistent frequency offset. A time-resolved fit estimates
Here the quoted uncertainty is one standard error within the fitted model. The loop proposes a frequency correction and marks and stale. It does not invalidate or because the declared graph contains no path from to those nodes. If microwave leakage changes the readout response, that graph is incomplete and must be repaired.
After updating , the loop reruns an error-amplifying amplitude experiment. Candidate and incumbent are then compared on interleaved independent batches under the same updated frequency, so the amplitude comparison does not mix two frequency settings. Let
Assume enough independent batches for a normal approximation and a preselected sample size. The one-sided upper bound is
If the predeclared minimum improvement is , then . Provided leakage, readout, and simultaneous-context hard limits also pass, the new amplitude is supported by this comparison.
The conclusion is narrow: the candidate improved the declared held-out loss under the measured context. It does not establish a universal gate fidelity, long-term stability, or application-level advantage. Keep the tested time window and settings with the result.
Exercises
Section titled “Exercises”1. Which measurements need repeating?
Section titled “1. Which measurements need repeating?”Consider the graph
Which nodes are conservatively invalidated when changes? Give a valid recalibration order. Does need to run again?
Solution
The descendants of are and , so
After setting the new , run and then . Node is not a descendant of , so the declared graph does not require it to rerun. If the physical frequency change can alter readout, the graph or its assumptions about the context is incomplete.
2. Correlated parameter errors
Section titled “2. Correlated parameter errors”Two estimates have variances and covariance . A derived setting is their difference. Find its variance for , and .
Solution
For , covariance propagation is exact because the function is linear:
The three answers are , zero and . Fully shared errors cancel in the difference; perfectly anticorrelated errors reinforce. These extreme cases are valid positive-semidefinite covariance matrices, although they are singular. Treating the estimates as independent would miss both limits.
3. Proportional-loop stability
Section titled “3. Proportional-loop stability”For
derive the noiseless stability interval and the steady-state variance for independent noise of variance .
Solution
With ,
Noiseless convergence requires , hence . If the stationary variance is ,
Solving gives
Increasing from zero to one speeds noiseless correction but increases measurement-noise variance. Increasing it from one toward two produces slower alternating decay as well as more noise.
4. A CUSUM trigger
Section titled “4. A CUSUM trigger”Let , , , and standardized innovations be
At which sample does the positive CUSUM first trigger?
Solution
The recurrence gives
The statistic first exceeds at sample 5. The result assumes the standardized innovations and threshold calibration are valid for this data stream.
5. Improvement is stronger than noninferiority
Section titled “5. Improvement is stronger than noninferiority”A fixed-size paired comparison estimates new minus old loss as , with standard error . Using the normal multiplier , test both a required improvement of and an allowed worsening of at most .
Solution
The one-sided upper bound is
It is not below , so the improvement criterion fails. It is below , so the stated noninferiority criterion passes under the assumed sampling model. This does not establish equality or improvement. A lower time cost or more stable control might still make the new setting useful, provided the other required performance limits pass.
6. One scalar Kalman update
Section titled “6. One scalar Kalman update”A frequency-offset prior has mean and variance . A direct measurement gives with noise variance . Assume the measurement matrix is one and no additional process noise is added. Find the posterior mean and variance.
Solution
The gain is
Therefore
The calculation is conditional on the linear Gaussian model.
7. Resource-constrained scheduling
Section titled “7. Resource-constrained scheduling”Node calibrates readout resonance in 3 minutes on the readout resource. Node performs drive spectroscopy in 4 minutes on the drive resource. Node trains the classifier in 2 minutes on the readout resource and depends on . Node calibrates pulse amplitude in 3 minutes on the drive resource and depends on both and . Find the shortest schedule under these resource assumptions.
Solution
Run and in parallel from minute 0. Then:
- finishes at minute 3, so runs from 3 to 5;
- finishes at minute 4;
- waits for both parents and runs from 5 to 8.
The makespan is 8 minutes. A serial execution would take 12 minutes. This schedule is legal only if the readout and drive experiments are also experimentally compatible when concurrent.
8. Ramsey signs and frequency aliases
Section titled “8. Ramsey signs and frequency aliases”At one waiting time , a calibration uses only . Can it distinguish from ? What changes if it also uses ? Does this resolve all frequency ambiguity?
Solution
The cosine is even, so the first experiment cannot distinguish the signs. The second measures , which generally distinguishes them and gives linear sensitivity near zero. Together they identify phase modulo , not an unrestricted frequency. Offsets remain indistinguishable for every integer . Use prior localization or additional suitable waiting times to select the frequency branch. At special phases such as zero or , the two signs already coincide modulo .
9. Restoring earlier settings after a temperature change
Section titled “9. Restoring earlier settings after a temperature change”A candidate pulse fails validation after an abrupt refrigerator-temperature excursion. The previous pulse passed yesterday. Is restoring that pulse sufficient?
Solution
No. Rollback restores the previous control artifact but does not restore yesterday’s physical state. Recheck the earlier pulse at the new temperature and with the current related settings. If it also fails, suspend the affected measurements while diagnosing the change.
10. Optimize the gain for a drifting parameter
Section titled “10. Optimize the gain for a drifting parameter”For independent random-walk drift with , minimize the variance above. Compare , and the optimum.
Solution
Differentiating gives the condition
The positive root is . The normalized variances are
The weak update lags behind drift; replacing the estimate with each new measurement injects too much measurement noise. The intermediate gain balances them within the stated model. These are variances, so RMS errors are their square roots times .
References
Section titled “References”- R. E. Kalman, “A new approach to linear filtering and prediction problems,” Journal of Basic Engineering 82, 35–45 (1960), doi:10.1115/1.3662552.
- J. Kelly, P. O’Malley, M. Neeley, H. Neven, and J. M. Martinis, “Physical qubit calibration on a directed acyclic graph” (2018), arXiv:1803.03226.
- P. V. Klimov et al., “Fluctuations of energy-relaxation times in superconducting qubits,” Physical Review Letters 121, 090502 (2018), doi:10.1103/PhysRevLett.121.090502.
- E. S. Page, “Continuous inspection schemes,” Biometrika 41, 100–115 (1954), doi:10.1093/biomet/41.1-2.100.
- T. Proctor, M. Revelle, E. Nielsen, K. Rudinger, D. Lobser, P. Maunz, R. Blume-Kohout, and K. Young, “Detecting and tracking drift in quantum information processors,” Nature Communications 11, 5396 (2020), doi:10.1038/s41467-020-19074-4.