Skip to content

laboneq_applications.analysis.dispersive_shift

This module defines the analysis for a dispersive-shift experiment.

The experiment is defined in laboneq_applications.experiments. The goal of this analysis is to extract the optimal qubit readout frequency at which we obtain the largest distance in the IQ plane between the transmission signal of the readout resonator when preparing the qubit in different states.

In this analysis, we first calculate the differences between absolute value of the pair-wise differences between the complex transmission signals acquired for each preparation state of the transmon. Then we extract the optimal qubit readout frequency. Finally, we plot the acquired transmission signals for each state and the calculated differences.

DispersiveShiftAnalysisOptions

Base options for the analysis of a dispersive-shift experiment.

Attributes:

Name Type Description
save_figures bool

Whether to save the figures. Default: True.

close_figures bool

Whether to close the figures. Default: True.

close_figures: bool = workflow.option_field(True, description='Whether to close the figures.') class-attribute instance-attribute

save_figures: bool = workflow.option_field(True, description='Whether to save the figures.') class-attribute instance-attribute

DispersiveShiftAnalysisWorkflowOptions

Option class for a dispersive-shift analysis workflows.

Attributes:

Name Type Description
do_plotting bool

Whether to create the plots. Default: 'True'.

do_plotting_dispersive_shift bool

Whether to create the dispersive shift plot, i.e. signal magnitudes vs frequency for every state. Default: True.

do_plotting_signal_distances bool

Whether to create the plot for the pair-wise signal distances. Default: True.

do_plotting: bool = workflow.option_field(True, description='Whether to create the plots.') class-attribute instance-attribute

do_plotting_dispersive_shift: bool = workflow.option_field(True, description='Whether to create the dispersive shift plot.') class-attribute instance-attribute

do_plotting_signal_distances: bool = workflow.option_field(True, description='Whether to create the plot for the pair-wise signal distances.') class-attribute instance-attribute

analysis_workflow(result, qubit, frequencies, states, options=None)

The dispersive-shift 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
qubit QuantumElement

The qubit on which to run the analysis. The UID of this qubit must exist in the result.

required
frequencies ArrayLike

The resonator frequencies to sweep over for the readout pulse sent to the resonator. Must be a list of numbers or an array.

required
states Sequence[str]

The basis states the qubits should be prepared in. May be either a string, e.g. "gef", or a list of letters, e.g. ["g","e","f"].

required
options DispersiveShiftAnalysisWorkflowOptions | None

The options for building the workflow, passed as an instance of [DispersiveShiftAnalysisWorkflowOptions]. See the docstring of [DispersiveShiftAnalysisWorkflowOptions] for more details.

None

Returns:

Name Type Description
WorkflowBuilder None

The builder for the analysis workflow.

Example
options = analysis_workflow.options()
result = analysis_workflow(
    results=results
    qubit=q0,
    frequencies=np.linspace(7.0, 7.1, 101),
    states="gef",
    options=options,
).run()

calculate_signal_differences(qubit, result, frequencies, states)

Calculates the pair-wise differences between the signals acquired for each state.

Parameters:

Name Type Description Default
result RunExperimentResults

The experiment results returned by the run_experiment task.

required
qubit QuantumElement

The qubit on which to run the task. The UID of this qubit must exist in the result.

required
frequencies ArrayLike

The resonator frequencies to sweep over for the readout pulse (or CW) sent to the resonator. Must be a list of numbers or an array.

required
states Sequence[str]

The basis states the qubits should be prepared in. May be either a string, e.g. "gef", or a list of letters, e.g. ["g","e","f"].

required

Returns:

Type Description
dict[str, tuple[ArrayLike, ArrayLike, ArrayLike]]

dictionary with the magnitudes of the pair-wise differences between the signals

dict[str, tuple[ArrayLike, ArrayLike, ArrayLike]]

acquired for each state

Raises:

Type Description
TypeError

If the result is not an instance of RunExperimentResults.

extract_qubit_parameters(qubit, processed_data_dict)

Extract the optimal qubit readout resonator frequency.

Parameters:

Name Type Description Default
qubit QuantumElement

The qubit on which to run the task. The UID of this qubit must exist in processed_data_dict.

required
processed_data_dict dict[str, tuple[ArrayLike, ArrayLike, ArrayLike]]

the dictionary returned by calculate_signal_differences, containing the magnitudes of the pair-wise differences between the signals acquired for each state.

required

Returns:

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

dict with extracted qubit parameters and the previous values for those qubit

dict[str, dict[str, dict[str, float]]]

parameters. The dictionary has the following form:

dict[str, dict[str, dict[str, float]]]

```python

dict[str, dict[str, dict[str, float]]]

{ "new_parameter_values": { q.uid: { qb_param_name: qb_param_value }, } "old_parameter_values": { q.uid: { qb_param_name: qb_param_value }, }

dict[str, dict[str, dict[str, float]]]

}

dict[str, dict[str, dict[str, float]]]

```

plot_dispersive_shift(qubit, result, frequencies, states, options=None)

Plot the magnitude of the transmission signals for each preparation state.

Parameters:

Name Type Description Default
qubit QuantumElement

The qubit on which to run the task.

required
result RunExperimentResults

The experiment results returned by the run_experiment task.

required
frequencies ArrayLike

The resonator frequencies to sweep over for the readout pulse (or CW) sent to the resonator. Must be a list of numbers or an array.

required
states Sequence[str]

The basis states the qubits should be prepared in. May be either a string, e.g. "gef", or a list of letters, e.g. ["g","e","f"].

required
options DispersiveShiftAnalysisOptions | None

The options, passed as an instance of [DispersiveShiftAnalysisOptions]. See the docstring of this class for more details.

None

Returns:

Type Description
Figure | None

the matplotlib figure

Raises:

Type Description
TypeError

If the result is not an instance of RunExperimentResults.

plot_signal_distances(qubit, frequencies, processed_data_dict, options=None)

Plot the pair-wise differences between the signals acquired for each state.

Parameters:

Name Type Description Default
qubit QuantumElement

The qubit on which to run the rask. The UID of this qubit must exist in processed_data_dict.

required
frequencies ArrayLike

The resonator frequencies to sweep over for the readout pulse (or CW) sent to the resonator. Must be a list of numbers or an array.

required
processed_data_dict dict[str, ArrayLike]

the dictionary returned by calculate_signal_differences, containing the magnitudes of the pair-wise differences between the signals acquired for each state; returned by

required
options DispersiveShiftAnalysisOptions | None

The options, passed as an instance of [DispersiveShiftAnalysisOptions]. See the docstring of this class for more details.

None

Returns:

Type Description
Figure | None

the matplotlib figure