Skip to content

laboneq_applications.contrib.analysis.measurement_qndness

This module defines the analysis for a qubit measurement QND experiment.

The experiment is defined in laboneq_applications.contrib.experiments.

In this analysis, we determine the QND fidelity from two consecutive measurements by comparing the measurement outputs. This is plotted in a confusion matrix.

analysis_workflow(result, qubits, options=None)

The measurement qnd analysis workflow.

The workflow consists of the following steps: - collect_shots - calculate_assignment_matrices - calculate_assignment_fidelities - plot_assignment_matrices

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
options TuneUpAnalysisWorkflowOptions | None

The options for building the workflow, passed as an instance of [TuneUpAnalysisWorkflowOptions]. See the docstring of this class 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
    qubits=[q0, q1],
    options=options,
).run()

calculate_assignment_matrices(qubits, processed_data_dict)

Calculate the correct assignment matrices.

Parameters:

Name Type Description Default
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 processed_data_dict.

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

the processed data dictionary returned by collect_shots

required

Returns:

Type Description
dict[str, None]

dict with qubit UIDs as keys and the assignment matrix for each qubit as keys.

collect_shots(qubits, result)

Collect the single shots acquired for each preparation state.

Parameters:

Name Type Description Default
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 result.

required
result RunExperimentResults

The experiment results returned by the run_experiment task.

required

Returns:

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

dict with qubit UIDs as keys and values as a dict with the following keys: first_measurement - list of integers containing the first measurement outcomes. second_measurement - list of integers containing the second measurement outcomes.