Skip to content

laboneq_applications.experiments.amplitude_rabi

This module defines the amplitude-rabi experiment.

In this experiment, we sweep the amplitude of a drive pulse on a given qubit transition in order to determine the pulse amplitude that induces a rotation of pi.

The amplitude-rabi experiment has the following pulse sequence:

qb --- [ prep transition ] --- [ x180_transition ] --- [ measure ]

If multiple qubits are passed to the run workflow, the above pulses are applied in parallel on all the qubits.

create_experiment(qpu, qubits, amplitudes, options=None)

Creates an Amplitude Rabi experiment Workflow.

Parameters:

Name Type Description Default
qpu QPU

The qpu consisting of the original qubits and quantum operations.

required
qubits QuantumElements

The qubits to run the experiments on. May be either a single qubit or a list of qubits.

required
amplitudes QubitSweepPoints

The amplitudes to sweep over for each qubit. If qubits is a single qubit, amplitudes must be a list of numbers or an array. Otherwise it must be a list of lists of numbers or arrays.

required
options TuneupExperimentOptions | None

The options for building the experiment. See [TuneupExperimentOptions] and [BaseExperimentOptions] for accepted options. Overwrites the options from [TuneupExperimentOptions] and [BaseExperimentOptions].

None

Returns:

Name Type Description
experiment Experiment

The generated LabOne Q experiment instance to be compiled and executed.

Raises:

Type Description
ValueError

If the qubits and qubit_amplitudes are not of the same length.

ValueError

If qubit_amplitudes is not a list of numbers when a single qubit is passed.

ValueError

If qubit_amplitudes is not a list of lists of numbers.

ValueError

If the experiment uses calibration traces and the averaging mode is sequential.

Example
options = {
    "count": 10,
    "transition": "ge",
    "averaging_mode": "cyclic",
    "acquisition_type": "integration_trigger",
    "cal_traces": True,
}
options = TuneupExperimentOptions(**options)
qpu = QPU(
    quantum_elements=[TunableTransmonQubit("q0"), TunableTransmonQubit("q1")],
    quantum_operations=TunableTransmonOperations(),
)
temp_qubits = qpu.copy_quantum_elements()
create_experiment(
    qpu=qpu,
    qubits=temp_qubits,
    amplitudes=[
        np.linspace(0, 1, 11),
        np.linspace(0, 0.75, 11),
    ],
    options=options,
)

experiment_workflow(session, qpu, qubits, *, amplitudes, evaluation_parameter=None, evaluation_parameter_thresholds=None, evaluation_fit_r2_thresholds=None, temporary_parameters=None, options=None)

The Amplitude Rabi Workflow.

The workflow consists of the following steps:

Deprecated in version 26.1.0.

The qubits argument of type QuantumElements is deprecated. Please pass qubits of type list[str] | str instead, i.e., the quantum element UIDs instead of the quantum element instances.

Parameters:

Name Type Description Default
session Session

The connected session to use for running the experiment.

required
qpu QPU

The qpu consisting of the original qubits and quantum operations.

required
qubits QuantumElements | list[str] | str

The qubits to run the experiments on, passed by UID. May be either a single qubit or a list of qubits.

required
amplitudes QubitSweepPoints

The amplitudes to sweep over for each qubit. If qubits is a single qubit, amplitudes must be a list of numbers or an array. Otherwise it must be a list of lists of numbers or arrays.

required
evaluation_parameter str | None

The parameter to use for the evaluation task. The thresholds for this parameter are set in the parameter_thresholds below. If None, the default_parameter is used.

None
evaluation_parameter_thresholds float | Sequence[float | None] | None

Thresholds for the parameter difference for each experiment resource (qubits, pairs of qubits, etc.). This argument may be a single number or a list of numbers, corresponding to the qubit ordering. If None, the default_parameter_threshold is used.

None
evaluation_fit_r2_thresholds float | Sequence[float | None] | None

Threshold for the r2 value of the fit for each experiment resource (qubits, pairs of qubits, etc.). This argument may be a single number or a list of numbers, corresponding to the qubit ordering. If None, the default_fit_r2_threshold is used.

None
temporary_parameters dict[str | tuple[str, str, str], dict | QuantumParameters] | None

The temporary parameters with which to update the quantum elements and topology edges. For quantum elements, the dictionary key is the quantum element UID. For topology edges, the dictionary key is the edge tuple (tag, source node UID, target node UID).

None
options TuneUpWorkflowOptions | None

The options for building the workflow. In addition to options from [WorkflowOptions], the following custom options are supported: - create_experiment: The options for creating the experiment.

None

Returns:

Name Type Description
WorkflowBuilder None

The builder of the experiment workflow.

Example
options = TuneUpExperimentWorkflowOptions()
options.create_experiment.count = 10
options.create_experiment.transition = "ge"
qpu = QPU(
    quantum_elements=[TunableTransmonQubit("q0"), TunableTransmonQubit("q1")],
    quantum_operations=TunableTransmonOperations(),
)
temp_qubits = qpu.copy_quantum_elements()
result = experiment_workflow(
    session=session,
    qpu=qpu,
    qubits=temp_qubits,
    amplitudes=[
        np.linspace(0, 1, 11),
        np.linspace(0, 0.75, 11),
    ],
    options=options,
).run()