Skip to content

laboneq_applications.contrib.analysis.two_qubit.chevron

This module defines the analysis for a CZ chevron experiment.

The experiment is defined in laboneq_applications.contrib.experiments.two_qubit.chevron.

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. We then locate the population extremum of the resulting two-dimensional map to obtain the flux-pulse duration and amplitude that implement the CZ gate, and plot the chevron pattern.

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

The CZ chevron 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 (duration, amplitude) point of maximum interaction found by fit_data becomes the starting point for the subsequent fine calibration of the CZ gate. 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[str, float]]

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[tuple[str, str, str], dict[str, int | float | None]]]

Dictionary with extracted edge parameters and the previous values for those edge parameters. The keys of the inner dictionaries are the edge keys (tag, source node UID, target node UID), as accepted by update_qpu. The dictionary has the following form:

{
    "new_parameter_values": {
        "tag:source_uid:target_uid": {
            edge_param_name: edge_param_value
        },
    }
    "old_parameter_values": {
        "tag:source_uid:target_uid": {
            edge_param_name: edge_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 an edge is not found in fit_results, the new_parameter_values entry for that edge is left empty.

fit_data(qubit_pairs, processed_data_dict, options=None)

Extract the point of maximum interaction from the chevron pattern.

Finds the (duration, amplitude) sweep point at which the target-qubit population is maximal.

Parameters:

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

The (source, target) qubit-UID pairs on which to run the task. The target 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 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, dict[str, float]]

Dictionary with edge signatures as keys and dictionaries with the "duration" and "amplitude" values of the maximum-population point as values.

plot_population(qubits, processed_data_dict, options=None)

Create the chevron 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.