Skip to content

laboneq_applications.contrib.analysis.time_rabi

This module defines the analysis for a time-rabi experiment.

The experiment is defined in laboneq_applications.experiments.

In this analysis, we first interpret the raw data into qubit populations using principle-component analysis or rotation and projection on the measured calibration states. Then we fit a cosine model to the qubit population and extract the pi pulse lengths from the fit. Finally, we plot the data and the fit.

analysis_workflow(result, qubits, lengths, options=None)

The Time Rabi 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 Qubits

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
lengths QubitSweepPoints

The lengths that were swept over in the time-rabi experiment for each qubit. If qubits is a single qubit, lengths must be a list of numbers or an array. Otherwise, it must be a list of lists of numbers or arrays.

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: - process_raw_data: The options for creating the experiment as an instance of TuneupAnalysisOptions. - fit_data: The options for performing a fit, passed as an instance of TuneupAnalysisOptions. - extract_qubit_parameters: The options for extracting qubit parameters from the fit, passed as an instance of TuneupAnalysisOptions. - plot_data: The options for plotting, passed as an instance of TuneupAnalysisOptions.

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],
    lengths=[
        np.linspace(10e-9, 100e-9, 11),
        np.linspace(10e-9, 100e-9, 11),
    ],
    options=options,
).run()

extract_qubit_parameters(qubits, processed_data_dict, fit_results, options=None)

Extract the qubit parameters from the fit results.

Parameters:

Name Type Description Default
qubits Qubits

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 and fit_results.

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

the processed data dictionary returned by process_raw_data

required
fit_results dict[str, ModelResult]

the fit-results dictionary returned by fit_data

required
options TuneupAnalysisOptions | None

The options for extracting the qubit parameters. See [TuneupAnalysisOptions], [TuneupExperimentOptions] and [BaseExperimentOptions] for accepted options. Overwrites the options from [TuneupAnalysisOptions], [TuneupExperimentOptions] and [BaseExperimentOptions].

None

Returns:

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

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

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

parameters. The dictionary has the following form:

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

```python

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

{ "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, int | float | Variable | None]]]

}

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

```

Raises: ValueError: If fit_results are empty (have length 0).

plot_population(qubits, processed_data_dict, fit_results, qubit_parameters, options=None)

Create the time-Rabi plots.

Parameters:

Name Type Description Default
qubits Qubits

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, fit_results and qubit_parameters.

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

the processed data dictionary returned by process_raw_data

required
fit_results dict[str, ModelResult] | None

the fit-results dictionary returned by fit_data

required
qubit_parameters dict[str, dict[str, dict[str, int | float | Variable | None]]] | None

the qubit-parameters dictionary returned by extract_qubit_parameters

required
options TuneupAnalysisOptions | None

The options for processing the raw data. See [TuneupAnalysisOptions], [TuneupExperimentOptions] and [BaseExperimentOptions] for accepted options. Overwrites the options from [TuneupAnalysisOptions], [TuneupExperimentOptions] and [BaseExperimentOptions].

None

Returns:

Type Description
dict[str, Figure]

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