laboneq_applications.contrib.experiments.time_rabi
¶
This module defines the time-rabi experiment.
In this experiment, we sweep the length of a drive pulse on a given qubit transition in order to determine the pulse length that induces a rotation of pi.
The time-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, lengths, options=None)
¶
Creates a length-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 |
lengths
|
QubitSweepPoints
|
The drive-pulse lengths to sweep over for each qubit. If |
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_lengths are not of the same length. |
ValueError
|
If qubit_lengths is not a list of numbers when a single qubit is passed. |
ValueError
|
If qubit_lengths is not a list of lists of numbers. |
Example
options = TuneupExperimentOptions()
options.count = 10
options.transition = "ge"
options.cal_traces = True
qpu = QPU(
qubits=[TunableTransmonQubit("q0"), TunableTransmonQubit("q1")],
quantum_operations=TunableTransmonOperations(),
)
temp_qubits = qpu.copy_qubits()
create_experiment(
qpu=qpu,
qubits=temp_qubits,
lengths=[
np.linspace(100e-9, 500e-9, 11),
np.linspace(100e-9, 500e-9, 11),
],
options=options,
)
evaluate_experiment(analysis_results, qubits, evaluation_parameters=None)
¶
Evaluates the time Rabi analysis workflow result.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
analysis_results
|
WorkflowResult
|
The analysis workflow results. |
required |
qubits
|
QuantumElements
|
The qubits to run the experiments on. |
required |
evaluation_parameters
|
dict[str, Any] | None
|
The evaluation parameters. |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, dict[str, bool]]
|
The evaluation flags. |
experiment_workflow(session, qpu, qubits, *, lengths, evaluation_parameters=None, temporary_parameters=None, options=None)
¶
The Time Rabi Workflow.
The workflow consists of the following steps:
- create_experiment
- compile_experiment
- run_experiment
- analysis_workflow
- evaluate_experiment
- update_qpu
Changed in version 26.4.0.
The evaluation_parameters argument has been added, which is the dictionary of
parameters used for the newly added evaluation task. All arguments apart from
session, qpu, and qubits are now keyword arguments.
Changed in version 26.1.0.
The temporary_parameters positional argument was added in the
penultimate position. Note that this is a breaking change if
calling the experiment workflow with the options positional argument.
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 |
lengths
|
QubitSweepPoints
|
The drive-pulse lengths to sweep over for each qubit. If |
required |
evaluation_parameters
|
dict[str, Any] | None
|
The dictionary of parameters used for the evaluation task. The default
evaluation parameters are defined in the |
None
|
temporary_parameters
|
dict[str, dict | QuantumParameters] | None
|
The temporary parameters to update the qubits with. |
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 = experiment_workflow.options()
options.count(10)
options.create_experiment.transition = "ge"
qpu = QPU(
qubits=[TunableTransmonQubit("q0"), TunableTransmonQubit("q1")],
quantum_operations=TunableTransmonOperations(),
)
temp_qubits = qpu.copy_qubits()
result = experiment_workflow(
session=session,
qpu=qpu,
qubits=temp_qubits,
lengths=[
np.linspace(100e-9, 500e-9, 11),
np.linspace(100e-9, 500e-9, 11),
],
options=options,
).run()