laboneq_applications.contrib.experiments.spin_locking
¶
This module defines the spin locking experiment.
The spin locking experiment has the following pulse sequence:
qb --- [ prep transition ] --- [ x90_transition ] --- [ ry(delay) ] ---
--- [ x90_transition ] --- [ measure ]
If multiple qubits are passed to the run workflow, the above pulses are applied
in parallel on all the qubits.
SpinLockingExperimentOptions
¶
Base options for the spin locking experiment.
Additional attributes
pulse: Dictionary to define the pulse parameters for the spin locking pulse.
pulse = attrs.field(factory=(lambda: {'function': 'gaussian_square_sweep', 'can_compress': True, 'risefall_in_samples': 64}))
class-attribute
instance-attribute
¶
SpinLockingWorkflowOptions
¶
Option for spin locking workflow.
Attributes:
| Name | Type | Description |
|---|---|---|
create_experiment |
SpinLockingExperimentOptions
|
The options for creating the experiment. |
create_experiment = SpinLockingExperimentOptions()
class-attribute
instance-attribute
¶
create_experiment(qpu, qubits, lengths, rel_amp=None, options=None)
¶
Creates a Spin Locking Experiment.
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 delays to sweep over for each qubit. Note that |
required |
rel_amp
|
float | None
|
The relative amplitude specifies the spin_locking pulse amplitude relative to the pi-pulse amplitude. Default is None and corresponds to the pi pulse amplitude of the specified transition. |
None
|
options
|
SpinLockingExperimentOptions | None
|
The options for building the experiment. See [SpinLockingExperimentOptions] 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 delays is not a list of numbers or array when a single qubit is passed. |
Example
options = {
"count": 10,
"transition": "ge",
"averaging_mode": "cyclic",
"acquisition_type": "integration_trigger",
"cal_traces": True,
}
options = TuneupExperimentOptions(**options)
setup = DeviceSetup()
qpu = QPU(
setup=DeviceSetup("my_device"),
qubits=[TunableTransmonQubit("q0"), TunableTransmonQubit("q1")],
quantum_operations=TunableTransmonOperations(),
)
create_experiment(
qpu=qpu,
qubits=["q0", "q1"],
lengths=[[1e-6, 5e-6, 10e-6], [1e-6, 5e-6, 10e-6]]
options=options,
)
experiment_workflow(session, qpu, qubits, *, lengths, rel_amp=None, temporary_parameters=None, options=None)
¶
The Spin Locking Workflow.
The workflow consists of the following steps:
Removed in version 26.7.0.
The qubits argument of type QuantumElements has been removed.
Please pass qubits of type list[str] | str instead, i.e., the quantum
element UIDs instead of the quantum element instances.
Changed in version 26.4.0.
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.
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
|
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 delays to sweep over for each qubit. Note that |
required |
rel_amp
|
float | None
|
The relative amplitude specifies the spin_locking pulse amplitude relative to the pi-pulse amplitude. Default is None and corresponds to the pi pulse amplitude of the specified transition. |
None
|
temporary_parameters
|
dict[str, dict | QuantumParameters] | None
|
The temporary parameters to update the qubits with. |
None
|
options
|
SpinLockingWorkflowOptions | 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.count(10)
options.transition("ge")
qpu = QPU(
qubits=[TunableTransmonQubit("q0"), TunableTransmonQubit("q1")],
quantum_operations=TunableTransmonOperations(),
)
result = experiment_workflow(
session=session,
qpu=qpu,
qubits=["q0", "q1"],
lengths=[[1e-6, 5e-6, 10e-6]], [1e-6, 5e-6, 10e-6]],
options=options,
).run()
gaussian_square_sweep(x, risefall_in_samples=None, sigma=1 / 3, zero_boundaries=False, **_)
¶
Create a square waveform with gaussian sides.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
array
|
Samples of the pulse |
required |
risefall_in_samples
|
int
|
Width of the rise/fall of the pulse in samples. Dynamically set to 10%
(5% each) of |
None
|
sigma
|
float
|
Std. deviation of the Gaussian rise/fall portion of the pulse |
1 / 3
|
zero_boundaries
|
bool
|
Whether to zero the pulse at the boundaries |
False
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
uid |
[str][]
|
Unique identifier of the pulse |
amplitude |
[float][]
|
Amplitude of the pulse |
Returns:
| Name | Type | Description |
|---|---|---|
pulse |
Pulse
|
Gaussian square pulse. |