Skip to content

laboneq.dsl.calibration

Classes used in defining calibration for experiments.

laboneq.dsl.calibration.amplifier_pump

AmplifierPump() dataclass

Bases: Observable

Settings for the SHF Parametric Pump Controller (SHFPPC).

Attributes:

Name Type Description
uid str

Unique identifier. If left blank, a new unique ID will be generated.

pump_frequency float | Parameter | None

Set the pump frequency node. Default None.

pump_power float | Parameter | None

Set the pump power node. Units: dBm. Default None.

pump_on bool

Enable the pump tone. Default True.

pump_filter_on bool

Enable the integrated low-pass filter for the pump tone. Default: True.

cancellation_on bool

Enable pump tone cancellation. Default True.

cancellation_phase float | Parameter | None

Set the phase shift of the cancellation tone. Units: radians. Default None.

cancellation_attenuation float | Parameter | None

Set the attenuation of the cancellation tone. Positive values reduce the cancellation tone power. Default None.

cancellation_source CancellationSource

Set the source of the cancellation tone. Default: internal.

cancellation_source_frequency float | None

Specify the cancellation tone frequency when using the external cancellation tone generator. Leave at None when supplying the cancellation tone internally (the frequency then matches that of the pump tone).

alc_on bool

Enable the automatic level control for pump tone output. Default True.

probe_on bool

Enable probe tone output. Default False.

probe_frequency float | Parameter | None

Set the frequency of the generated probe tone. Required if probe_on is True. Units: Hz. Default: None.

probe_power float | Parameter | None

Set the output power of the generated probe tone. Units: dBm. Default: None.

Notes

If an attribute is set to None, the corresponding node is not set.

Some fields were renamed in version 2.24.0

  • AmplifierPump.pump_freq is now AmplifierPump.pump_frequency
  • AmplifierPump.pump_engaged is now AmplifierPump.pump_on
  • AmplifierPump.alc_engaged is now AmplifierPump.alc_on
  • AmplifierPump.use_probe is now AmplifierPump.probe_on

laboneq.dsl.calibration.calibratable

Calibratable

Bases: ABC

Abstract base class for objects that can have calibration attached.

Attributes:

Name Type Description
calibration Optional[SignalCalibration]

The calibration for this object. Implementations of Calibratable should document and set this attribute.

create_info()

Return the calibration type and status in a dictionary.

Used for introspection and debugging.

is_calibrated() abstractmethod

Return True if calibration has been set on this object.

Implementations of Calibratable should document and implement this method.

laboneq.dsl.calibration.calibration

A container for calibration items.

Calibration() dataclass

Calibration object containing a dictionary of CalibrationItems.

Attributes:

Name Type Description
calibration_items

mapping from a UID of a Calibratable to the actual CalibrationItem.

items()

Return a iterator over calibration items.

Returns:

Name Type Description
items Iterator[tuple[str, CalibrationItem]]

An iterator over tuples of UIDs and calibration items.

keys()

Returns an iterator over calibration UIDs.

Returns:

Name Type Description
keys Iterator[str]

An iterator over UIDs.

load(filename) staticmethod

Load calibration data from file.

The file is in JSON format, as generated via .save().

Parameters:

Name Type Description Default
filename str

The filename to load data from.

required

save(filename)

Save calibration data to file.

The file is written in JSON format.

Parameters:

Name Type Description Default
filename str

The filename to save data to.

required

values()

Returns an iterator over calibration items.

Returns:

Name Type Description
values Iterator[CalibrationItem]

An iterator over calibration items.

laboneq.dsl.calibration.calibration_item

CalibrationItem

A base class for calibration items.

laboneq.dsl.calibration.mixer_calibration

MixerCalibration() dataclass

Bases: Observable

Data object containing mixer calibration correction settings.

Attributes:

Name Type Description
uid str

A unique id for the calibration. If not supplied, one will be generated.

voltage_offsets list[float | Parameter] | None

DC voltage offsets. Supplied as a list of two values (for I and Q channels) Both I and Q channel can be swept individually. Units: Volts. Default: None.

correction_matrix list[list[float | Parameter]] | None

Matrix for correcting the gain and phase mismatch between I and Q. Each element can be swept individually. If None, no correction is performed.

