Resonator spectroscopy as a function of the readout amplitude (aka Punchout)#
The resonator spectroscopy measured as a function of the readout amplitude can be used to extract the optimal readout amplitude. This is possible as the response of the resonator should be constant until too much energy is sent to it. Looking at the changes in the resonator frequency, it is possible to estimate the last stable point and set the readout amplitude. This procedure is repeated for all three states (0, 1, and 2) to ensure optimal readout for all states.
Physical motivation for punchout node#
In the dispersive regime, the qubit-resonator coupling pulls the resonator frequency away from its bare value by an amount that depends on the qubit state — this state-dependent shift is what dispersive readout relies on, and the shifted frequency is the dressed frequency. The dispersive approximation only holds while the average photon number in the resonator stays low; as the readout amplitude is increased, the resonator eventually leaves this regime and effectively decouples from the qubit, so its frequency relaxes back towards the bare frequency. Punchout drives the readout amplitude up through this crossover and tracks the resonator frequency to locate it, because operating just below the crossover gives the strongest state-dependent shift — and hence the best single-shot discrimination — while avoiding the fidelity loss the crossover itself causes.
Code structure#
Measurement class: PunchoutMeasurement#
The PunchoutMeasurement class facilitates the creation of schedules for the punchout experiments. The outer sweep loop is the readout frequency, the inner loop the readout pulse amplitude; both are unrolled as a generic_2d_sweep. The qubit is prepared before each point according to qubit_state (0: no preparation, measured through .ro; 1: X, measured through .ro1; 2: X then Rxy_12, measured through .ro2), matching resonator spectroscopy’s own state selection.
Method: schedule_function#
The schedule_function generates the frequency/amplitude sweep schedule described above.
ro_frequencies(dict[str, np.ndarray]): frequencies to probe for each resonator.ro_amplitudes(dict[str, np.ndarray]): readout pulse amplitudes to probe for each resonator.repetitions(int): number of shots per point.qubit_state(int): 0, 1, or 2 — selects the readout clock and any state-preparation pulses.bin_mode("average_append" | "append"): seePunchoutParameters.bin_modebelow — selects whether shots are hardware-averaged or kept individually as ashot_indexcoordinate.
Returns:
A
Scheduleobject representing the experimental procedure.
Analysis class: PunchoutAnalysis#
The PunchoutAnalysis class handles both the per-qubit fit and the figure generation, via one of two end-point methods selected by parameters.bin_mode. The standard figure displays the measurements for each qubit with the selected amplitude shown in each subplot.
Additional figures are produced for debugging purposes; specifically, a plot per qubit is produced with all the individual resonator spectroscopies to visually inspect the optimal selection of the amplitude. The amplitude selected is highlighted with a red square.
Each resonator spectroscopy amplitude slice is analyzed with the ResonatorSpectroscopyAnalysis class (described in resonator spectroscopy) to obtain the fitted resonator frequency.
Frequency-shift end point (bin_mode="average_append", the default)#
Starting from the smallest amplitude, the fitted frequency is tracked amplitude-by-amplitude against the last “still coupled” point; the scan stops at the first amplitude where the frequency either drops by more than lower_threshold (the real punch-out signature — the dressed frequency collapsing towards the bare frequency) or jumps up by more than upper_threshold (a much larger safety-net threshold that mostly catches a poor fit rather than real physics, since genuine dispersive shifts are far smaller). The last amplitude before that shift is the punch-out point. If more than max_consecutive_missing_points amplitudes in a row have no valid fit, the scan also stops early, on the assumption that the resonator shape has become too distorted to trust.
The readout amplitude returned by the analysis is amplitude_scale_factor (default 80%) of the punch-out amplitude, as this is a more stable operating point, especially for reading out the 1 and 2 states.
Circularity end point (bin_mode="append", registry variants punchout_circ/punchout_circ_1/punchout_circ_2)#
Rather than hardware-averaging, this mode keeps every individual shot (a shot_index coordinate), so the single-shot IQ cloud at each amplitude’s resonator dip can be inspected directly. While the readout stays in the linear (non-discriminating) regime the cloud is round; once it starts to discriminate qubit states, it stretches — which also biases the resonator fit itself. bragi_quantum.experiments.nodes.readout.punchout.circularity:
iq_clouds_at_dipextracts the (N, 2) single-shot IQ cloud at each amplitude’s fitted resonator dip (its minimum-|S21| frequency bin).compute_circularitiesfits a bivariate Gaussian to each cloud and reports the ratio of its covariance eigenvalues,λ_min/λ_max— 1.0 for a perfectly round cloud, 0.0 for a fully elongated one,NaNwhere the fit isn’t possible.find_endpoint_by_circularitypicks the highest amplitude whose circularity still meetscircularity_threshold, considering all amplitudes at once (so one noisy dip in circularity doesn’t end the search early) and falling back to the amplitude with the highest available circularity if none meets the threshold.
This mode additionally produces a standalone circularity-vs-amplitude figure (circularity_figure) and a grid of per-amplitude IQ-cloud scatter plots with 99%-confidence ellipses (point_clouds_grid_figure), with the selected end point highlighted in both.
Visualization of the punchout#

