Skip to content

API reference

Top-level package exports for qubex.

Experiment

User-facing experiment facade for hardware-backed workflows.

Experiment is the recommended starting point for most users. It builds on measurement-side session and execution primitives while providing experiment-oriented setup, calibration, characterization, benchmarking, and analysis flows.

Parameters:

Name Type Description Default
chip_id str | None

Deprecated chip identifier compatibility input.

None
system_id str | None

Canonical system identifier used to resolve configuration resources.

None
muxes Collection[str | int]

Mux labels to use in the experiment.

None
qubits Collection[str | int]

Qubit labels to use in the experiment.

None
exclude_qubits Collection[str | int]

Qubit labels to exclude in the experiment.

None
config_dir str

Path to the configuration directory containing: - box.yaml - chip.yaml - wiring.yaml - skew.yaml

None
params_dir str

Path to the parameters directory containing: - params.yaml - props.yaml

None
calib_note_path Path | str

Path to the calibration note file.

None
calibration_valid_days int

Number of days for which the calibration is valid.

None
drag_hpi_duration int

Duration of the DRAG HPI pulse.

None
drag_pi_duration int

Duration of the DRAG π pulse.

None
readout_duration int

Duration of the readout pulse.

None
readout_pre_margin int

Pre-margin of the readout pulse.

None
readout_post_margin int

Post-margin of the readout pulse.

None
classifier_dir Path | str

Directory of the state classifiers.

None
classifier_type Literal['kmeans', 'gmm']

Type of the state classifier. Defaults to "gmm".

None
configuration_mode ConfigurationMode

Priority-ordered control layout. "ge-ef-cr" assigns channels to GE, then EF, then CR. "ge-cr-cr" assigns GE, then two CR channels. Ports with fewer channels keep the leftmost roles. Defaults to "ge-cr-cr".

None

Examples:

>>> from qubex import Experiment
>>> exp = Experiment(
...     system_id="64Q-HF-Q1",
...     qubits=["Q00", "Q01"],
... )

available_targets property

Return available targets keyed by label.

backend_controller property

Return the backend controller.

benchmarking_service property

Return the benchmarking service.

box_ids property

Return the list of box IDs.

boxes property

Return control/readout boxes keyed by ID.

calib_note property

Return the calibration note instance.

calibration_service property

Return the calibration service.

characterization_service property

Return the characterization service.

chip property

Return the chip model.

chip_id property

Return the chip identifier.

classifier_dir property

Return the classifier directory path.

classifier_type property

Return the classifier type.

classifiers property

Return the active state classifiers.

clifford property

Return the Clifford dictionary.

clifford_generator property

Return the Clifford generator instance.

config_loader property

Return the configuration loader.

config_path property

Return the resolved configuration path.

configuration_mode property

Return the configuration mode.

control_system property

Return the control system.

cr_labels property

Return CR labels for the current chip.

cr_pairs property

Return CR qubit pairs.

cr_pulse property

Return cached CR pulse schedules.

cr_targets property

Return available CR targets.

ctx property

Return the experiment context.

device_controller property

Return the device controller.

drag_hpi_duration property

Return the DRAG half-pi duration.

drag_hpi_pulse property

Return cached DRAG half-pi pulses.

drag_pi_duration property

Return the DRAG pi duration.

drag_pi_pulse property

Return cached DRAG pi pulses.

edge_labels property

Return edge labels in the chip graph.

edge_pairs property

Return edge pairs in the chip graph.

ef_hpi_pulse property

Return cached EF half-pi pulses.

ef_pi_pulse property

Return cached EF pi pulses.

ef_rabi_params property

Return stored EF Rabi parameters.

ef_targets property

Return available EF targets.

experiment_system property

Return the experiment system.

ge_rabi_params property

Return stored GE Rabi parameters.

ge_targets property

Return available GE targets.

hpi_pulse property

Return cached half-pi pulses.

measurement property

Return the measurement instance.

measurement_service property

Return the measurement service.

mux_labels property

Return mux labels for active qubits.

note property

Return the user experiment note instance.

optimization_service property

Return the optimization service.

params property

Return the control parameters.

params_path property

Return the resolved parameters path.

pi_pulse property

Return cached pi pulses.

property_dir property

Return the property directory path.

pulse property

Return the pulse service.

quantum_system property

Return the quantum system.

qubit_labels property

Return the list of active qubit labels.

qubits property

Return qubit objects keyed by label.

rabi_params property

Return stored Rabi parameters.

readout_duration property

Return the readout duration.

readout_post_margin property

Return the readout post margin.

readout_pre_margin property

Return the readout pre margin.

reference_phases property

Return reference phases by target.

resonator_labels property

Return the list of active resonator labels.

resonators property

Return resonator objects keyed by qubit label.

session_service property

Return the session lifecycle service.

state_centers property

Return state centers from calibration notes.

system_manager property

Return the system manager.

targets property

Return all targets keyed by label.

tool property

Return the experiment tool module.

util property

Return the experiment utility helpers.

bell_state_tomography(control_qubit, target_qubit, *, readout_mitigation=None, zx90=None, n_shots=None, shot_interval=None, plot=None, save_image=None, mle_fit=None, **deprecated_options)

Perform Bell-state tomography for a qubit pair.

benchmark_1q(targets=None, *, n_trials=None, in_parallel=None, n_shots=None, shot_interval=None, plot=None, save_image=None, **deprecated_options)

Run standard 1Q benchmarking suite.

benchmark_2q(targets=None, *, n_trials=None, in_parallel=None, n_shots=None, shot_interval=None, plot=None, save_image=None, **deprecated_options)

Run standard 2Q benchmarking suite.

build_classifier(targets=None, *, n_states=None, save_classifier=None, save_dir=None, n_shots=None, shot_interval=None, readout_amplitudes=None, readout_duration=None, readout_pre_margin=None, readout_post_margin=None, add_pump_pulses=None, simultaneous=None, plot=None, **deprecated_options)

Build state classifiers from measurement data.

build_measurement_schedule(pulse_schedule, *, frequencies=None, readout_amplitudes=None, readout_duration=None, readout_pre_margin=None, readout_post_margin=None, readout_ramp_time=None, readout_ramp_type=None, readout_drag_coeff=None, readout_amplification=None, final_measurement=None, capture_placement=None, capture_targets=None, plot=None)

Build a measurement schedule with optional readout/capture overrides.

Parameters:

Name Type Description Default
pulse_schedule PulseSchedule

Base pulse schedule before measurement readout/capture augmentation.

required
frequencies dict[str, float] | None

Temporary frequency overrides keyed by target label.

None
readout_amplitudes dict[str, float] | None

Readout amplitudes keyed by readout or qubit label.

None
readout_duration float | None

Readout duration in ns.

None
readout_pre_margin float | None

Pre-margin inserted before readout in ns.

None
readout_post_margin float | None

Post-margin inserted after readout in ns.

None
readout_ramp_time float | None

Readout ramp time in ns.

None
readout_ramp_type RampType | None

Ramp waveform type.

None
readout_drag_coeff float | None

DRAG coefficient for readout pulse shaping.

None
readout_amplification bool | None

Whether to insert pump/readout amplification pulses. If None, service default is used.

None
final_measurement bool | None

Whether to append final readout pulses at the schedule tail. If None, service default is used.

None
capture_placement CapturePlacement | None

Capture-window placement strategy. If None, service default is used.

None
capture_targets list[str] | None

Explicit capture targets for entire_schedule placement.

None
plot bool | None

Whether to plot the generated pulse schedule. If None, service default is used.

None

Returns:

Type Description
MeasurementSchedule

Execution-ready measurement schedule.

Examples:

>>> schedule = ex.build_measurement_schedule(
...     pulse_schedule=ps,
...     final_measurement=True,
... )

calc_control_amplitude(target, rabi_rate, *, rabi_amplitude_ratio=None)

Calculate control amplitude for the target Rabi rate.

calc_control_amplitudes(rabi_rate=None, *, current_amplitudes=None, current_rabi_params=None, print_result=None)

Calculate control amplitudes for available targets.

calc_rabi_rate(target, control_amplitude)

Calculate Rabi rate from control amplitude.

calc_rabi_rates(control_amplitude=None, *, print_result=None)

Calculate Rabi rates for available targets.

calibrate_1q(targets=None, *, n_shots=None, shot_interval=None, plot=None, coarse=None, **deprecated_options)

Run one-qubit calibration workflow.

calibrate_2q(targets=None, *, cr_calib_params=None, n_shots=None, shot_interval=None, plot=None, **deprecated_options)

Run two-qubit calibration workflow.

calibrate_control_frequency(targets=None, *, detuning_range=None, time_range=None, frequencies=None, amplitudes=None, n_shots=None, shot_interval=None, plot=None)

Calibrate control frequencies for targets.

calibrate_default_pulse(targets=None, *, pulse_type, duration=None, ramptime=None, n_points=None, n_rotations=None, r2_threshold=None, update_params=None, plot=None, n_shots=None, shot_interval=None, **deprecated_options)

Calibrates the default pulse.

Parameters:

Name Type Description Default
targets Collection[str] | str

Target qubits to calibrate.

None
pulse_type Literal['pi', 'hpi']

Type of the pulse to calibrate.

required
duration float

Duration of the pulse.

None
ramptime float

Ramp time of the pulse.

None
n_points int

Number of points to sweep. Defaults to 20.

None
n_rotations int

Number of rotations. Defaults to 1.

None
r2_threshold float

Threshold for R² value. Defaults to 0.5.

None
plot bool

Whether to plot the measured signals. Defaults to True.

None
n_shots int

Number of shots. Defaults to CALIBRATION_SHOTS.

None
shot_interval float

Interval between shots. Defaults to DEFAULT_INTERVAL.

None

Returns:

Type Description
ExperimentResult[AmplCalibData]

Result of the experiment.

calibrate_drag_amplitude(targets=None, *, spectator_state=None, pulse_type, duration=None, n_points=None, n_rotations=None, r2_threshold=None, drag_coeff=None, use_stored_amplitude=None, use_stored_beta=None, plot=None, n_shots=None, shot_interval=None)

Calibrate DRAG amplitude for targets.

calibrate_drag_beta(targets=None, *, spectator_state=None, pulse_type=None, beta_range=None, duration=None, n_turns=None, degree=None, plot=None, n_shots=None, shot_interval=None)

Calibrate DRAG beta for targets.

calibrate_drag_hpi_pulse(targets=None, *, spectator_state=None, n_points=None, n_rotations=None, n_turns=None, n_iterations=None, degree=None, r2_threshold=None, calibrate_beta=None, beta_range=None, duration=None, drag_coeff=None, plot=None, n_shots=None, shot_interval=None)

