laboneq_applications.experiments.ramsey
¶
This module defines the Ramsey experiment.
In this experiment, we sweep the wait time between two x90 pulses on a given qubit transition in order to determine the T2 time of the qubit.
The Ramsey experiment has the following pulse sequence:
qb --- [ prep transition ] --- [ x90_transition ] --- [ delay ] ---
[ x90_transition ] --- [ measure ]
The second x90 pulse has a delay dependent phase that generates an oscillation of the
qubit population at the frequency detuning.
If multiple qubits are passed to the run workflow, the above pulses are applied
in parallel on all the qubits.
create_experiment(qpu, qubits, delays, detunings=None, options=None)
¶
Creates a Ramsey Experiment where the phase of the second pulse is swept.
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 |
delays
|
QubitSweepPoints
|
The delays (in seconds) of the second x90 pulse to sweep over for each
qubit. If |
required |
detunings
|
float | Sequence[float] | None
|
The effective detuning in Hz used to calculate the phase increment
of the second pulse in the Ramsey sequence.
For perfectly resonant excitation pulses,
this simulates oscillations of the qubit state vector
around the Bloch sphere at the given frequency.
This parameter and the fitted frequency of the oscillations
can then be used to calculate the true qubit resonance frequency.
|
None
|
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 lengths of |
ValueError
|
If |
ValueError
|
If |
ValueError
|
If the experiment uses calibration traces and the averaging mode is sequential. |
Example
options = TuneupExperimentOptions()
qpu = QPU(
quantum_elements=[TunableTransmonQubit("q0"), TunableTransmonQubit("q1")],
quantum_operations=TunableTransmonOperations(),
)
temp_qubits = qpu.copy_quantum_elements()
create_experiment(
qpu=qpu,
qubits=temp_qubits,
delays=[
np.linspace(0, 20e-6, 51),
np.linspace(0, 30e-6, 52),
],
detunings = [1e6, 1.346e6],
options=options,
)
evaluate_experiment(analysis_results, qubits, evaluation_parameters=None)
¶
Evaluates the Ramsey 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, *, delays, detunings=None, evaluation_parameters=None, temporary_parameters=None, options=None)
¶
The Ramsey 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. This argument replaces the
evaluation_parameter, evaluation_parameter_thresholds, and
evaluation_fit_r2_thresholds arguments.
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 |
delays
|
QubitSweepPoints
|
The delays (in seconds) of the second x90 pulse to sweep over for each
qubit. If |
required |
detunings
|
float | Sequence[float] | None
|
The detuning in Hz to generate oscillating qubit occupations. |
None
|
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 | 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
|
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 |
|---|---|---|
result |
None
|
The result of the workflow. |
Example
options = experiment_workflow.options()
options.create_experiment.count(10)
options.create_experiment.transition("ge")
setup = DeviceSetup("my_device")
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,
delays=[[0.1, 0.5, 1], [0.1, 0.5, 1]],
detunings = {'q0':1e6,'q1':1.346e6},
options=options,
).run()