CZ Conditional Phase & CZ Local Phases in Two-Qubit Gate Calibration#
The parametric CZ gate accumulates a conditional phase on its target qubit (ideally 180°, i.e. a true CZ), but in practice that phase includes contributions from both the coupler’s flux pulse itself and residual single-qubit (“local”) phases each qubit separately picks up from being flux-pulsed. This node family measures both quantities — the conditional phase itself, and each qubit’s local phase — by comparing Ramsey-style phase scans on the target qubit with the coupler’s CZ pulse toggled between two conditions. Three registry variants share one class and one measurement/analysis pair, differing only in two boolean parameters:
cz_phases_conditional(local_phases=False): compares the target qubit’s Ramsey phase with the control qubit prepared in \(|0\rangle\) vs \(|1\rangle\) (both with the CZ pulse’s virtual-Z phase corrections applied). The difference between the two fitted phases is the CZ conditional phase.cz_phases_local(local_phases=True,swap_control_and_target=False): compares the target qubit’s Ramsey phase with the CZ pulse off vs on (no virtual-Z corrections, no conditional preparation of the control qubit), giving the local phase the target qubit itself picks up from the flux pulse.cz_phases_local_swap(local_phases=True,swap_control_and_target=True): the same local-phase measurement with the control/target roles swapped, giving the local phase on the other qubit of the coupler.
Each variant requires a prior successful CZ parametrization (or CZ chevron) result for its coupler, since the CZ pulse’s frequency/amplitude/duration are read as already-calibrated settings rather than swept here.
Code structure#
Class: CZPhases#
The CZPhases class sets up the Ramsey-phase scan for every coupler, for whichever of the three variants
above parameters selects.
Class: CZPhasesMeasurement#
The measurement class responsible for executing the scan. For every coupler, both qubits are reset and the
target qubit’s Ramsey phase is scanned for each of two control_ons conditions.
Method: _qubit_roles#
Determines which qubit of the coupler plays Control vs Target from cz_transition ("20" drives the
coupler’s first-named qubit towards \(|2\rangle\) and the second towards \(|0\rangle\) — the first is Control, the second
Target; "02" is the reverse), then swaps them if swap_control_and_target is set.
Method: schedule_function#
For each (control_on, phase) point:
Reset both qubits.
Conditional preparation (only when
not local_phases): ifcontrol_on, apply anXgate to the control qubit.X90 on the target qubit.
CZ pulse: applied at the coupler’s calibrated frequency/duration and its calibrated amplitude — except when
local_phases and not control_on, where the amplitude is forced to zero (the “gate off” condition for a local-phase measurement).Virtual-Z phase corrections (only when
not local_phases): the calibratedcontrol_phase_correction/target_phase_correction(folded into(-360°, 0°]so they always rotate “backwards”) are applied to the control/target qubits viaRzimmediately after the CZ pulse.Conditional preparation, again (only when
not local_phases): ifcontrol_on, a secondXgate returns the control qubit to \(|0\rangle\) before readout.Rxy(θ=90°, φ=phase) on the target qubit — the swept Ramsey phase.
Measurement: both qubits are read out via
Measure_RO1.
Class: CZPhasesAnalysis#
The analysis class that fits the coupler’s Control and Target qubit Ramsey-phase scans and packages the
result into one of the three QOI classes below, depending on parameters.local_phases/
swap_control_and_target. Because the dataset’s data variables are named after each qubit rather than the
coupler, this class overrides analyse_element/_process to group a coupler’s two qubit variables directly
instead of relying on the generic per-element slicing.
Method: compute_qoi#
Only the Target qubit’s (control_on × phase) magnitude map is fit — with CZModel, a cosine-type model —
for each of the two control_ons rows; the Control qubit’s map is not expected to oscillate and is
instead just averaged per row as a flat reference. From the Target fit:
cphase= the difference (mod 360°) between the two rows’ fitted phase offsets — this is the conditional phase whenlocal_phases=False, or the local phase itself whenlocal_phases=True.pop_loss= the difference between the two rows’ mean magnitude — a simple magnitude-based population-loss estimate (not derived from classified-state populations).
Which QOI fields get populated depends on the variant: conditional-phase runs report cz_phase/
cz_pop_loss; local-phase runs report cz_local_target (unswapped) or cz_local_control (swapped).
Output: xarray.Dataset#
Each coupler’s dataset holds, per qubit, a magnitude map over control_ons (2 values) and the swept Ramsey
phases.
Figures#
The figure shows the Control and Target qubits’ Ramsey-phase scans side by side, one trace per control_ons
value (labeled “Control Off”/”Control On” for the conditional-phase variant, “Gate Off”/”Gate On” for the
local-phase variants) with its fit overlaid, vertical lines marking each row’s fitted phase, and a text box
reporting the extracted phase and population loss.
Class: CZPhasesParameters#
The CZPhasesParameters class encapsulates the parameters shared by all three variants. All fields
currently use plain pydantic Field (no acquisition/analysis categorization yet); see
Parameter field categories.
repetitions: int = 1024 — repetitions (averages) per point.ramsey_phases_max: float = 720.0 — end of the Ramsey-phase sweep (degrees).ramsey_phases_bins: int = 25 — number of Ramsey-phase points.cz_transition: str = “20” — targeted transition,"20"or"02": determines which qubit of the coupler plays Control vs Target (before anyswap_control_and_targetswap). Same convention ascz_parametrization’s field of the same name.local_phases: bool = False — ifFalse, measure the CZ conditional phase (registry:cz_phases_conditional); ifTrue, measure a local phase instead (registry:cz_phases_local/cz_phases_local_swap).swap_control_and_target: bool = False — only used whenlocal_phases=True: swap which qubit of the coupler plays Control vs Target, to measure the other qubit’s local phase.downconvert_frequency: float = 4.4e9 — flux-line downconversion offset (Hz); the CZ pulse clock is programmed at-frequency + downconvert_frequency. Hardware-wiring specific.
QOI classes#
Each registry variant injects a different QOI class:
CZConditionalPhaseQOI(cz_phases_conditional):cz_phase/cz_phase_error(the conditional phase, degrees) andcz_pop_loss. There is no coupler-edge device field for these — they are informational only.CZLocalPhaseQOI(cz_phases_local):cz_local_target/cz_local_target_error, written to the coupler edge’sParametricCZSubmoduleascz:target_phase_correction— the target qubit’s calibrated virtual-Z correction, consumed by the conditional-phase variant’s owntarget_phase_correctionschedule input.CZLocalPhaseSwapQOI(cz_phases_local_swap):cz_local_control/cz_local_control_error, written ascz:control_phase_correction— same role as above, for the control qubit.