Calibrate DRAG half-pi pulses for targets.

calibrate_drag_pi_pulse(targets=None, *, spectator_state=None, n_points=None, n_rotations=None, n_turns=None, n_iterations=None, degree=None, r2_threshold=None, calibrate_beta=None, beta_range=None, duration=None, drag_coeff=None, plot=None, n_shots=None, shot_interval=None)

Calibrate DRAG pi pulses for targets.

calibrate_ef_control_frequency(targets=None, *, detuning_range=None, time_range=None, n_shots=None, shot_interval=None, plot=None)

Calibrate EF control frequencies for targets.

calibrate_ef_hpi_pulse(targets=None, *, duration=None, ramptime=None, n_points=None, n_rotations=None, r2_threshold=None, plot=None, n_shots=None, shot_interval=None, **deprecated_options)

Calibrates the ef π/2 pulse.

Parameters:

Name Type Description Default
targets Collection[str] | str

Target qubits to calibrate.

None
duration float

Duration of the pulse.

None
ramptime float

Ramp time of the pulse.

None
n_points int

Number of points to sweep. Defaults to 20.

None
n_rotations int

Number of rotations. Defaults to 1.

None
r2_threshold float

Threshold for R² value. Defaults to 0.5.

None
plot bool

Whether to plot the measured signals. Defaults to True.

None
n_shots int

Number of shots. Defaults to CALIBRATION_SHOTS.

None
shot_interval float

Interval between shots. Defaults to DEFAULT_INTERVAL.

None

Returns:

Type Description
ExperimentResult[AmplCalibData]

Result of the experiment.

calibrate_ef_pi_pulse(targets=None, *, duration=None, ramptime=None, n_points=None, n_rotations=None, r2_threshold=None, plot=None, n_shots=None, shot_interval=None, **deprecated_options)

Calibrates the ef π pulse.

Parameters:

Name Type Description Default
targets Collection[str] | str

Target qubits to calibrate.

None
duration float

Duration of the pulse.

None
ramptime float

Ramp time of the pulse.

None
n_points int

Number of points to sweep. Defaults to 20.

None
n_rotations int

Number of rotations. Defaults to 1.

None
r2_threshold float

Threshold for R² value. Defaults to 0.5.

None
plot bool

Whether to plot the measured signals. Defaults to True.

None
n_shots int

Number of shots. Defaults to CALIBRATION_SHOTS.

None
shot_interval float

Interval between shots. Defaults to DEFAULT_INTERVAL.

None

Returns:

Type Description
ExperimentResult[AmplCalibData]

Result of the experiment.

calibrate_ef_pulse(targets=None, *, pulse_type, duration=None, ramptime=None, n_points=None, n_rotations=None, r2_threshold=None, plot=None, n_shots=None, shot_interval=None, **deprecated_options)

Calibrates the default pulse.

Parameters:

Name Type Description Default
targets Collection[str] | str

Target qubits to calibrate.

None
pulse_type Literal['pi', 'hpi']

Type of the pulse to calibrate.

required
duration float

Duration of the pulse.

None
ramptime float

Ramp time of the pulse.

None
n_points int

Number of points to sweep. Defaults to 20.

None
n_rotations int

Number of rotations. Defaults to 1.

None
r2_threshold float

Threshold for R² value. Defaults to 0.5.

None
plot bool

Whether to plot the measured signals. Defaults to True.

None
n_shots int

Number of shots. Defaults to DEFAULT_SHOTS.

None
shot_interval float

Interval between shots. Defaults to DEFAULT_INTERVAL.

None

Returns:

Type Description
ExperimentResult[AmplCalibData]

Result of the experiment.

calibrate_hpi_pulse(targets=None, *, duration=None, ramptime=None, n_points=None, n_rotations=None, r2_threshold=None, plot=None, n_shots=None, shot_interval=None, **deprecated_options)

Calibrates the π/2 pulse.

Parameters:

Name Type Description Default
targets Collection[str] | str

Target qubits to calibrate.

None
duration float

Duration of the pulse.

None
ramptime float

Ramp time of the pulse.

None
n_points int

Number of points to sweep. Defaults to 20.

None
n_rotations int

Number of rotations. Defaults to 1.

None
r2_threshold float

Threshold for R² value. Defaults to 0.5.

None
plot bool

Whether to plot the measured signals. Defaults to True.

None
n_shots int

Number of shots. Defaults to CALIBRATION_SHOTS.

None
shot_interval float

Interval between shots. Defaults to DEFAULT_INTERVAL.

None

Returns:

Type Description
ExperimentResult[AmplCalibData]

Result of the experiment.

calibrate_pi_pulse(targets=None, *, duration=None, ramptime=None, n_points=None, n_rotations=None, r2_threshold=None, plot=None, n_shots=None, shot_interval=None, **deprecated_options)

Calibrates the π pulse.

Parameters:

Name Type Description Default
targets Collection[str] | str

Target qubits to calibrate.

None
duration float

Duration of the pulse.

None
ramptime float

Ramp time of the pulse.

None
n_points int

Number of points to sweep. Defaults to 20.

None
n_rotations int

Number of rotations. Defaults to 1.

None
r2_threshold float

Threshold for R² value. Defaults to 0.5.

None
plot bool

Whether to plot the measured signals. Defaults to True.

None
n_shots int

Number of shots. Defaults to CALIBRATION_SHOTS.

None
shot_interval float

Interval between shots. Defaults to DEFAULT_INTERVAL.

None

Returns:

Type Description
ExperimentResult[AmplCalibData]

Result of the experiment.

calibrate_readout_frequency(targets=None, *, detuning_range=None, time_range=None, readout_amplitudes=None, n_shots=None, shot_interval=None, plot=None)

Calibrate readout frequencies for targets.

calibrate_zx90(control_qubit, target_qubit, *, ramptime=None, duration=None, amplitude_range=None, initial_state=None, degree=None, adiabatic_safe_factor=None, max_amplitude=None, rotary_multiple=None, use_drag=None, duration_unit=None, duration_buffer=None, n_repetitions=None, x180=None, x180_margin=None, use_zvalues=None, store_params=None, n_shots=None, shot_interval=None, plot=None)

Calibrate the ZX90 gate for a qubit pair.

capture_loopback(schedule, *, n_shots=None)

Capture full-span loopback data on read-in and monitor input channels.

Parameters:

Name Type Description Default
schedule PulseSchedule

Schedule to execute.

required
n_shots int | None

Number of shots.

None

Returns:

Type Description
MeasurementResult

Loopback capture result.

characterize_1q(targets=None, *, n_shots=None, shot_interval=None, plot=None, save_image=None)

Run basic single-qubit characterization routines.

characterize_2q(targets=None, *, n_shots=None, shot_interval=None, plot=None, save_image=None)

Run basic two-qubit characterization routines.

check_noise(targets=None, *, duration=None, plot=None)

Check the noise level of the system.

Parameters:

Name Type Description Default
targets Collection[str] | str

Target labels to check the noise.

None
duration int

Duration of the noise measurement. Defaults to 10240.

None
plot bool

Whether to plot the measured signals. Defaults to True.

None

Returns:

Type Description
MeasureResult

Legacy experiment-layer result of the noise check.

Examples:

>>> result = ex.check_noise(["Q00", "Q01"])

check_rabi(targets=None, *, time_range=None, n_shots=None, shot_interval=None, store_params=None, rabi_level=None, plot=None, **deprecated_options)

Check the Rabi oscillation of the given targets.

Parameters:

Name Type Description Default
targets Collection[str] | str

Target labels to check the Rabi oscillation.

None
time_range ArrayLike

Time range of the experiment in ns. Defaults to RABI_TIME_RANGE.

None
n_shots int

Number of shots. Defaults to DEFAULT_SHOTS.

None
shot_interval float

Interval between shots in ns. Defaults to DEFAULT_INTERVAL.

None
store_params bool

Whether to store the Rabi parameters. Defaults to False.

None
rabi_level Literal['ge', 'ef']

Rabi level to use. Defaults to "ge".

None
plot bool

Whether to plot the measured signals. Defaults to True.

None

Returns:

Type Description
ExperimentResult[RabiData]

Result of the experiment.

Examples:

>>> result = ex.check_rabi(["Q00", "Q01"])

check_status()

Log connectivity, clock, and configuration status.

check_waveform(targets=None, *, method=None, n_shots=None, shot_interval=None, readout_amplitude=None, readout_duration=None, readout_pre_margin=None, readout_post_margin=None, add_pump_pulses=None, plot=None, **deprecated_options)

Check the readout waveforms of the given targets.

Parameters:

Name Type Description Default
targets Collection[str] | str

Target labels to check the waveforms.

None
method Literal['measure', 'execute']

Deprecated selector for waveform-check execution path. Passing this argument emits DeprecationWarning.

None
n_shots int

Number of shots.

None
shot_interval float

Interval between shots in ns.

None
readout_amplitude float

Amplitude of the readout pulse.

None
readout_duration float

Duration of the readout pulse in ns.

None
readout_pre_margin float

Pre-margin of the readout pulse in ns.

None
readout_post_margin float

Post-margin of the readout pulse in ns.

None
add_pump_pulses bool

Whether to add pump pulses to the readout sequence. Defaults to False.

None
plot bool

Whether to plot the measured signals. Defaults to True.

None

Returns:

Type Description
MeasureResult

Legacy experiment-layer result of the waveform check.

Examples:

>>> result = ex.check_waveform(["Q00", "Q01"])

chevron_pattern(targets=None, *, detuning_range=None, time_range=None, frequencies=None, amplitudes=None, rabi_params=None, n_shots=None, shot_interval=None, plot=None, save_image=None)

Measure a chevron pattern for targets.

ckp_experiment(target, qubit_detuning_range=None, qubit_pi_pulse=None, qubit_drive_scale=None, resonator_detuning_range=None, resonator_drive_amplitude=None, resonator_drive_duration=None, plot=None, verbose=None, save_image=None)

Run a CKP experiment and fit dispersive parameters.

ckp_measurement(target, qubit_initial_state, qubit_detuning_range=None, qubit_pi_pulse=None, qubit_drive_scale=None, resonator_detuning_range=None, resonator_drive_amplitude=None, resonator_drive_duration=None, plot=None, verbose=None, save_image=None)

Run a CKP measurement over detuning grids.