Examples:

Create a mixer calibration:

>>> MixerCalibration(
        voltage_offsets=[0.02, 0.01],
        correction_matrix=[[1.0, 0.0], [0.0, 1.0]],
    )

laboneq.dsl.calibration.oscillator

Oscillator() dataclass

This oscillator class represents an oscillator on a PhysicalChannel. All pulses played on any signal line attached to this physical channel will be modulated with the oscillator assigned to that channel.

Attributes:

Name Type Description
frequency float

The oscillator frequency. Units: Hz.

modulation_type ModulationType

The modulation type (ModulationType.SOFTWARE or ModulationType.HARDWARE). When choosing a HARDWARE oscillator, a digital oscillator on the instrument will be used to modulate the output signal, while the choice SOFTWARE will lead to waveform being modulated in software before upload to the instruments. The default, ModulationType.AUTO, resolves to HARDWARE in most situations, except for QA instruments in integration mode, where it resolves to SOFTWARE.

carrier_type CarrierType

Deprecated. The carrier type is no longer used. Default: CarrierType.RF.

Deprecated in 2.7

The carrier_type has no effect.

Changed in 2.16

ModulationType.AUTO now is more sensibly resolved. Previously it would always fall back to SOFTWARE.

laboneq.dsl.calibration.precompensation

BounceCompensation() dataclass

Bases: Observable

Parameters for the bounce correction component of the signal precompensation.

Use to correct reflections resulting from impedance mismatches.

Bounce compensation adds to the original input signal the input signal multiplied by a given amplitude and delayed by a given time.

See Filter Chain Specification for a description of the filter.

Attributes:

Name Type Description
delay

The time to delay the added copy of the input signal by. Default: 0.0.

amplitude

The factor to multiply the amplitude of the added copy of the input signal by. Default: 0.0.

Note

Only supported on the HDAWG with the precompensation option. Ignored on other devices.

ExponentialCompensation() dataclass

Bases: Observable

Parameters for exponential under- and overshoot compensation.

Used to compensate for distortions due to LCR elements such as inductors, resistors, and capacitors.

See Filter Chain Specification for a description of the filter.

Attributes:

Name Type Description
timeconstant float

Exponential filter time constant. Default: 1e-6.

amplitude float

Exponential filter amplitude. Default: 0.0.

Note

Only supported on the HDAWG with the precompensation option. Ignored on other devices.

FIRCompensation() dataclass

Bases: Observable

Parameters for FIR filter signal precompensation.

Used to compensate for short time-scale distortions.

The FIR filter performs a convolution of the input signal with the kernel specified by the coefficients below.

See Filter Chain Specification for a description of the filter.

Attributes:

Name Type Description
coefficients

Coefficients for the FIR filter convolution kernel. The first 8 coefficients are directly applied to the first eight taps of the FIR filter at the full time resolution. The remaining 32 coefficients are applied to pairs of taps. Default: np.zeros(40).

Note

Only supported on the HDAWG with the precompensation option. Ignored on other devices.

HighPassCompensation() dataclass

Bases: Observable

Parameters for highpass filter signal precompensation.

Used to compensate for distortions due to AC-coupling, DC-blocks and Bias-tees.

See Filter Chain Specification for a description of the filter.

Attributes:

Name Type Description
timeconstant float

High-pass filter time constant. Default: 1e-6.

clearing HighPassCompensationClearing

Deprecated and has no effect. Default: None.

Note

Only supported on the HDAWG with the precompensation option. Ignored on other devices.

Changed in version 2.8

Deprecated clearing argument: It has no effect.

Precompensation() dataclass

Bases: RecursiveObservable

Signal precompensation parameters.

Attributes:

Name Type Description
uid

Unique identifier. If left blank, a new unique ID will be generated.

exponential

List of exponential precompensation filters. Default: None.

high_pass

A high pass precompenstation filter. Default: None.

bounce

A bounce precompensation filter. Default: None.

FIR

A FIR precompensation filter. Default: None.

Setting or leaving an attribute above to None will disable the corresponding filter.

Note

Setting a precompensation filter may introduce a signal delay. The LabOne Q compiler will take this delay into account, but it will still be visible in the pulse sheet and when measuring the signal by other means (e.g. using an oscilloscope).