In the picture above, one can see the plot for the punchout. The plot shows the resonator frequency as a function of the readout amplitude with the z-axis showing the normalized magnitude in each resonator spectroscopy; the normalization is performed due to the very different range in magnitudes in different spectroscopies. Each plot shows the selected readout amplitude in the figure (red X) and the value in the legend. In this example, the resonator frequency in Q1 (the minimum in each vertical slice representing a resonator spectroscopy at a certain readout amplitude) is flat up to the limit of the explored range, so it probably can be pushed harder but the range would need to be extended. In Q2 it is possible to see that the frequency of the resonator starts to lower when the amplitude reaches 0.035. This behavior is even more extreme for the resonators in Q3, Q4 and Q5 that need to be read out with lower amplitudes.
Troubleshooting#
Sub-optimal readout amplitude#
In cases like Q1, extending the range is probably necessary to capture the best readout amplitude. However, the problem is usually caused by values of the amplitudes that induce a small distortion in the resonator spectroscopies. For this reason, additional figures, one per qubit, are available displaying each resonator spectroscopy as shown below.

In this figure, it is possible to see how the resonator spectroscopy is progressively distorted and how, already in the second row, the fits are not as good as in the plot for the selected amplitude (subplot circled in red).
Especially in cases with a small granularity in the amplitude, it may be possible that the selected value is sub-optimal, looking at these plots will help fine-tune the value of the readout amplitude.
Output errors#
If the output is too high, the QRM_RF will not be able to digitize the signal properly and the results will be unreliable. In this case, the following error will be shown on screen and in the log:
[ic_clusterA_module16|seq0] OUTPUT_OVERFLOW - Output overflow.
In this case, the maximum amplitude should be reduced and the punchout re-run.
References#
Parameters#
The PunchoutParameters class defines both the acquisition and analysis settings, all configurable from the device config file — see Parameter field categories for what the two groups mean.
Acquisition fields#
samples/half_width (default 200 / 2.0MHz) set the per-amplitude frequency sweep, reused by the resonator fit. The amplitude sweep is two-segment — dense at low power where the resonator dip moves quickly, coarse at high power — split by crossover_amplitude (default 0.06) with low_amplitude_bins/high_amplitude_bins (default 10 / 15) points below/above it, between min_amplitude and max_amplitude (default 0.015 / 0.2). repetitions (default 800) sets the averaging per point.
bin_mode:"average_append" | "append"="average_append"— selects which end-point method runs:"average_append"hardware-averages each point (repetitionsaverages) and uses the frequency-shift end point;"append"keeps every single-shot repetition instead and uses the IQ-cloud-circularity end point. This is what thepunchout_circ/punchout_circ_1/punchout_circ_2registry variants set.
Analysis fields#
lower_threshold: float, downward resonator-frequency shift (Hz) that marks the punch-out point. Default 0.05e6 (50kHz).upper_threshold: float, upward resonator-frequency shift (Hz) that also ends the scan (a much larger value, meant to catch an implausible fit rather than real physics). Default 0.1e8 (10MHz).amplitude_scale_factor: float, fraction of the punch-out amplitude used as the returned operating point. Default 0.8.max_consecutive_missing_points: int, number of consecutive amplitudes without a valid fit before the scan gives up. Default 3.circularity_threshold: float, minimum IQ-cloud circularity (ratio of the covariance eigenvalues,λ_min/λ_max) required to consider an amplitude still in the linear (non-discriminating) regime; only used by the circularity end point (bin_mode="append"). Default 0.8.min_r_squared/max_abs_theta: forwarded to each per-amplitudeResonatorSpectroscopyAnalysisfit as its fit-quality gate — see resonator spectroscopy. Defaults 0.9 / 0.25.