Multistate time of flight (TOF) in readout calibration#

When a readout pulse is sent to the resonator, the pulse does not propagate through the system and to the digitizer instantly. The time this takes is approximately constant for a fixed frequency and is called the time of flight. The pulse first has to be converted to an analog signal and travel through the line. It rings up as the resonator fills, and then rings down again once the pulse ends. A raw, un-integrated acquisition of this response at the digitizer — a TOF trace, averaged over repetitions — shows when the signal arrives, when it is gone, and, if the qubit is prepared in different states, when the state-dependent part of the response is largest.

This node acquires one TOF trace per basis state and uses them to calibrate the three things a readout acquisition needs to know about the pulse’s shape:

  • measure:acq_delay — how long after the start of the readout pulse the acquisition should start.

  • measure:integration_time — how long the acquisition should integrate for.

  • measure:acq_weights_a / measure:acq_weights_b (with measure:acq_weights_sampling_rate) — the I/Q demodulation weights that emphasize the part of the trace where the states differ most.

One page covers both registry variants, since they are the same class pinned to a different n_states: multistate_tof_2state (n_states: 2, states \(|0\rangle\) and \(|1\rangle\)) and multistate_tof_3state (n_states: 3, states \(|0\rangle\), \(|1\rangle\) and \(|2\rangle\)). Beyond the value of n_states, they differ in:

  • Gates required. multistate_tof_2state needs only a calibrated X gate. multistate_tof_3state also needs a calibrated Rxy_12 (1→2) pulse, since \(|2\rangle\) is prepared as X followed by Rxy_12; see Rabi oscillations and N-Rabi oscillations.

  • Number of runs. Each state is its own compiled schedule and hardware execution, so the 3-state variant runs three times and returns three traces per qubit instead of two.

  • Separation measure. The window is searched on |S0 − S1| for 2 states and on the Heron’s-formula triangle area for 3 states, which only becomes large when all three states are separated — a poorly prepared \(|2\rangle\) therefore degrades the 3-state window.

  • Weight function. The 2-state weights are always the \(|0\rangle\)–\(|1\rangle\) difference; the 3-state weights come from whichever of the three pairs (\(|0\rangle\)–\(|1\rangle\), \(|0\rangle\)–\(|2\rangle\), \(|1\rangle\)–\(|2\rangle\)) has the largest integrated separation inside the window.

Everything else is identical, including the QOI and the Redis fields it writes: the two variants do not keep separate results, so running one overwrites the measure:acq_* values from the other.

Both variants need a working readout (the Measure gate’s currently calibrated pulse must actually excite the resonator). They write the plain measure submodule of each qubit, not the measure_2state_opt / measure_3state_opt ones that the readout optimization nodes write.

Code structure#

Class: MultistateTOF#

The MultistateTOF class is the node in which the measurement, analysis and QOI are defined. A single class serves both variants; the registry only fixes n_states.

A Trace acquisition allows only one acquisition per channel, so the prepared state cannot be swept inside one schedule like an ordinary schedule samplespace. Instead it is an outer_schedule_samplespace (np.arange(n_states) for every qubit): the base node compiles and runs one schedule — one hardware execution — per state and merges the results afterwards, the same mechanism Purity benchmarking uses for its per-seed recompiles.

Because there is no inner samplespace for the generic coordinate-grid reshape to act on, the node overrides configure_dataset: it only renames each raw acquisition channel to its qubit name and drops the trivial (size-1) acquisition-index dimension a Trace acquisition produces.

Class: MultistateTOFMeasurement#

The measurement class builds the schedule for one prepared state per call (see above), read out with the plain Measure gate.

Method: schedule_function#

  • state (dict[str, int]): the state to prepare, 0, 1 or 2.

  • integration_time (float): duration of the acquired raw trace, in seconds.

  • repetitions (int): number of hardware-averaged repetitions.

