Rabi oscillations calibration and analysis#

Rabi oscillations calibrate the drive amplitude of the \(\pi\)-pulse (the X gate). Sweeping the amplitude of a Gaussian pulse and measuring the transmission coefficient (S21) afterwards traces out a cosine in the qubit population; fitting that cosine gives the amplitude that produces a full population inversion. The same procedure applies to the 1→2 transition, with the only difference being that the qubit is first initialized to state 1.

Code structure#

Measurement class: RabiOscillationsMeasurement#

The RabiOscillationsMeasurement class facilitates the creation of schedules for Rabi oscillations.

Method: schedule_function#

The schedule_function generates an experimental schedule for performing Rabi oscillations. The sequence involves:

  1. Reset: Resets all qubits to a known state.

  2. Initialize Qubit: Initialize the qubit to state 0 or 1, depending on which qubit frequency you want to attain.

  3. Amplitude Sweeping: Iteratively adjusts the probing amplitude.

  4. Measurement: Captures the qubit response at each probing point.

Parameters:

  • mw_amplitudes (dict[str, np.ndarray]): Amplitudes of the probing \(\pi\)-pulses.

  • repetitions (int): Number of times the schedule will repeat.

  • qubit_state (int): The state for the qubit.

Returns:

  • A Schedule object representing the experimental procedure.

Analysis class: RabiAnalysis#

The RabiAnalysis class fits a cosine model to the magnitude response against drive amplitude.

Method: compute_qoi#

A RabiModel (cosine, phase fixed at π so the response is at a minimum at drive_amp=0, i.e. the qubit starts in \(|0\rangle\)) is fit to the data. Its oscillation frequency f gives the π-pulse amplitude as amp180 = 1/(2f), since a π-rotation corresponds to half of a full Rabi period. The initial frequency guess for the nonlinear fit comes from an FFT of the magnitude trace against drive amplitude, which turns a coarse period estimate into a reliable starting point without a hand-tuned guess.

The fit is accepted only if both the amplitude’s relative uncertainty stays below scaled_uncertainty_analysis_threshold and amp180 itself stays below pi_amplitude_analysis_threshold — an implausibly large fitted amplitude usually means the fit locked onto noise rather than a real oscillation.

Method: add_traces#

Plots the magnitude data against drive amplitude together with the fitted cosine curve, annotated with the fitted π-pulse amplitude and its scaled uncertainty.

Parameters class: RabiParameters#

The RabiParameters class defines the configurable parameters for the Rabi node. Each field is either an acquisition field (baked into the hardware sweep) or an analysis field (post-processing only) — see Parameter field categories.

Acquisition fields#

  • min_amplitude / max_amplitude / amplitude_bins: range and density of the drive-amplitude sweep (default -0.9 / 0.9 / 81).

  • repetitions: number of repetitions (averages) per point (default 1024).

Analysis fields#

  • scaled_uncertainty_analysis_threshold: maximum scaled fit uncertainty for a successful analysis (default 2e-2).

  • pi_amplitude_analysis_threshold: maximum accepted π-pulse amplitude (default 0.95).

QOI class: RabiBaseQOI#

The RabiBaseQOI class encapsulates the quantity of interest for the Rabi calibration: the fitted π-pulse amplitude and its error. The transition-specific subclasses Rabi01QOI and Rabi12QOI route this value to the correct device field (rxy.amp180 or r12.ef_amp180).