ckp_sequence(target, qubit_initial_state=None, qubit_drive_detuning=None, qubit_pi_pulse=None, qubit_drive_scale=None, resonator_drive_detuning=None, resonator_drive_amplitude=None, resonator_drive_duration=None, resonator_drive_ramptime=None)

Build a CKP sequence for qubit-resonator interaction.

clear_defaults()

Clear default calibration notes (deprecated).

cnot(control_qubit, target_qubit, *, zx90=None, x90=None, only_low_to_high=None)

Return a CNOT pulse schedule for a qubit pair.

configure(box_ids=None, exclude=None, mode=None)

Configure hardware targets and push settings to devices.

connect(*, sync_clocks=None, parallel=None)

Connect to the measurement backend and optionally sync clocks.

Parameters:

Name Type Description Default
sync_clocks bool | None

Whether to resync clocks, by default True.

None
parallel bool | None

Whether to fetch backend settings in parallel, by default True.

None

correct_calibration(qubit_labels=None, cr_labels=None, *, save=None)

Correct stored calibration data for qubits and CR pairs.

correct_classifiers(targets=None, *, reference_phases=None, save=None)

Correct stored classifiers using reference phases.

correct_cr_params(cr_labels=None, *, n_shots=None, save=None, **deprecated_options)

Correct stored CR parameters via tomography.

correct_rabi_params(targets=None, *, reference_phases=None, save=None)

Correct stored Rabi parameters using reference phases.

cr_crosstalk_hamiltonian_tomography(*, control_qubit, target_qubit, spectator_qubits=None, time_range=None, ramptime=None, cr_amplitude=None, cr_phase=None, cr_betas=None, cr_power=None, cancel_amplitude=None, cancel_phase=None, cancel_betas=None, cancel_power=None, ramp_type=None, x90=None, x180_margin=None, n_shots=None, shot_interval=None, reset_awg_and_capunits=None, plot=None)

Warn that CR crosstalk tomography moved to contrib and stop execution.

cr_hamiltonian_tomography(*, control_qubit, target_qubit, time_range=None, ramptime=None, cr_amplitude=None, cr_phase=None, cancel_amplitude=None, cancel_phase=None, x90=None, x180_margin=None, n_shots=None, shot_interval=None, reset_awg_and_capunits=None, plot=None)

Run CR Hamiltonian tomography for a qubit pair.

cr_pair(cr_label)

Return the control/target qubit pair for a CR label.

create_1d_cluster_sequence(*args, **kwargs)

Warn that create_1d_cluster_sequence moved to contrib and stop execution.

create_connected_graphs(*args, **kwargs)

Warn that create_connected_graphs moved to contrib and stop execution.

create_cz_rounds(*args, **kwargs)

Warn that create_cz_rounds moved to contrib and stop execution.

create_entangle_sequence(*args, **kwargs)

Warn that create_entangle_sequence moved to contrib and stop execution.

create_ghz_sequence(*args, **kwargs)

Warn that create_ghz_sequence moved to contrib and stop execution.

create_graph_sequence(*args, **kwargs)

Warn that create_graph_sequence moved to contrib and stop execution.

create_maximum_1d_chain(*args, **kwargs)

Warn that create_maximum_1d_chain moved to contrib and stop execution.

create_maximum_directed_tree(*args, **kwargs)

Warn that create_maximum_directed_tree moved to contrib and stop execution.

create_maximum_graph(*args, **kwargs)

Warn that create_maximum_graph moved to contrib and stop execution.

create_maximum_spanning_tree(*args, **kwargs)

Warn that create_maximum_spanning_tree moved to contrib and stop execution.

create_measurement_rounds(*args, **kwargs)

Warn that create_measurement_rounds moved to contrib and stop execution.

create_mqc_sequence(*args, **kwargs)

Warn that create_mqc_sequence moved to contrib and stop execution.

cx(control_qubit, target_qubit, *, zx90=None, x90=None, only_low_to_high=None)

Return a CX pulse schedule for a qubit pair.

cz(control_qubit, target_qubit, *, zx90=None, x90=None, only_low_to_high=None)

Return a CZ pulse schedule for a qubit pair.

delete_defaults()

Delete default calibration notes after confirmation.

disconnect()

Disconnect backend resources held by measurement and backend controllers.

ef_rabi_experiment(*, amplitudes, time_range, frequencies=None, detuning=None, is_damped=None, n_shots=None, shot_interval=None, plot=None, store_params=None, **deprecated_options)

Run an EF Rabi experiment for the specified amplitudes.

estimate_control_amplitude(target, *, frequency_range, control_amplitude=None, readout_amplitude=None, target_rabi_rate=None, n_shots=None, shot_interval=None, plot=None, save_image=None)

Estimate control amplitude from a resonance scan.

execute(schedule, *, frequencies=None, mode=None, n_shots=None, shot_interval=None, readout_amplitudes=None, readout_duration=None, readout_pre_margin=None, readout_post_margin=None, readout_ramptime=None, readout_drag_coeff=None, readout_ramp_type=None, add_last_measurement=None, add_pump_pulses=None, enable_dsp_demodulation=None, enable_dsp_sum=None, enable_dsp_classification=None, line_param0=None, line_param1=None, reset_awg_and_capunits=None, plot=None, **deprecated_options)

Execute the given schedule.

Parameters:

Name Type Description Default
schedule PulseSchedule

Schedule to execute.

required
mode MeasurementMode

Measurement mode. Defaults to "avg".

None
n_shots int

Number of shots.

None
shot_interval float

Interval between shots in ns.

None
frequencies Optional[dict[str, float]]

Frequencies of the qubits.

None
readout_amplitudes dict[str, float]

Readout amplitude for each target.

None
readout_duration float

Readout duration in ns.

None
readout_pre_margin float

Readout pre-margin in ns.

None
readout_post_margin float

Readout post-margin in ns.

None
readout_ramptime float

Readout ramp time in ns.

None
readout_drag_coeff float

Readout DRAG coefficient.

None
readout_ramp_type RampType

Readout ramp type. Defaults to "RaisedCosine".

None
add_last_measurement bool

Whether to add the last measurement to the result. Defaults to False.

None
add_pump_pulses bool

Whether to add pump pulses to the sequence. Defaults to False.

None
reset_awg_and_capunits bool

Whether to reset the AWG and capture units before the experiment. Defaults to False.

None
enable_dsp_demodulation bool

Whether to enable DSP demodulation. Defaults to True.

None
enable_dsp_sum bool | None

Whether to enable DSP summation. Defaults to None.

None
enable_dsp_classification bool

Whether to enable DSP classification. Defaults to False

None
plot bool

Whether to plot the measured signals. Defaults to False.

None

Returns:

Type Description
MultipleMeasureResult

Result of the experiment.

Examples:

>>> with pulse.PulseSchedule(["Q00", "Q01"]) as ps:
...     ps.add("Q00", pulse.Rect(...))
...     ps.add("Q01", pulse.Gaussian(...))
>>> result = ex.execute(
...     schedule=ps,
...     mode="avg",
...     n_shots=1024,
...     shot_interval=150 * 1024,
... )

find_optimal_readout_amplitude(target, *, amplitude_range=None, n_shots=None, shot_interval=None, plot=None, save_image=None)

Find the readout amplitude maximizing state separation.

find_optimal_readout_frequency(target, *, df=None, frequency_width=None, readout_amplitude=None, electrical_delay=None, n_shots=None, shot_interval=None, plot=None, save_image=None)

Find the readout frequency maximizing state separation.

fourier_analysis(*args, **kwargs)

Warn that fourier_analysis moved to contrib and stop execution.

get_confusion_matrix(targets)

Return the confusion matrix for the specified targets.

get_cr_label(control_index, target_index)

Get the cross-resonance label from the given control and target qubit indices.

get_cr_labels(low_to_high=None, high_to_low=None)

Get the cross-resonance labels.

get_cr_pairs(low_to_high=None, high_to_low=None)

Get the cross-resonance pairs.

get_drag_hpi_pulse(target, *, valid_days=None)

Get the DRAG π/2 pulse for the given target.

get_drag_pi_pulse(target, *, valid_days=None)

Get the DRAG π pulse for the given target.

get_edge_labels()

Get the qubit edge labels.

get_edge_pairs()

Get the qubit edge pairs.

get_hpi_pulse(target, *, valid_days=None)

Get the π/2 pulse for the given target.

get_inverse_confusion_matrix(targets)

Return the inverse confusion matrix for the specified targets.

get_pi_pulse(target, *, valid_days=None)

Get the π pulse for the given target.

get_pulse_for_state(target, state)

Return a preparation pulse for the requested state.

get_qubit_label(index)

Get the qubit label from the given qubit index.

get_rabi_param(target, valid_days=None)

Get the Rabi parameters for the given target.

get_resonator_label(index)

Get the resonator label from the given resonator index.

get_spectators(qubit, in_same_mux=None)

Return spectator qubits for the given target.

ghz_state_tomography(*args, **kwargs)

Warn that ghz_state_tomography moved to contrib and stop execution.

hadamard(target, *, decomposition=None)

Return a Hadamard pulse for the target.

interleaved_purity_benchmarking(targets, *, interleaved_clifford, interleaved_waveform=None, n_cliffords_range=None, n_trials=None, seeds=None, max_n_cliffords=None, x90=None, zx90=None, in_parallel=None, n_shots=None, shot_interval=None, plot=None, save_image=None)

Warn that interleaved purity benchmarking moved to contrib and stop.

interleaved_randomized_benchmarking(targets, *, interleaved_clifford, interleaved_waveform=None, n_cliffords_range=None, n_trials=None, seeds=None, max_n_cliffords=None, x90=None, zx90=None, in_parallel=None, n_shots=None, shot_interval=None, plot=None, save_image=None)

Run interleaved randomized benchmarking for the specified targets.

is_connected()

Report whether the measurement backend is connected.

jazz_experiment(target_qubit, spectator_qubit, *, time_range=None, x90=None, x180=None, n_shots=None, shot_interval=None, plot=None)

Run a JAZZ experiment for a target/spectator pair.

linkup(box_ids=None, noise_threshold=None)

Link up specified boxes with optional noise threshold.

load_calib_note(path=None)

Load the calibration data from a given path or the default calibration note file.

load_property(property_name)

Load a property dictionary by name.

load_record(name)

Load an experiment record by name.

measure(sequence, *, frequencies=None, initial_states=None, mode=None, n_shots=None, shot_interval=None, readout_amplitudes=None, readout_duration=None, readout_pre_margin=None, readout_post_margin=None, readout_ramptime=None, readout_drag_coeff=None, readout_ramp_type=None, add_pump_pulses=None, enable_dsp_demodulation=None, enable_dsp_sum=None, enable_dsp_classification=None, line_param0=None, line_param1=None, reset_awg_and_capunits=None, plot=None, **deprecated_options)

