Skip to content

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 | None

A unique identifier for the quantum element.

None
signals dict[str, LogicalSignal] | None

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

Loads a QuantumElement object from a JSON file.

Parameters:

Name Type Description Default
filename Union[str, bytes, PathLike]

The name of the JSON file to load the QuantumElement object from.

required

load(filename) classmethod

Loads a QuantumElement object from a JSON file.

Parameters:

Name Type Description Default
filename Union[str, bytes, PathLike]

The name of the JSON file to load the QuantumElement object from.

required

save(filename)

Save a QuantumElement object to a JSON file.

Parameters:

Name Type Description Default
filename Union[str, bytes, PathLike]

The name of the JSON file to save the QuantumElement object.

required

to_json(filename)

Save a QuantumElement object to a JSON file.

Parameters:

Name Type Description Default
filename Union[str, bytes, PathLike]

The name of the JSON file to save the QuantumElement object.

required

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 str | None

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

Load a QuantumOperation object to a JSON file.

Parameters:

Name Type Description Default
filename Union[str, bytes, 'PathLike']

The name of the JSON file to load the QuantumOperation object.

required

save(filename)

Save a QuantumOperation object to a JSON file.

Parameters:

Name Type Description Default
filename Union[str, bytes, 'PathLike']

The name of the JSON file to save the QuantumOperation object.

required

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 | None

A unique identifier for the Qubit.

None
signals dict[str, LogicalSignal] | None

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 QubitParameters | dict[str, Any] | None

Parameters associated with the qubit. Required for generating calibration and experiment signals via calibration() and experiment_signals().

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:

- drive: 'drive', 'drive_line'
- measure: 'measure', 'measure_line'
- acquire: 'acquire', 'acquire_line'
- flux: 'flux', 'flux_line'

This is so that the Qubit parameters are assigned into the correct signal lines in calibration.

required
parameters QubitParameters | dict[str, Any] | None

Parameters associated with the qubit.

None

QubitParameters dataclass

drive_frequency: float | None property

Qubit drive frequency.

Calculated from resonance_frequency and drive_lo_frequency,

Returns:

Type Description
float | None

Calculated value if both attributes are defined, otherwise None.

readout_frequency: float | None property

Readout baseband frequency.

Calculated from readout_resonator_frequency and readout_lo_frequency,

Returns:

Type Description
float | None

Calculated value if both attributes are defined, otherwise 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 | None

A unique identifier for the Qubit.

None
signals dict[str, LogicalSignal] | None

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 TransmonParameters | dict[str, Any] | None

Parameters associated with the qubit. Required for generating calibration and experiment signals via calibration() and experiment_signals().

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:

- drive: 'drive', 'drive_line'
- drive_ef: 'drive_ef', 'drive_line_ef'
- measure: 'measure', 'measure_line'
- acquire: 'acquire', 'acquire_line'
- flux: 'flux', 'flux_line'

This is so that the Qubit parameters are assigned into the correct signal lines in calibration.

required
parameters TransmonParameters | dict[str, Any] | None

Parameters associated with the qubit.

None

TransmonParameters dataclass

drive_frequency_ef: float | None property

Qubit drive frequency.

drive_frequency_ge: float | None property

Qubit drive frequency.

readout_frequency: float | None property

Readout baseband frequency.