Skip to content

laboneq_applications.contrib.analysis.two_qubit.jazz

This module defines the analysis for a JAZZ sequence using a CZ gate.

The experiment is defined in laboneq_applications.contrib.experiments.

In this analysis, we first interpret the raw data into qubit population using principal-component analysis, or rotation and projection onto the measured calibration states. Finally, we plot the data and the fit.

analysis_workflow(result, qpu, qubit_pairs, durations, amplitudes, options=None)

The JAZZ 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
qpu QPU

The quantum processing unit.

required
qubit_pairs ArrayLike[ArrayLike[str, str]]

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 coupler or qubit amplitude values.

required
durations QubitSweepPoints

length of the pulse on the coupler or qubit.

required
options TuneUpAnalysisWorkflowOptions | None

The options for building the workflow, passed as an instance of TuneUpAnalysisWorkflowOptions. In addition to options from WorkflowOptions, the following custom options are supported: do_fitting, do_plotting, and the options of the TuneUpAnalysisWorkflowOptions class. See the docstring of TuneUpAnalysisWorkflowOptions for more details.

None

Returns:

Name Type Description
WorkflowBuilder None

The builder for the analysis workflow.

Example
options = TuneUpAnalysisWorkflowOptions()
result = analysis_workflow(
    results=results
    qubits=[q0, q1],
    amplitudes=[
        np.linspace(0, 1, 11),
        np.linspace(0, 0.75, 11),
    ],
    options=options,
).run()

extract_edge_parameters(edges, processed_data_dict, fit_results, options=None)

Extract the edge parameters from the fit results.

The pi-pulse amplitude fitted at the target duration becomes the new gate calibration. The duration goes into coupler_pulse, because the gate takes its length from there, and the amplitude into the pulse that drives the gate.

Parameters:

Name Type Description Default
edges list[TopologyEdge]

The array of topology edges.

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

The processed data dictionary.

required
fit_results dict[str, dict[float, ModelResult]]

The fit-results dictionary returned by fit_data.

required
options ExtractEdgeParametersOptions | None

The options for extracting the qubit parameters. See ExtractEdgeParametersOptions for accepted options.

None

Returns:

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

Dictionary with extracted tunable coupler parameters and the previous values for those tunable coupler parameters. The dictionary has the following form:

{
    "new_parameter_values": {
        c.uid: {
            tc_param_name: tc_param_value
        },
    }
    "old_parameter_values": {
        c.uid: {
            tc_param_name: tc_param_value
        },
    }
}

If the do_fitting option is False, the new_parameter_values are not extracted and the function only returns the old_parameter_values. If a qubit UID is not found in fit_results, the new_parameter_values entry for that qubit is left empty.

fit_data(qubit_pairs, processed_data_dict, options=None)

Fit a cosine oscillatory decay model to the qubit e-state population.

If this fit fails an exponential-decay model fit will be performed instead under the assumption that the residual zz coupling is near zero.

Parameters:

Name Type Description Default
qubit_pairs list[list[str]]

The (control, target) qubit-UID pairs on which to run the task. The control UIDs must exist in processed_data_dict. Note that the task takes the qubit-pair UIDs rather than the topology edges, so that its input remains serializable by the logbook stores.

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

The processed data dictionary containing the qubit population to be fitted and the sweep points of the experiment.

required
options FitData2QOptions | None

The options for building the workflow as an instance of FitData2QOptions. See the docstrings of this class for more details.

None

Returns:

Type Description
dict[str, ArrayLike[ModelResult]]

Dictionary with qubit UIDs as keys and the fit results for each qubit as values.

plot_fitted_frequencies(processed_data_dict, fit_results, frequency_scaling_factor=0.001, options=None)

Plot the fitted frequencies per duration of the pulse.

Parameters:

Name Type Description Default
processed_data_dict dict[str, dict[str, ArrayLike]]

The processed data dictionary.

required
fit_results dict[str, ArrayLike[ModelResult]]

The fit-results dictionary returned by fit_data.

required
frequency_scaling_factor float

The multiplication factor for better visualization in the plot.

0.001
options PlotPopulationOptions | None

The options for extracting the qubit parameters. See PlotPopulationOptions for accepted options.

None

plot_population(qubits, processed_data_dict, options=None)

Create the JAZZ population plots.

Parameters:

Name Type Description Default
qubits QuantumElements

The qubits on which to run the task. May be either a single qubit or a list of qubits. The UIDs of these qubits must exist in processed_data_dict, fit_results and qubit_parameters.

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

The processed data dictionary returned by process_raw_data.

required
options PlotPopulationOptions | None

The options class for this task as an instance of PlotPopulationOptions. See the docstring of this class for accepted options.

None

Returns:

Type Description
dict[str, Figure]

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

If a qubit UID is not found in fit_results, the fit and the textbox with the extracted qubit parameters are not plotted.