Measures the signals using the given sequence.

Parameters:

Name Type Description Default
sequence TargetMap[IQArray] | TargetMap[Waveform] | PulseSchedule

Sequence of the experiment.

required
frequencies Optional[dict[str, float]]

Frequencies of the qubits.

None
initial_states dict[str, str]

Initial states of the qubits.

None
mode MeasurementMode

Measurement mode. Defaults to "avg".

None
n_shots int

Number of shots.

None
shot_interval float

Interval between shots in ns.

None
readout_amplitudes dict[str, float]

Readout amplitude for each target.

None
readout_duration float

Readout duration in ns.

None
readout_pre_margin float

Readout pre-margin in ns.

None
readout_post_margin float

Readout post-margin in ns.

None
readout_ramptime float

Readout ramp time in ns.

None
readout_drag_coeff float

Readout DRAG coefficient.

None
readout_ramp_type RampType

Readout ramp type. Defaults to "RaisedCosine".

None
add_pump_pulses bool

Whether to add pump pulses to the sequence. Defaults to False.

None
enable_dsp_demodulation bool

Whether to enable DSP demodulation. Defaults to True.

None
enable_dsp_sum bool | None

Whether to enable DSP summation. Defaults to None.

None
enable_dsp_classification bool

Whether to enable DSP classification. Defaults to False.

None
reset_awg_and_capunits bool

Whether to reset the AWG and capture units before the experiment. Defaults to False.

None
plot bool

Whether to plot the measured signals. Defaults to False.

None

Returns:

Type Description
MeasureResult

Result of the experiment.

Examples:

>>> result = ex.measure(
...     sequence={"Q00": [0.1+0.0j, 0.3+0.0j, 0.1+0.0j]},
...     mode="avg",
...     n_shots=1024,
...     shot_interval=150 * 1024,
...     plot=True,
... )

measure_1d_cluster_state(*args, **kwargs)

Warn that measure_1d_cluster_state moved to contrib and stop execution.

measure_bell_state(control_qubit, target_qubit, *, control_basis=None, target_basis=None, zx90=None, n_shots=None, shot_interval=None, plot=None, plot_sequence=None, plot_raw=None, plot_mitigated=None, save_image=None, reset_awg_and_capunits=None, **deprecated_options)

Measure a Bell state for a qubit pair.

measure_bell_state_fidelities(*args, **kwargs)

Warn that measure_bell_state_fidelities moved to contrib and stop execution.

measure_bell_states(*args, **kwargs)

Warn that measure_bell_states moved to contrib and stop execution.

measure_cr_crosstalk(*, control_qubit, target_qubit, spectator_qubits, time_range=None, ramptime=None, cr_amplitude=None, cr_phase=None, cr_betas=None, cr_power=None, cancel_amplitude=None, cancel_phase=None, cancel_betas=None, cancel_power=None, echo=None, control_state=None, x90=None, x180=None, ramp_type=None, x180_margin=None, n_shots=None, shot_interval=None, reset_awg_and_capunits=None, plot=None)

Warn that CR crosstalk measurement moved to contrib and stop execution.

measure_cr_dynamics(*, control_qubit, target_qubit, time_range=None, ramptime=None, cr_amplitude=None, cr_phase=None, cancel_amplitude=None, cancel_phase=None, echo=None, control_state=None, x90=None, x180=None, ramp_type=None, x180_margin=None, n_shots=None, shot_interval=None, reset_awg_and_capunits=None, plot=None)

Measure CR dynamics for a control/target pair.

measure_dispersive_shift(target, *, df=None, frequency_width=None, readout_amplitude=None, electrical_delay=None, threshold=None, n_shots=None, shot_interval=None, plot=None, save_image=None)

Measure dispersive shift for the target qubit.

measure_electrical_delay(target, *, f_start=None, df=None, n_samples=None, readout_amplitude=None, n_shots=None, shot_interval=None, plot=None, confirm=None)

Measure the electrical delay for a readout line.

measure_ghz_state(*args, **kwargs)

Warn that measure_ghz_state moved to contrib and stop execution.

measure_graph_state(*args, **kwargs)

Warn that measure_graph_state moved to contrib and stop execution.

measure_idle_states(targets=None, *, n_shots=None, shot_interval=None, readout_amplitudes=None, readout_duration=None, readout_pre_margin=None, readout_post_margin=None, add_pump_pulses=None, plot=None, **deprecated_options)

Measures the idle states of the given targets.

Parameters:

Name Type Description Default
targets Collection[str] | str | None

Targets to measure. Defaults to None (all targets).

None
n_shots int

Number of shots.

None
shot_interval float

Interval between shots in ns.

None
readout_amplitudes dict[str, float]

Readout amplitude for each target.

None
readout_duration float

Readout duration in ns.

None
readout_pre_margin float

Readout pre-margin in ns.

None
readout_post_margin float

Readout post-margin in ns.

None
add_pump_pulses bool

Whether to add pump pulses to the sequence. Defaults to False.

None
plot bool

Whether to plot the measured signals. Defaults to True.

None

Returns:

Type Description
dict

Dictionary containing the idle states for each target.

Examples:

>>> idle_states = ex.measure_idle_states(targets=["Q00", "Q01"])

measure_population(sequence, *, fit_gmm=None, n_shots=None, shot_interval=None, **deprecated_options)

Measures the state populations of the target qubits.

Parameters:

Name Type Description Default
sequence TargetMap[IQArray] | TargetMap[Waveform] | PulseSchedule

Sequence to measure for each target.

required
fit_gmm bool

Whether to fit the data with a Gaussian mixture model. Defaults to False

None
n_shots int

Number of shots. Defaults to DEFAULT_SHOTS.

None
shot_interval float

Interval between shots in ns. Defaults to DEFAULT_INTERVAL.

None

Returns:

Type Description
tuple[dict[str, NDArray[float64]], dict[str, NDArray[float64]]]

State probabilities and standard deviations.

Examples:

>>> sequence = {
...     "Q00": ex.hpi_pulse["Q00"],
...     "Q01": ex.hpi_pulse["Q01"],
... }
>>> result = ex.measure_population(sequence)

measure_population_dynamics(*, sequence, params_list, fit_gmm=None, xlabel=None, scatter_mode=None, show_error=None, n_shots=None, shot_interval=None, **deprecated_options)

Measures the population dynamics of the target qubits.

Parameters:

Name Type Description Default
sequence ParametricPulseSchedule | ParametricWaveformDict

Parametric sequence to measure.

required
params_list Sequence | NDArray

List of parameters.

required
fit_gmm bool

Whether to fit the data with a Gaussian mixture model. Defaults to False.

None
xlabel str

Label of the x-axis. Defaults to "Index".

None
n_shots int

Number of shots. Defaults to DEFAULT_SHOTS.

None
shot_interval float

Interval between shots in ns. Defaults to DEFAULT_INTERVAL.

None

Returns:

Type Description
tuple[dict[str, NDArray[float64]], dict[str, NDArray[float64]]]

State probabilities and standard deviations.

Examples:

>>> sequence = lambda x: {
...     "Q00": ex.hpi_pulse["Q00"].scaled(x),
...     "Q01": ex.hpi_pulse["Q01"].scaled(x),
>>> params_list = np.linspace(0.5, 1.5, 100)
>>> result = ex.measure_population_dynamics(sequence, params_list)

measure_qubit_resonance(target, *, frequency_range=None, control_amplitude=None, readout_amplitude=None, target_rabi_rate=None, n_shots=None, shot_interval=None, plot=None, save_image=None)

Measure qubit resonance over a frequency sweep.

measure_readout_snr(targets=None, *, initial_state=None, readout_duration=None, readout_amplitudes=None, n_shots=None, shot_interval=None, plot=None, save_image=None)

Measure readout SNR for targets.

measure_reflection_coefficient(target, *, center_frequency=None, df=None, frequency_width=None, readout_amplitude=None, electrical_delay=None, qubit_state=None, n_shots=None, shot_interval=None, plot=None, save_image=None)

Measure reflection coefficient around a center frequency.

measure_state(states, *, mode=None, n_shots=None, shot_interval=None, readout_amplitudes=None, readout_duration=None, readout_pre_margin=None, readout_post_margin=None, add_pump_pulses=None, plot=None, **deprecated_options)

Measures the signals using the given states.

Parameters:

Name Type Description Default
states dict[str, Literal['0', '1', '+', '-', '+i', '-i'] | Literal['g', 'e', 'f']]

States to prepare.

required
mode MeasurementMode

Measurement mode. Defaults to "single".

None
n_shots int

Number of shots.

None
shot_interval float

Interval between shots in ns.

None
readout_amplitudes dict[str, float]

Readout amplitude for each target.

None
readout_duration float

Readout duration in ns.

None
readout_pre_margin float

Readout pre-margin in ns.

None
readout_post_margin float

Readout post-margin in ns.

None
add_pump_pulses bool

Whether to add pump pulses to the sequence. Defaults to False.

None
plot bool

Whether to plot the measured signals. Defaults to False.

None

Returns:

Type Description
MeasureResult

Result of the experiment.

Examples:

>>> result = ex.measure_state(
...     states={"Q00": "0", "Q01": "1"},
...     mode="single",
...     n_shots=1024,
...     shot_interval=150 * 1024,
...     plot=True,
... )

measure_state_distribution(targets=None, *, n_states=None, n_shots=None, shot_interval=None, readout_duration=None, readout_amplitudes=None, plot=None, **deprecated_options)

Measure state distributions for the specified targets.

modified_frequencies(frequencies)

Temporarily override target frequencies within the context.

mqc_experiment(*args, **kwargs)

Warn that mqc_experiment moved to contrib and stop execution.

obtain_ampl_rabi_relation(targets=None, *, time_range=None, amplitude_range=None, n_shots=None, shot_interval=None, plot=None)

Obtain the amplitude-Rabi relation for targets.

obtain_coupling_strength(target_qubit, spectator_qubit, *, time_range=None, x90=None, x180=None, n_shots=None, shot_interval=None, plot=None)

Estimate coupling strength for a target/spectator pair.

obtain_cr_params(control_qubit, target_qubit, *, time_range=None, ramptime=None, cr_amplitude=None, n_iterations=None, n_cycles=None, n_points_per_cycle=None, use_stored_params=None, tolerance=None, adiabatic_safe_factor=None, max_amplitude=None, max_time_range=None, x90=None, x180_margin=None, n_shots=None, shot_interval=None, reset_awg_and_capunits=None, plot=None)

Obtain CR parameters for a qubit pair.

obtain_ef_rabi_params(targets=None, *, time_range=None, is_damped=None, n_shots=None, shot_interval=None, plot=None, **deprecated_options)

Obtain EF Rabi parameters for target qubits.

obtain_effective_control_frequency(targets=None, *, time_range=None, detuning=None, n_shots=None, shot_interval=None, plot=None)

Estimate effective control frequencies for targets.

obtain_freq_rabi_relation(targets=None, *, detuning_range=None, time_range=None, rabi_level=None, n_shots=None, shot_interval=None, plot=None)

Obtain the frequency-Rabi relation for targets.

obtain_rabi_params(targets=None, *, time_range=None, amplitudes=None, frequencies=None, is_damped=None, fit_threshold=None, n_shots=None, shot_interval=None, plot=None, store_params=None, simultaneous=None, **deprecated_options)

Obtain Rabi parameters for target qubits.

obtain_reference_points(targets=None, *, n_shots=None, shot_interval=None, store_reference_points=None, **deprecated_options)

Obtain the reference points for the given targets.

Parameters:

Name Type Description Default
targets Collection[str] | str | None

Targets to obtain reference points for. Defaults to None (all targets).

None
n_shots int

Number of shots.

None
shot_interval float

Interval between shots in ns.

None
store_reference_points bool

Whether to store the reference points. Defaults to True.

None

Returns:

Type Description
dict

Dictionary containing the reference points for each target.

Examples:

>>> ref_points = ex.obtain_reference_points(targets=["Q00", "Q01"])

optimize_drag_x90(qubit, *, duration=None, sigma0=None, seed=None, ftarget=None, timeout=None)

Optimize a DRAG X90 pulse for a target qubit.

optimize_pulse(qubit, *, pulse, x90, target_state, sigma0=None, seed=None, ftarget=None, timeout=None)

Optimize a pulse to reach a target state.

Parameters:

Name Type Description Default
qubit str

Target qubit label.

required
pulse Waveform

Initial pulse to optimize.

required
target_state tuple[float, float, float]

Target Bloch vector.

required

optimize_x90(qubit, *, sigma0=None, seed=None, ftarget=None, timeout=None)

Optimize an X90 pulse for a target qubit.

optimize_zx90(control_qubit, target_qubit, *, objective_type=None, optimize_method=None, update_cr_param=None, opt_params=None, seed=None, ftarget=None, timeout=None, maxiter=None, n_cliffords=None, n_trials=None, duration=None, ramptime=None, x180=None, x180_margin=None, n_shots=None, shot_interval=None)

Optimize ZX90 gate parameters for a qubit pair.

Parameters:

Name Type Description Default
control_qubit str

Control qubit label.

required
target_qubit str

Target qubit label.

required
objective_type str | None

Optimization objective identifier.

None

parity_oscillation(*args, **kwargs)

Warn that parity_oscillation moved to contrib and stop execution.

partial_transpose(*args, **kwargs)

Warn that partial_transpose moved to contrib and stop execution.

print_boxes()

Print connected box information as a table.

print_environment(verbose=None)

Print runtime and configuration environment information.

pulse_tomography(sequence, *, x90=None, initial_state=None, n_samples=None, n_shots=None, shot_interval=None, method=None, plot=None, **deprecated_options)

Conducts a pulse tomography experiment.

Parameters:

Name Type Description Default
sequence TargetMap[IQArray] | TargetMap[Waveform] | PulseSchedule

Waveforms to measure for each target.

required
x90 TargetMap[Waveform]

π/2 pulse.

None
initial_state TargetMap[str]

Initial state of each target.

None
n_samples int

Number of samples. Defaults to 100.

None
n_shots int

Number of shots. Defaults to DEFAULT_SHOTS.

None
shot_interval float

Interval between shots in ns. Defaults to DEFAULT_INTERVAL.

None
method Literal['measure', 'execute']

Measurement method. Defaults to "measure".

None
plot bool

Whether to plot the measured signals. Defaults to True.

None

Returns:

Type Description
Result

Results of the experiment.

purity_benchmarking(targets, *, n_cliffords_range=None, n_trials=None, seeds=None, max_n_cliffords=None, x90=None, zx90=None, in_parallel=None, xaxis_type=None, n_shots=None, shot_interval=None, plot=None, save_image=None)

Warn that purity benchmarking moved to contrib and stop execution.

qubit_spectroscopy(target, frequency_range=None, power_range=None, readout_amplitude=None, readout_frequency=None, n_shots=None, shot_interval=None, plot=None, save_image=None)

Run qubit spectroscopy over frequency and power.

rabi_experiment(*, amplitudes, time_range=None, ramptime=None, frequencies=None, detuning=None, is_damped=None, fit_threshold=None, n_shots=None, shot_interval=None, plot=None, store_params=None, **deprecated_options)

Run a Rabi experiment for the specified amplitudes.

ramsey_experiment(targets=None, *, time_range=None, detuning=None, second_rotation_axis=None, spectator_state=None, n_shots=None, shot_interval=None, plot=None, save_image=None)

Run a Ramsey experiment for targets.

randomized_benchmarking(targets, *, n_cliffords_range=None, n_trials=None, seeds=None, max_n_cliffords=None, x90=None, zx90=None, in_parallel=None, xaxis_type=None, n_shots=None, shot_interval=None, plot=None, save_image=None)

Run randomized benchmarking for the specified targets.

rb_sequence(target, *, n, x90=None, zx90=None, interleaved_waveform=None, interleaved_clifford=None, seed=None)

Build a randomized benchmarking sequence.

readout(target, /, *, duration=None, amplitude=None, ramptime=None, type=None, drag_coeff=None, pre_margin=None, post_margin=None)

Build a readout pulse for the target.

register_custom_target(*, label, frequency, box_id, port_number, channel_number, qubit_label=None, target_type=None, update_lsi=None)

Register a custom target with the control system.

reload()

Reload measurement configuration from the backend.

repeat_sequence(sequence, *, repetitions=None, n_shots=None, shot_interval=None, plot=None, **deprecated_options)

Repeats the pulse sequence n times.

Parameters:

Name Type Description Default
sequence TargetMap[Waveform] | PulseSchedule

Pulse sequence to repeat.

required
repetitions int

Number of repetitions. Defaults to 20.

None
n_shots int

Number of shots.

None
shot_interval float

Interval between shots in ns.

None
plot bool

Whether to plot the measured signals. Defaults to True.

None

Returns:

Type Description
ExperimentResult[SweepData]

Result of the experiment.

Examples:

>>> result = ex.repeat_sequence(
...     sequence={"Q00": Rect(duration=64, amplitude=0.1)},
...     repetitions=4,
... )

reset_awg_and_capunits(box_ids=None, qubits=None)

Reset AWG and capture units for specified boxes or qubits.

resonator_spectroscopy(target=None, *, frequency_range=None, power_range=None, electrical_delay=None, n_shots=None, shot_interval=None, plot=None, save_image=None)

Run resonator spectroscopy for a target.

resync_clocks(box_ids=None)

Resynchronize clocks for the specified boxes.

run(task)

Run an experiment task.

Parameters:

Name Type Description Default
task ExperimentTask[T]

Experiment task to run.

required

Returns:

Type Description
T

Experiment result.

run_measurement(schedule, *, n_shots=None, shot_interval=None, shot_averaging=None, time_integration=None, state_classification=None, frequencies=None, readout_amplitudes=None, readout_duration=None, readout_pre_margin=None, readout_post_margin=None, readout_ramp_time=None, readout_ramp_type=None, readout_drag_coeff=None, readout_amplification=None, final_measurement=None) async

Run one async measurement from a pulse or measurement schedule.

Parameters:

Name Type Description Default
schedule PulseSchedule | MeasurementSchedule

Input schedule. If MeasurementSchedule is provided, it is used as-is.

required
n_shots int | None

Number of shots.

None
shot_interval TimeLike | None

Interval between shots. Time-like values are converted to ns.

None
shot_averaging bool | None

Whether shot averaging is applied in hardware.

None
time_integration bool | None

Whether to integrate captured waveforms over time.

None
state_classification bool | None

Whether to enable state classification.

None
frequencies dict[str, FrequencyLike] | None

Temporary frequency overrides keyed by target label. Frequency-like values are converted to GHz.

None
readout_amplitudes dict[str, float] | None

Readout amplitudes keyed by readout or qubit label.

None
readout_duration TimeLike | None

Readout duration. Time-like values are converted to ns.

None
readout_pre_margin TimeLike | None

Pre-margin inserted before readout. Time-like values are converted to ns.

None
readout_post_margin TimeLike | None

Post-margin inserted after readout. Time-like values are converted to ns.

None
readout_ramp_time TimeLike | None

Readout ramp time. Time-like values are converted to ns.

None
readout_ramp_type RampType | None

Ramp waveform type.

None
readout_drag_coeff float | None

DRAG coefficient for readout pulse shaping.

None
readout_amplification bool | None

Whether to insert pump/readout amplification pulses.

None
final_measurement bool | None

Whether to append final readout pulses at schedule tail.

None

Returns:

Type Description
MeasurementResult

Single-run measurement result.

Examples:

>>> result = await ex.run_measurement(ps)

run_ndsweep_measurement(schedule, *, sweep_points, sweep_axes=None, n_shots=None, shot_interval=None, shot_averaging=None, time_integration=None, state_classification=None, frequencies=None, readout_amplitudes=None, readout_duration=None, readout_pre_margin=None, readout_post_margin=None, readout_ramp_time=None, readout_ramp_type=None, readout_drag_coeff=None, readout_amplification=None, final_measurement=None, plot=None, enable_tqdm=None) async

Run an async N-dimensional Cartesian sweep measurement.

Parameters:

Name Type Description Default
schedule Callable[[SweepPoint], PulseSchedule | MeasurementSchedule]

Callback that builds one schedule per resolved sweep point.

required
sweep_points Mapping[str, Sequence[SweepValue]]

Axis-value table (axis -> ordered values).

required
sweep_axes SweepAxes | None

Axis order for Cartesian expansion. Non-dict mapping inputs must provide this explicitly.

None
n_shots int | None

Number of shots.

None
shot_interval TimeLike | None

Interval between shots. Time-like values are converted to ns.

None
shot_averaging bool | None

Whether shot averaging is applied in hardware.

None
time_integration bool | None

Whether to integrate captured waveforms over time.

None
state_classification bool | None

Whether to enable state classification.

None
frequencies dict[str, FrequencyLike] | None

Temporary frequency overrides keyed by target label. Frequency-like values are converted to GHz.

None
readout_amplitudes dict[str, float] | None

Readout amplitudes keyed by readout or qubit label.

None
readout_duration TimeLike | None

Readout duration. Time-like values are converted to ns.

None
readout_pre_margin TimeLike | None

Pre-margin inserted before readout. Time-like values are converted to ns.

None
readout_post_margin TimeLike | None

Post-margin inserted after readout. Time-like values are converted to ns.

None
readout_ramp_time TimeLike | None

Readout ramp time. Time-like values are converted to ns.

None
readout_ramp_type RampType | None

Ramp waveform type.

None
readout_drag_coeff float | None

DRAG coefficient for readout pulse shaping.

None
readout_amplification bool | None

Whether to insert pump/readout amplification pulses.

None
final_measurement bool | None

Whether to append final readout pulses at schedule tail.

None
plot bool | None

Reserved plotting flag for ND sweeps.

None
enable_tqdm bool | None

Whether to show a tqdm progress bar during the sweep.

None

Returns:

Type Description
NDSweepMeasurementResult

N-dimensional sweep result in C-order flattening. result.data[target][capture] has shape (*result.shape, *capture_shape), where capture_shape follows the canonical CaptureData payload contract.

Examples:

>>> nd = await ex.run_ndsweep_measurement(
...     schedule=make_nd_schedule,
...     sweep_points={"x": [0, 1], "y": [10, 20]},
...     sweep_axes=("x", "y"),
... )

run_sweep_measurement(schedule, *, sweep_values, n_shots=None, shot_interval=None, shot_averaging=None, time_integration=None, state_classification=None, frequencies=None, readout_amplitudes=None, readout_duration=None, readout_pre_margin=None, readout_post_margin=None, readout_ramp_time=None, readout_ramp_type=None, readout_drag_coeff=None, readout_amplification=None, final_measurement=None, plot=None, enable_tqdm=None) async

Run an async 1D sweep measurement over explicit sweep values.

Parameters:

Name Type Description Default
schedule Callable[[Any], PulseSchedule | MeasurementSchedule]

Callback that builds one schedule per sweep value.

required
sweep_values ArrayLike | Sequence[SweepValue]

Ordered sweep values.

required
n_shots int | None

Number of shots.

None
shot_interval TimeLike | None

Interval between shots. Time-like values are converted to ns.

None
shot_averaging bool | None

Whether shot averaging is applied in hardware.

None
time_integration bool | None

Whether to integrate captured waveforms over time.

None
state_classification bool | None

Whether to enable state classification.

None
frequencies dict[str, FrequencyLike] | None

Temporary frequency overrides keyed by target label. Frequency-like values are converted to GHz.

None
readout_amplitudes dict[str, float] | None

Readout amplitudes keyed by readout or qubit label.

None
readout_duration TimeLike | None

Readout duration. Time-like values are converted to ns.

None
readout_pre_margin TimeLike | None

Pre-margin inserted before readout. Time-like values are converted to ns.

None
readout_post_margin TimeLike | None

Post-margin inserted after readout. Time-like values are converted to ns.

None
readout_ramp_time TimeLike | None

Readout ramp time. Time-like values are converted to ns.

None
readout_ramp_type RampType | None

Ramp waveform type.

None
readout_drag_coeff float | None

DRAG coefficient for readout pulse shaping.

None
readout_amplification bool | None

Whether to insert pump/readout amplification pulses.

None
final_measurement bool | None

Whether to append final readout pulses at schedule tail.

None
plot bool | None

Whether to plot IQ trajectories over sweep points.

None
enable_tqdm bool | None

Whether to show a tqdm progress bar during the sweep.

None

Returns:

Type Description
SweepMeasurementResult

Sweep result aligned with input sweep_values order. result.data[target][capture] has shape (len(sweep_values), *capture_shape), where capture_shape follows the canonical CaptureData payload contract.

Examples:

>>> def make_schedule(value):
...     return ps
>>> sweep = await ex.run_sweep_measurement(
...     schedule=make_schedule,
...     sweep_values=[0.1, 0.2],
... )

rzx(control_qubit, target_qubit, angle, *, cr_duration=None, cr_ramptime=None, cr_amplitude=None, cr_phase=None, cr_beta=None, cancel_amplitude=None, cancel_phase=None, cancel_beta=None, rotary_amplitude=None, echo=None, x180=None, x180_margin=None)

Warn that RZX pulse API moved to contrib and stop execution.

rzx_gate_property(control_qubit, target_qubit, *, angle_arr=None, measurement_times=None)

Warn that RZX gate property API moved to contrib and stop execution.

save_calib_note(file_path=None)

Save the calibration note to disk.

save_defaults()

Save default calibration notes (deprecated).

save_property(property_name, data, *, save_path=None)

Save a property dictionary by name.

scan_qubit_frequencies(target, *, frequency_range=None, control_amplitude=None, readout_amplitude=None, readout_frequency=None, subrange_width=None, peak_height=None, peak_distance=None, n_shots=None, shot_interval=None, plot=None, save_image=None)

Scan qubit frequencies to locate resonances.

scan_resonator_frequencies(target=None, *, frequency_range=None, readout_amplitude=None, electrical_delay=None, subrange_width=None, peak_height=None, peak_distance=None, n_shots=None, shot_interval=None, plot=None, save_image=None)

Scan resonator frequencies to find peaks.

state_evolution_tomography(*, sequences, x90=None, initial_state=None, n_shots=None, shot_interval=None, plot=None, **deprecated_options)

Conducts a state evolution tomography experiment.

Parameters:

Name Type Description Default
sequences Sequence[TargetMap[IQArray]] | Sequence[TargetMap[Waveform]] | Sequence[PulseSchedule]

Sequences to measure for each target.

required
x90 TargetMap[Waveform]

π/2 pulse.

None
initial_state TargetMap[str]

Initial state of each target.

None
n_shots int

Number of shots. Defaults to DEFAULT_SHOTS.

None
shot_interval float

Interval between shots in ns. Defaults to DEFAULT_INTERVAL.

None
plot bool

Whether to plot the measured signals. Defaults to False.

None

Returns:

Type Description
Result

Results of the experiment.

state_tomography(sequence, *, x90=None, initial_state=None, n_shots=None, shot_interval=None, reset_awg_and_capunits=None, method=None, use_zvalues=None, plot=None, **deprecated_options)

Conducts a state tomography experiment.

Parameters:

Name Type Description Default
sequence TargetMap[IQArray] | TargetMap[Waveform] | PulseSchedule

Sequence to measure for each target.

required
x90 TargetMap[Waveform]

π/2 pulse.

None
initial_state TargetMap[str]

Initial state of each target.

None
n_shots int

Number of shots. Defaults to DEFAULT_SHOTS.

None
shot_interval float

Interval between shots in ns. Defaults to DEFAULT_INTERVAL.

None
reset_awg_and_capunits bool

Whether to reset the AWG and capture units before the experiment. Defaults to True.

None
method Literal['measure', 'execute']

Measurement method. Defaults to "measure".

None
use_zvalues bool

Whether to use Z-values. Defaults to False.

None
plot bool

Whether to plot the measured signals. Defaults to False.

None

Returns:

Type Description
Result

Results of the experiment.

store_rabi_params(rabi_params, r2_threshold=None)

Store Rabi parameters meeting the quality threshold.

sweep_parameter(sequence, *, sweep_range, repetitions=None, frequencies=None, initial_states=None, rabi_level=None, n_shots=None, shot_interval=None, readout_amplitudes=None, readout_duration=None, readout_pre_margin=None, readout_post_margin=None, plot=None, enable_tqdm=None, title=None, xlabel=None, ylabel=None, xaxis_type=None, yaxis_type=None, **deprecated_options)

Sweeps a parameter and measures the signals.

Parameters:

Name Type Description Default
sequence ParametricPulseSchedule | ParametricWaveformMap

Parametric sequence to sweep.

required
sweep_range ArrayLike

Range of the parameter to sweep.

required
repetitions int

Number of repetitions. Defaults to 1.

None
frequencies dict[str, float]

Frequencies of the qubits.

None
initial_states dict[str, str]

Initial states of the qubits.

None
rabi_level Literal['ge', 'ef']

Rabi level to use. Defaults to "ge".

None
n_shots int

Number of shots.

None
shot_interval float

Interval between shots in ns.

None
readout_amplitudes dict[str, float]

Readout amplitude for each target.

None
readout_duration float

Readout duration in ns.

None
readout_pre_margin float

Readout pre-margin in ns.

None
readout_post_margin float

Readout post-margin in ns.

None
plot bool

Whether to plot the measured signals. Defaults to True.

None
enable_tqdm bool

Whether to show a progress bar. Defaults to False.

None
title str

Title of the plot. Defaults to "Sweep result".

None
xlabel str

Label of the x-axis. Defaults to "Sweep value".

None
ylabel str

Label of the y-axis. Defaults to "Measured value".

None
xaxis_type Literal['linear', 'log']

Type of the x-axis. Defaults to "linear".

None
yaxis_type Literal['linear', 'log']

Type of the y-axis. Defaults to "linear".

None

Returns:

Type Description
ExperimentResult[SweepData]

Result of the experiment.

Examples:

>>> result = ex.sweep_parameter(
...     sequence=lambda x: {"Q00": Rect(duration=30, amplitude=x)},
...     sweep_range=np.arange(0, 101, 4),
...     repetitions=4,
...     n_shots=1024,
...     plot=True,
... )

sweep_readout_amplitude(targets=None, *, amplitude_range=None, initial_state=None, readout_duration=None, n_shots=None, shot_interval=None, plot=None)

Sweep readout amplitudes for targets.

sweep_readout_duration(targets=None, *, time_range=None, initial_state=None, readout_amplitudes=None, n_shots=None, shot_interval=None, plot=None)

Sweep readout durations for targets.

t1_experiment(targets=None, *, time_range=None, n_shots=None, shot_interval=None, plot=None, save_image=None, xaxis_type=None)

Run a T1 experiment for targets.

t2_experiment(targets=None, *, time_range=None, n_cpmg=None, pi_cpmg=None, n_shots=None, shot_interval=None, plot=None, save_image=None, xaxis_type=None)

Run a T2 echo experiment for targets.

update_cr_params(*, control_qubit, target_qubit, time_range=None, ramptime=None, cr_amplitude=None, cr_phase=None, cancel_amplitude=None, cancel_phase=None, update_cr_phase=None, update_cancel_pulse=None, x90=None, x180_margin=None, n_shots=None, shot_interval=None, reset_awg_and_capunits=None, plot=None)

Update CR calibration parameters for a qubit pair.

validate_rabi_params(targets=None)

Validate stored Rabi parameters for targets.

visualize_graph(*args, **kwargs)

Warn that visualize_graph moved to contrib and stop execution.

x180(target, /, *, valid_days=None)

Return an X180 pulse for the target.

x90(target, /, *, valid_days=None)

Return an X90 pulse for the target.

x90m(target, /, *, valid_days=None)

Return a negative X90 pulse for the target.

y180(target, /, *, valid_days=None)

Return a Y180 pulse for the target.

y90(target, /, *, valid_days=None)

Return a Y90 pulse for the target.

y90m(target, /, *, valid_days=None)

Return a negative Y90 pulse for the target.

z180()

Return a virtual Z180 rotation.

z90()

Return a virtual Z90 rotation.

zx90(control_qubit, target_qubit, *, cr_duration=None, cr_ramptime=None, cr_amplitude=None, cr_phase=None, cr_beta=None, cancel_amplitude=None, cancel_phase=None, cancel_beta=None, rotary_amplitude=None, echo=None, x180=None, x180_margin=None)

Return a ZX90 pulse schedule for a qubit pair.

Measurement

Measurement-centric facade for hardware-backed session and execution flows.

Measurement is the measurement-side foundation that Experiment delegates to for session lifecycle and measurement execution. Choose it when sessions, schedules, capture/readout, sweeps, and backend-facing concepts should be the main abstraction, not because it is a strictly more capable alternative to Experiment.

Concrete responsibilities are delegated to focused collaborators: context access (MeasurementContext), configuration/backend lifecycle (MeasurementSessionService), schedule assembly (MeasurementScheduleBuilder and MeasurementPulseFactory), execution orchestration (MeasurementExecutionService), classifier state (MeasurementClassificationService), and temporary DC operations (MeasurementAmplificationService).

amplification_service property

Return the readout amplification service.

awg_frequencies property

Return AWG frequencies indexed by target label.

backend_controller property

Return the active backend controller.

box_ids property

Return backend box identifiers for the active session.

chip_id property

Return the active chip identifier.

classification_service property

Return the classification service.

classifiers property

Return currently registered state classifiers.

config_loader property

Return the configuration loader.

constraint_profile property

Return backend timing and alignment constraints.

context property

Return the measurement context.

control_params property

Return active control parameters.

execution_service property

Return the measurement execution service.

experiment_system property

Return the active experiment system.

measurement_config_factory property

Return a measurement-config factory bound to current defaults.

measurement_schedule_runner property

Return the schedule-execution runner.

mux_dict property

Return MUX objects indexed by qubit label.

nco_frequencies property

Return NCO frequencies indexed by target label.

pulse_factory property

Return a pulse factory bound to current system state.

qubit_labels property

Return the configured qubit labels.

qubits property

Return the configured qubit labels.

sampling_period property

Return sampling period in ns.

schedule_builder property

Return a schedule builder bound to current system state.

session_service property

Return the session lifecycle service.

system_manager property

Return the shared system manager.

targets property

Return available targets indexed by label.

__init__(*, chip_id=None, system_id=None, qubits, config_dir=None, params_dir=None, load_configs=None, connect_devices=None, configuration_mode=None, backend_kind=None, _execution_mode=None, _clock_health_checks=None)

Initialize a measurement facade with optional session bootstrap.

Parameters:

Name Type Description Default
chip_id str | None

Deprecated chip identifier compatibility input.

None
system_id str | None

Canonical system identifier used to resolve configuration resources.

None
qubits Collection[str]

Qubit labels managed by this measurement instance.

required
config_dir Path | str | None

Base directory that contains system configuration files.

None
params_dir Path | str | None

Base directory that contains control parameter files.

None
load_configs bool | None

Whether to call load during initialization. If None, DEFAULT_LOAD_CONFIGS is used.

None
connect_devices bool | None

Whether to call connect during initialization. If None, DEFAULT_CONNECT_DEVICES is used.

None
configuration_mode ConfigurationMode | None

Priority-ordered control layout passed to load. "ge-ef-cr" assigns channels to GE, then EF, then CR. "ge-cr-cr" assigns GE, then two CR channels. Ports with fewer channels keep the leftmost roles. If None, DEFAULT_CONFIGURATION_MODE is used.

None
backend_kind BackendKind | None

Backend family to initialize through configuration loading.

None
_execution_mode ExecutionMode | None

Internal execution mode override forwarded to the execution service.

None
_clock_health_checks bool | None

Internal flag for backend clock-health checks in parallel execution.

None

Examples:

>>> from qubex.measurement import Measurement
>>> session = Measurement(
...     chip_id="64Q",
...     qubits=["Q00", "Q01"],
... )

apply_dc_voltages(targets)

Temporarily apply DC voltages to selected targets.

Parameters:

Name Type Description Default
targets str | Collection[str]

Target label or target labels for temporary DC bias application.

required

Yields:

Type Description
None

Context where DC voltages are applied.

Notes

DC voltages are removed automatically when exiting the context manager.

Examples:

>>> # `session` is an initialized `Measurement` instance.
>>> with session.apply_dc_voltages(["Q00", "Q01"]):
...     _ = session.measure(
...         {
...             "Q00": [0.1 + 0.2j, 0.2 + 0.3j, 0.3 + 0.4j],
...             "Q01": [0.2 + 0.3j, 0.3 + 0.4j, 0.4 + 0.5j],
...         }
...     )

build_measurement_schedule(pulse_schedule, *, frequencies=None, readout_amplitudes=None, readout_duration=None, readout_pre_margin=None, readout_post_margin=None, readout_ramp_time=None, readout_ramp_type=None, readout_drag_coeff=None, readout_amplification=None, final_measurement=None, capture_placement=None, capture_targets=None, plot=None)

Build a measurement schedule from a pulse schedule and readout options.

Parameters:

Name Type Description Default
pulse_schedule PulseSchedule

Pulse schedule to augment with readout instructions.

required
frequencies dict[str, float] | None

Channel-frequency overrides keyed by schedule label.

None
readout_amplitudes dict[str, float] | None

Readout amplitude overrides keyed by target label.

None
readout_duration float | None

Readout capture duration in ns.

None
readout_pre_margin float | None

Margin inserted before readout in ns.

None
readout_post_margin float | None

Margin inserted after readout in ns.

None
readout_ramp_time float | None

Readout ramp duration in ns.

None
readout_ramp_type RampType | None

Ramp shape type.

None
readout_drag_coeff float | None

Drag coefficient for ramp shaping.

None
readout_amplification bool | None

Whether to insert readout amplification pulses.

None
final_measurement bool | None

Whether to append a final measurement at schedule tail.

None
capture_placement CapturePlacement | None

Capture-window placement (pulse_aligned or entire_schedule).

None
capture_targets list[str] | None

Explicit capture-channel labels for entire_schedule placement.

None
plot bool | None

Whether to plot the generated schedule.

None

Returns:

Type Description
MeasurementSchedule

Built measurement schedule ready for execution.

Examples:

>>> # `session` is an initialized `Measurement` instance.
>>> schedule = session.build_measurement_schedule(pulse_schedule)

capture_loopback(schedule, *, n_shots=None)

Capture full-span loopback data from read-in and monitor channels.

Parameters:

Name Type Description Default
schedule PulseSchedule | TargetMap[IQArray]

Pulse schedule or waveform mapping to execute.

required
n_shots int | None

Number of shots.

None

Returns:

Type Description
MeasurementResult

Measurement result for loopback capture windows.

check_clock_status(box_list)

Return clock status for the specified backend boxes.

Parameters:

Name Type Description Default
box_list list[str]

Backend box identifiers.

required

Returns:

Type Description
dict

Backend-specific clock status payload keyed by box identifier.

Examples:

>>> # `session` is an initialized `Measurement` instance.
>>> session.check_clock_status(["Q73A", "U10B"])

Return link status for the specified backend boxes.

Parameters:

Name Type Description Default
box_list list[str]

Backend box identifiers.

required
parallel bool | None

Whether to query each box in parallel where supported. If None, the session-level default is used.

None

Returns:

Type Description
dict

Backend-specific link status payload keyed by box identifier.

Examples:

>>> # `session` is an initialized `Measurement` instance.
>>> session.check_link_status(["Q73A", "U10B"])

connect(*, sync_clocks=None, parallel=None)

Connect backend resources for the active session.

Parameters:

Name Type Description Default
sync_clocks bool | None

Whether to synchronize hardware clocks before measurement.

None
parallel bool | None

Whether backend setup steps should run in parallel where supported.

None
Notes

This method performs hardware-side connection and may take noticeable time depending on backend state.

create_measurement_config(*, n_shots=None, shot_interval=None, shot_averaging=None, time_integration=None, state_classification=None)

Create a measurement config from optional runtime overrides.

Parameters:

Name Type Description Default
n_shots int | None

Number of shots.

None
shot_interval float | None

Interval between shots in ns.

None
shot_averaging bool | None

Whether to average shots on hardware.

None
time_integration bool | None

Whether to integrate captured waveforms over time.

None
state_classification bool | None

Whether to enable state classification.

None

Returns:

Type Description
MeasurementConfig

Measurement configuration with merged defaults and overrides.

Examples:

>>> # `session` is an initialized `Measurement` instance.
>>> config = session.create_measurement_config(
...     n_shots=1024,
...     shot_interval=2048.0,
... )

disconnect()

Disconnect backend resources held by the measurement session.

Notes

This method forwards directly to the session lifecycle service and resets runtime connectivity state.

execute(schedule, *, n_shots=None, shot_interval=None, shot_averaging=None, time_integration=None, state_classification=None, frequencies=None, readout_amplitudes=None, readout_duration=None, readout_pre_margin=None, readout_post_margin=None, readout_ramp_time=None, readout_drag_coeff=None, readout_ramp_type=None, readout_amplification=None, final_measurement=None, classification_line_param0=None, classification_line_param1=None, plot=None, **deprecated_options)

Execute measurement for a pulse schedule or waveform mapping.

Parameters:

Name Type Description Default
schedule PulseSchedule | TargetMap[IQArray]

Pulse schedule or waveform mapping to execute.

required
n_shots int | None

Number of shots.

None
shot_interval float | None

Interval between shots in ns.

None
shot_averaging bool | None

Whether shot averaging is applied in hardware.

None
time_integration bool | None

Whether to integrate captured waveforms over time.

None
state_classification bool | None

Whether to enable state classification.

None
frequencies dict[str, float] | None

Channel-frequency overrides keyed by schedule label.

None
readout_amplitudes dict[str, float] | None

Readout amplitude overrides keyed by target label.

None
readout_duration float | None

Readout capture duration in ns.

None
readout_pre_margin float | None

Margin inserted before readout in ns.

None
readout_post_margin float | None

Margin inserted after readout in ns.

None
readout_ramp_time float | None

Readout ramp duration in ns.

None
readout_drag_coeff float | None

Drag coefficient for ramp shaping.

None
readout_ramp_type RampType | None

Ramp shape type.

None
readout_amplification bool | None

Whether to apply readout amplification pulses.

None
final_measurement bool | None

Whether to append a final readout measurement.

None
classification_line_param0 tuple[float, float, float] | None

Optional QuEL-1 classification line parameter 0.

None
classification_line_param1 tuple[float, float, float] | None

Optional QuEL-1 classification line parameter 1.

None
plot bool | None

Whether to plot readout waveforms and/or results.

None
**deprecated_options Any

Deprecated option aliases kept for backward compatibility.

{}

Returns:

Type Description
MultipleMeasureResult

Measurement results for all captured readout windows.

Notes

Deprecated options are normalized by the execution service.

Examples:

>>> # `session` is an initialized `Measurement` instance.
>>> result = session.execute(
...     {
...         "Q00": [0.1 + 0.2j, 0.2 + 0.3j, 0.3 + 0.4j],
...         "Q01": [0.2 + 0.3j, 0.3 + 0.4j, 0.4 + 0.5j],
...     }
... )

get_awg_frequency(target)

Return the AWG frequency for one target.

Parameters:

Name Type Description Default
target str

Target label.

required

Returns:

Type Description
float

AWG frequency in Hz.

get_confusion_matrix(targets)

Return a combined confusion matrix for the given targets.

Parameters:

Name Type Description Default
targets Collection[str]

Target labels included in Kronecker-product order.

required

Returns:

Type Description
NDArray

Combined confusion matrix.

get_diff_frequency(target)

Return the intermediate (difference) frequency for one target.

Parameters:

Name Type Description Default
target str

Target label.

required

Returns:

Type Description
float

Difference frequency in Hz.

get_inverse_confusion_matrix(targets)

Return the inverse of the combined confusion matrix.

Parameters:

Name Type Description Default
targets Collection[str]

Target labels included in Kronecker-product order.

required

Returns:

Type Description
NDArray

Inverse combined confusion matrix.

is_connected()

Return whether backend resources are connected.

Returns:

Type Description
bool

True if connected, otherwise False.

linkup(box_list, noise_threshold=None)

Run link-up and clock synchronization for backend boxes.

Parameters:

Name Type Description Default
box_list list[str]

Backend box identifiers.

required
noise_threshold int | None

Optional threshold used by backend-specific link quality checks.

None

Examples:

>>> # `session` is an initialized `Measurement` instance.
>>> session.linkup(["Q73A", "U10B"])

load(config_dir, params_dir, configuration_mode=None, system_id=None, backend_kind=None)

Load configuration resources into the current session.

Parameters:

Name Type Description Default
config_dir Path | str | None

Directory that contains system configuration files.

required
params_dir Path | str | None

Directory that contains control parameter files.

required
configuration_mode ConfigurationMode | None

Priority-ordered control layout. "ge-ef-cr" assigns channels to GE, then EF, then CR. "ge-cr-cr" assigns GE, then two CR channels. Ports with fewer channels keep the leftmost roles. If None, backend defaults are used.

None
backend_kind BackendKind | None

Backend family used when creating the backend controller.

None
Notes

This method updates config_loader, experiment_system, and backend runtime dependencies.

measure(waveforms, *, n_shots=None, shot_interval=None, shot_averaging=None, time_integration=None, state_classification=None, frequencies=None, readout_amplitudes=None, readout_duration=None, readout_pre_margin=None, readout_post_margin=None, readout_ramp_time=None, readout_drag_coeff=None, readout_ramp_type=None, readout_amplification=None, classification_line_param0=None, classification_line_param1=None, plot=None, **deprecated_options)

Execute one measurement from target waveform mappings.

Parameters:

Name Type Description Default
waveforms Mapping[str, IQArray]

Control waveforms keyed by target label. Each waveform is a complex I/Q array sampled at sampling_period ns.

required
n_shots int | None

Number of shots.

None
shot_interval float | None

Interval between shots in ns.

None
shot_averaging bool | None

Whether shot averaging is applied in hardware.

None
time_integration bool | None

Whether to integrate captured waveforms over time.

None
state_classification bool | None

Whether to enable state classification.

None
frequencies dict[str, float] | None

Channel-frequency overrides keyed by schedule label.

None
readout_amplitudes dict[str, float] | None

Readout amplitude overrides keyed by target label.

None
readout_duration float | None

Readout capture duration in ns.

None
readout_pre_margin float | None

Margin inserted before readout in ns.

None
readout_post_margin float | None

Margin inserted after readout in ns.

None
readout_ramp_time float | None

Readout ramp duration in ns.

None
readout_drag_coeff float | None

Drag coefficient for ramp shaping.

None
readout_ramp_type RampType | None

Ramp shape type.

None
readout_amplification bool | None

Whether to apply readout amplification pulses.

None
classification_line_param0 tuple[float, float, float] | None

Optional QuEL-1 classification line parameter 0.

None
classification_line_param1 tuple[float, float, float] | None

Optional QuEL-1 classification line parameter 1.

None
plot bool | None

Whether to plot readout waveforms and/or results.

None
**deprecated_options Any

Deprecated option aliases kept for backward compatibility.

{}

Returns:

Type Description
MeasureResult

Single measurement result.

Notes

Deprecated options are normalized by the execution service.

Examples:

>>> # `session` is an initialized `Measurement` instance.
>>> result = session.measure(
...     {
...         "Q00": [0.1 + 0.2j, 0.2 + 0.3j, 0.3 + 0.4j],
...         "Q01": [0.2 + 0.3j, 0.3 + 0.4j, 0.4 + 0.5j],
...     }
... )

measure_noise(targets, *, duration) async

Measure readout noise with no control waveform drive.

Parameters:

Name Type Description Default
targets Collection[str]

Target labels to capture.

required
duration float

Capture duration in ns.

required

Returns:

Type Description
MeasurementResult

Noise measurement result.

Examples:

>>> # `session` is an initialized `Measurement` instance.
>>> result = await session.measure_noise(["Q00", "Q01"], duration=2048.0)

modified_frequencies(target_frequencies)

Temporarily override target frequencies within a context block.

Parameters:

Name Type Description Default
target_frequencies dict[str, float]

Frequency overrides in Hz keyed by target label.

required

Yields:

Type Description
None

Context where overridden frequencies are active.

Notes

Original frequencies are restored when exiting the context manager.

Examples:

>>> # `session` is an initialized `Measurement` instance.
>>> with session.modified_frequencies({"Q00": 5.0e9}):
...     _ = session.measure(
...         {
...             "Q00": [0.1 + 0.2j, 0.2 + 0.3j, 0.3 + 0.4j],
...             "Q01": [0.2 + 0.3j, 0.3 + 0.4j, 0.4 + 0.5j],
...         }
...     )

relinkup(box_list)

Re-run link-up for already configured backend boxes.

Parameters:

Name Type Description Default
box_list list[str]

Backend box identifiers.

required

Examples:

>>> # `session` is an initialized `Measurement` instance.
>>> session.relinkup(["Q73A", "U10B"])

reload(*, configuration_mode=None)

Reload configuration and reconnect backend resources.

Parameters:

Name Type Description Default
configuration_mode ConfigurationMode | None

Priority-ordered control layout passed to load. "ge-ef-cr" assigns channels to GE, then EF, then CR. "ge-cr-cr" assigns GE, then two CR channels. Ports with fewer channels keep the leftmost roles. If None, the previously configured value is reused by the loader/service.

None
Notes

This method calls load using the current loader paths and then reconnects hardware resources via connect.

run_measurement(schedule, *, config) async

Execute one prepared measurement schedule.

Parameters:

Name Type Description Default
schedule MeasurementSchedule

Measurement schedule that includes readout instructions.

required
config MeasurementConfig

Runtime acquisition configuration.

required

Returns:

Type Description
MeasurementResult

Serialized measurement result container.

run_ndsweep_measurement(schedule, *, config, sweep_points, sweep_axes=None) async

Execute an N-dimensional Cartesian-product sweep.

Parameters:

Name Type Description Default
schedule Callable[[SweepPoint], MeasurementSchedule]

Factory that builds one schedule from one expanded sweep point.

required
config MeasurementConfig

Runtime acquisition configuration.

required
sweep_points Mapping[SweepKey, Sequence[SweepValue]]

Sweep axes and candidate values for each axis.

required
sweep_axes SweepAxes | None

Axis order used for Cartesian expansion and index mapping. If None, insertion order from sweep_points is used. Non-dict mapping inputs must provide sweep_axes explicitly.

None

Returns:

Type Description
NDSweepMeasurementResult

N-dimensional sweep result stored as flattened point results with shape metadata. result.data[target][capture] has shape (*result.shape, *capture_shape), where capture_shape follows the canonical CaptureData payload contract.

run_sweep_measurement(schedule, *, config, sweep_values, on_point=None) async

Execute a pointwise sweep over explicit sweep values.

Parameters:

Name Type Description Default
schedule Callable[[SweepValue], MeasurementSchedule]

Factory that builds one schedule from one sweep value.

required
config MeasurementConfig

Runtime acquisition configuration.

required
sweep_values ArrayLike | Sequence[SweepValue]

Explicit sweep values evaluated in sequence.

required
on_point Callable[[SweepValue, MeasurementResult], None] | None

Callback invoked after each point measurement completes.

None

Returns:

Type Description
SweepMeasurementResult

Sweep result with one point result per sweep value. result.data[target][capture] has shape (len(sweep_values), *capture_shape), where capture_shape follows the canonical CaptureData payload contract.

update_classifiers(classifiers)

Replace registered state classifiers.

Parameters:

Name Type Description Default
classifiers TargetMap[StateClassifier]

Classifiers indexed by target label.

required

__getattr__(name)

Lazily load heavyweight top-level exports on first access.

set_log_level(level=logging.INFO)

Set the logging level for the qubex package and ensure a console handler is present.