The schedule resets all qubits passively, prepares them in parallel in the requested state (nothing for \(|0\rangle\); X for \(|1\rangle\); X followed by Rxy_12 for \(|2\rangle\)), and then measures with acq_protocol="Trace", bin_mode="average_append" and acq_duration=integration_time. No sweep coordinates are attached to the acquisition; the state coordinate is added by the outer-loop merge.

Returns:

  • A TimeableSchedule object representing the experimental procedure for that state.

Class: MultistateTOFAnalysis#

The analysis class works per qubit on its (trace sample, state) array of averaged complex traces, in three steps.

Method: compute_qoi#

  1. Separation between the states. For every sample of the trace, the IQ separation between the prepared states is computed: the distance |S0 − S1| for 2 states, the area of the triangle spanned by the three states’ IQ points (Heron’s formula) for 3 states. The area vanishes when the three points are collinear, in particular when any two coincide.

  2. Integration window. The separation is accumulated over the trace and the linear ramp of its average slope is subtracted, giving a de-trended cumulative separation. Before the signal arrives there is no contrast between the states and the curve falls; while the states are well separated it rises; after the ring-down it falls again. The window therefore ends at the curve’s maximum (t1) and starts at its minimum (t0) — unless the curve never dips below zero before the maximum, in which case it starts at the beginning of the trace (t0 = 0).

    • additional_acq_delay is t0, rounded up to the hardware’s minimum time between operations (4 ns), and is 0 if the window starts at the beginning of the trace.

    • integration_time is t1 − t0, rounded up the same way.

  3. Integration weights, see below.

Method: _compute_integration_weights#

Each state’s averaged trace is demodulated: decimated by 2 (to the 500 MSa/s rate the weights are defined at), its mean removed, and multiplied by the complex exponential at nco_freq. If filter_weights is set, real and imaginary parts are then low-pass filtered with a Butterworth filter. The weight function is the difference between two states’ demodulated traces — for 2 states simply demod(|0⟩) − demod(|1⟩); for 3 states the pair with the largest integrated |difference| inside the integration window. Its real part is w_I, its imaginary part w_Q; each is normalized separately to a maximum absolute value of 1.

Class: MultistateTOFParameters#

The MultistateTOFParameters 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#

  • n_states: 2 | 3 = 2 — number of basis states the qubit is prepared in, one raw trace per state. This is the field the registry pins: multistate_tof_2state sets it to 2, multistate_tof_3state to 3.

  • integration_time: float = 3.0 µs — duration of the acquired raw trace. It must comfortably contain the readout pulse’s ring-up and ring-down, otherwise the window search cannot find the end of the signal.

  • repetitions: int = 1024 — number of hardware-averaged repetitions per state.

Analysis fields#

  • nco_freq: float = 0 Hz (−500 MHz to 500 MHz) — intermediate (NCO) frequency used to demodulate the raw trace when computing the weights; set it to the readout intermediate frequency of the qubit’s readout channel, otherwise the weights are demodulated at the wrong frequency.

  • filter_weights: bool = True — low-pass filter the demodulated per-state traces before computing the weights.

  • filter_weights_fcrit: float = 100 MHz (0 to 250 MHz, exclusive) — cutoff of the Butterworth low-pass filter. It must stay below the Nyquist frequency of the demodulated signal (250 MHz).

  • filter_weights_order: int = 3 (1 to 10) — order of the Butterworth low-pass filter.

Class: MultistateTOFQOI#

The quantities of interest, shared by both variants:

  • additional_acq_delay → measure:acq_delay (s)

  • integration_time → measure:integration_time (s)

  • w_i → measure:acq_weights_a and w_q → measure:acq_weights_b (lists of floats)

  • acq_weights_sampling_rate → measure:acq_weights_sampling_rate (Hz; half the 1 GSa/s trace rate, since the weights are defined on the decimated trace)

  • t0, t1: the start and end of the integration window within the trace, in seconds. Diagnostic only — they are not written to the device.

No error term is reported for any field (to_redis_dict hardcodes error: 0.0), since the window is picked from a cumulative curve rather than a fit. The weights are kept as plain lists, not a Redis-specific encoding, because the same values are also set directly on the live device model.