laboneq.dsl.quantum
¶
Experimental
The classes defined below are considered experimental. Their interfaces may change in future releases of LabOne Q.
laboneq.dsl.quantum.quantum_element
¶
QuantumElement(uid=None, signals=None)
dataclass
¶
Bases: ABC
An abstract base class for quantum elements like Qubits or tunable couplers etc.
Initializes a new QuantumElement object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
uid |
str
|
A unique identifier for the quantum element. |
None
|
signals |
Dict[str, LogicalSignal]
|
A dictionary of logical signals associated with the quantum element. |
None
|
signals = QuantumElementSignalMap({}, key_validator=self._coerce_signal_type)
instance-attribute
¶
uid = uuid.uuid4().hex if uid is None else uid
instance-attribute
¶
add_signals(signals)
¶
Adds logical signals to the quantum element.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
signals |
Dict[str, LogicalSignal]
|
A dictionary of logical signals to add to the quantum element. |
required |
calibration()
abstractmethod
¶
Calibration of the Quantum element.
experiment_signals(with_types=False, with_calibration=False)
¶
Experiment signals of the quantum element.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
with_types |
bool
|
When true, return a list of tuples which consist of a mapped logical signal type and an experiment signal. Otherwise, just return the experiment signals. |
False
|
with_calibration |
bool
|
Apply the qubit's calibration to the ExperimentSignal. |
False
|
from_json(filename)
classmethod
¶
load(filename)
classmethod
¶
save(filename)
¶
laboneq.dsl.quantum.quantum_operation
¶
QuantumOperation(uid=None, operation_map=None)
¶
A class for quantum operations.
Initialize a new QuantumOperation object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
uid |
Optional[str]
|
A unique identifier for the quantum operation. |
None
|
operation_map |
Optional[Dict[Union[QuantumElement, QuantumElementTuple], Section]]
|
A dictionary of sections associated with quantum elements. |
None
|
operation_map = {} if operation_map is None else {k if isinstance(k, str) else self._get_uids(k): vfor (k, v) in operation_map.items()}
instance-attribute
¶
uid = uuid.uuid4().hex
instance-attribute
¶
add_operation(elements, section)
¶
Add a section to the quantum operation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
elements |
Union[QuantumElement, QuantumElementTuple]
|
The quantum element(s) to which the section is associated. |
required |
section |
Section
|
The section to add to the quantum operation. |
required |
from_dict(tuneup)
staticmethod
¶
Create a QuantumOperation object from a dictionary.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tuneup |
Dict[Union[QuantumElement, QuantumElementTuple], Section]
|
A dictionary of quantum elements and sections. |
required |
load(filename)
classmethod
¶
laboneq.dsl.quantum.qubit
¶
Qubit(uid=None, signals=None, parameters=None)
dataclass
¶
Bases: QuantumElement
A class for a generic two-level Qubit.
Initializes a new Qubit.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
uid |
str
|
A unique identifier for the Qubit. |
None
|
signals |
Dict[str, LogicalSignal]
|
A mapping of logical signals associated with the qubit. Qubit accepts the following keys in the mapping: 'drive', 'measure', 'acquire', 'flux' This is so that the Qubit parameters are assigned into the correct signal lines in calibration. |
None
|
parameters |
Optional[Union[QubitParameters, Dict[str, Any]]]
|
Parameters associated with the qubit.
Required for generating calibration and experiment signals via |
None
|
parameters = QubitParameters()
instance-attribute
¶
calibration()
¶
Generate calibration from the qubits parameters and signal lines.
Qubit
requires parameters
for it to be able to produce a calibration object.
Returns:
Type | Description |
---|---|
Calibration
|
Prefilled calibration object from Qubit parameters. |
from_logical_signal_group(uid, lsg, parameters=None)
classmethod
¶
Qubit from logical signal group.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
uid |
str
|
A unique identifier for the Qubit. |
required |
lsg |
LogicalSignalGroup
|
Logical signal group. Qubit understands the following signal line names:
This is so that the Qubit parameters are assigned into the correct signal lines in calibration. |
required |
parameters |
Optional[Union[QubitParameters, Dict[str, Any]]]
|
Parameters associated with the qubit. |
None
|
laboneq.dsl.quantum.transmon
¶
Transmon(uid=None, signals=None, parameters=None)
dataclass
¶
Bases: QuantumElement
A class for a superconducting, flux-tuneable Transmon Qubit.
Initializes a new Transmon Qubit.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
uid |
str
|
A unique identifier for the Qubit. |
None
|
signals |
Dict[str, LogicalSignal]
|
A mapping of logical signals associated with the qubit. Qubit accepts the following keys in the mapping: 'drive', 'measure', 'acquire', 'flux' This is so that the Qubit parameters are assigned into the correct signal lines in calibration. |
None
|
parameters |
Optional[Union[TransmonParameters, Dict[str, Any]]]
|
Parameters associated with the qubit.
Required for generating calibration and experiment signals via |
None
|
parameters = TransmonParameters()
instance-attribute
¶
calibration(set_local_oscillators=True)
¶
Generate calibration from the parameters and attached signal lines.
Qubit
requires parameters
for it to be able to produce calibration objects.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
set_local_oscillators |
bool
|
If True, adds local oscillator settings to the calibration. |
True
|
Returns:
Name | Type | Description |
---|---|---|
calibration |
Calibration
|
Prefilled calibration object from Qubit parameters. |
from_logical_signal_group(uid, lsg, parameters=None)
classmethod
¶
Transmon Qubit from logical signal group.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
uid |
str
|
A unique identifier for the Qubit. |
required |
lsg |
LogicalSignalGroup
|
Logical signal group. Transmon Qubit understands the following signal line names:
This is so that the Qubit parameters are assigned into the correct signal lines in calibration. |
required |
parameters |
Optional[Union[TransmonParameters, Dict[str, Any]]]
|
Parameters associated with the qubit. |
None
|