Skip to content

laboneq_applications.contrib.analysis.bosonic_qubits.displacement_calibration

Analysis for the displacement calibration experiment.

For each displacement amplitude, the photon-number distribution is extracted from the number-split transmon spectrum and fitted to a Poisson distribution. A line fit of the amplitude vs. sqrt(n_bar) then gives displacement_amp_per_unit_beta.

DisplacementCalibrationAnalysisWorkflowOptions

Options for the displacement calibration analysis workflow.

Attributes:

Name Type Description
do_plotting bool

Whether to create plots. Default: True.

DisplacementCalibrationFitDataOptions

Options for the fit_data task of the displacement calibration analysis.

Attributes:

Name Type Description
max_photon_number int | None

Maximum photon number to consider for the distribution extraction and fitting. If None, it is the highest photon number whose peak lies within the swept frequency range; an error is raised if that gives more peaks than frequency points. Peaks without any swept frequency in their window are left out of the fit. Default: None.

peak_window_width float | None

Width of the frequency window (in Hz) around each expected peak position used for extracting peak heights. If None, it is set to 0.4 * |chi|.

PlotDisplacementMapOptions

Options for the plot_displacement_map task.

Attributes:

Name Type Description
plot_raw_data bool

If True, plot the raw complex data (real and imaginary). If False, plot the magnitude. Default: False.

save_figures

Whether to save the figures. Default: True.

close_figures

Whether to close the figures. Default: True.

PlotPhotonDistributionsOptions

Options for the plot_photon_distributions task.

Attributes:

Name Type Description
num_distributions_to_plot int

Number of evenly-spaced amplitude slices to show as individual photon number distributions. Default: 5.

save_figures

Whether to save the figures. Default: True.

close_figures

Whether to close the figures. Default: True.

analysis_workflow(result, qubits, amplitudes, frequencies, options=None)

The displacement calibration analysis workflow.

The workflow consists of the following steps:

Parameters:

Name Type Description Default
result RunExperimentResults

The experiment results returned by the run_experiment task.

required
qubits QuantumElements

The qubits on which to run the analysis. May be either a single qubit or a list of qubits. The UIDs of these qubits must exist in the result.

required
amplitudes QubitSweepPoints

The displacement amplitudes that were swept for each qubit.

required
frequencies QubitSweepPoints

The transmon drive frequencies that were swept for each qubit.

required
options DisplacementCalibrationAnalysisWorkflowOptions | None

The options for building the workflow, passed as an instance of DisplacementCalibrationAnalysisWorkflowOptions.

None

Returns:

Name Type Description
WorkflowBuilder None

The builder for the analysis workflow.

Example
analysis_result = analysis_workflow(
    result=result,
    qubits=q0,
    amplitudes=np.linspace(0.0, 1.0, 51),
    frequencies=np.linspace(4.9e9, 5.1e9, 101),
).run()

extract_qubit_parameters(qubits, processed_data_dict)

Extract displacement_amp_per_unit_beta from the fit results.

Parameters:

Name Type Description Default
qubits QuantumElements

The qubits on which to run the analysis.

required
processed_data_dict dict[str, dict]

The processed data dictionary returned by fit_data.

required

Returns:

Type Description
dict[str, dict[str, dict[str, float | None]]]

dict with the extracted qubit parameters and their previous values:

{
    "new_parameter_values": {
        q.uid: {"displacement_amp_per_unit_beta": value},
    },
    "old_parameter_values": {
        q.uid: {"displacement_amp_per_unit_beta": value},
    },
}

If the fit did not give a finite value for a qubit, its new_parameter_values entry is left empty.

fit_data(qubits, result, amplitudes, frequencies, options=None)

Extract and fit the photon number distributions.

Parameters:

Name Type Description Default
qubits QuantumElements

The qubits on which to run the analysis.

required
result RunExperimentResults

The experiment results returned by the run_experiment task.

required
amplitudes QubitSweepPoints

The displacement amplitudes that were swept for each qubit.

required
frequencies QubitSweepPoints

The transmon drive frequencies that were swept for each qubit.

required
options DisplacementCalibrationFitDataOptions | None

The options for this task as an instance of DisplacementCalibrationFitDataOptions.

None

Returns:

Type Description
dict[str, dict]

dict with qubit UIDs as keys and the per-qubit analysis results (raw data, photon number distributions, Poisson fits, mean photon numbers and displacement_amp_per_unit_beta) as values.

plot_displacement_map(qubits, processed_data_dict, options=None)

Plot the number-split transmon spectrum vs. displacement amplitude.

Parameters:

Name Type Description Default
qubits QuantumElements

The qubits on which to run the analysis.

required
processed_data_dict dict[str, dict]

The processed data dictionary returned by fit_data.

required
options PlotDisplacementMapOptions | None

The options for this task as an instance of PlotDisplacementMapOptions.

None

Returns:

Type Description
dict[str, Figure]

dict with qubit UIDs as keys and the figures for each qubit as values.

plot_mean_photon_number(qubits, processed_data_dict, options=None)

Plot the mean photon number vs. displacement amplitude.

Parameters:

Name Type Description Default
qubits QuantumElements

The qubits on which to run the analysis.

required
processed_data_dict dict[str, dict]

The processed data dictionary returned by fit_data.

required
options BasePlottingOptions | None

The options for this task as an instance of BasePlottingOptions.

None

Returns:

Type Description
dict[str, Figure]

dict with qubit UIDs as keys and the figures for each qubit as values.

plot_photon_distributions(qubits, processed_data_dict, options=None)

Plot the extracted photon number distributions with their Poisson fits.

Parameters:

Name Type Description Default
qubits QuantumElements

The qubits on which to run the analysis.

required
processed_data_dict dict[str, dict]

The processed data dictionary returned by fit_data.

required
options PlotPhotonDistributionsOptions | None

The options for this task as an instance of PlotPhotonDistributionsOptions.

None

Returns:

Type Description
dict[str, Figure]

dict with qubit UIDs as keys and the figures for each qubit as values.