See Filter Chain Specification for details on the delays.

Note

Only supported on the HDAWG with the precompensation option. Ignored on other devices.

is_nonzero()

Returns True if any filters are set.

Returns:

Type Description
bool

True if any filters are defined. False otherwise.

laboneq.dsl.calibration.signal_calibration

SignalCalibration(amplitude=None, delay_signal=None, local_oscillator=None, voltage_offset=None, mixer_calibration=None, precompensation=None, oscillator=None, port_delay=None, port_mode=None, range=None, threshold=None, amplifier_pump=None, added_outputs=None, automute=False) dataclass

Bases: Observable

Calibration parameters and settings for a LogicalSignal.

Attributes:

Name Type Description
oscillator Oscillator | None

The oscillator assigned to the signal. Determines the frequency and type of modulation for any pulses played back on this line. Default: None.

local_oscillator Oscillator | None

The local oscillator assigned to the signal. Sets the center frequency of the playback. Only supported by SHFSG, SHFQA and SHFQC signals. Default: None.

mixer_calibration MixerCalibration | None

Mixer calibration correction settings. Only supported by HDAWG IQ signals. Default: None.

precompensation Precompensation | None

Signal distortion precompensation settings. Only supported by HDAWG signals. Default: None.

port_delay float | Parameter | None

An optional delay of all output on this signal. Implemented by setting delay nodes on the instruments, and will not be visible in the pulse sheet. Not currently supported on SHFSG output channels. Units: seconds. Default: None.

port_mode PortMode | None

On SHFSG, SHFQA and SHFQC, the port mode may be set to select either amplified high-frequency mode (PortMode.RF, default) or baseband mode (PortMode.LF). Default: None.

delay_signal float | None

Defines an additional global delay on this signal line. Implemented by adjusting the waveforms and sequencer code emitted for this logical signal, and is thus visible in the pulse sheet. Default: None.

voltage_offset float | None

On the HDAWG lines, the voltage offset may be used to set a constant voltage offset on individual RF line.

range int | float | None

The output or input range setting for the signal.

threshold float | list[float] | None

Specify the state discrimination threshold. Only supported for acquisition signals on the UHFQA, SHFQA and SHFQC.

amplitude float | Parameter | None

Amplitude multiplying all waveforms played on the signal line. Only supported by the SHFQA.

amplifier_pump AmplifierPump | None

Parametric Pump Controller settings.

added_outputs list[OutputRoute] | None

Added outputs to the signal line's physical channel port. Only available for SHFSG/SHFQC devices with Output Router and Adder (RTR) option enabled. Only viable for signals which point to 'SGCHANNELS/N/OUTPUT' physical ports.

automute bool

Mute output channel when no waveform is played on it i.e for the duration of delays. Only available on SHF+ output channels.

added_outputs = added_outputs instance-attribute

amplifier_pump property writable

amplitude = amplitude instance-attribute

automute = automute instance-attribute

delay_signal = delay_signal instance-attribute

local_oscillator = local_oscillator instance-attribute

mixer_calibration: MixerCalibration property writable

oscillator = oscillator instance-attribute

port_delay = port_delay instance-attribute

port_mode = port_mode instance-attribute

precompensation: Precompensation property writable

range = range instance-attribute

threshold = threshold instance-attribute

voltage_offset = voltage_offset instance-attribute

laboneq.dsl.calibration.units

Quantity(value, unit) dataclass

A quantity with units.

Attributes:

Name Type Description
value float

The value of the quantity.

unit Unit

The unit the quantity value is specified in.

unit: Unit instance-attribute

value: float instance-attribute

Unit

Bases: _StrEnum

An Enum of available calibration units.

dBm = 'dBm' class-attribute instance-attribute

volt = 'volt' class-attribute instance-attribute

Volt(val)

Return a quantity with the unit Volt.

Parameters:

Name Type Description Default
val float

The voltage.

required

Returns:

Type Description
Quantity

A quantity in volts.

dBm(val)

Return a quantity with the unit dBm.

Parameters:

Name Type Description Default
val float

The power in dBm.

required

Returns:

Type Description
Quantity

A quantity in dBm.