acquisition_library#

Standard acquisition protocols for use with the quantify_scheduler.

Module Contents#

Classes#

Acquisition

An operation representing data acquisition at the quantum-device abstraction layer.

AcquisitionOperation

Deprecated alias.

Trace

The Trace acquisition protocol measures a signal s(t).

WeightedIntegratedSeparated

Weighted integration acquisition protocol where two sets weights

SSBIntegrationComplex

Single sideband integration acquisition protocol with complex results.

ThresholdedAcquisition

Acquisition protocol allowing to control rotation and threshold.

NumericalSeparatedWeightedIntegration

Subclass of WeightedIntegratedSeparated with parameterized waveforms as weights.

NumericalWeightedIntegrationComplex

Deprecated, renamed to NumericalSeparatedWeightedIntegration.

NumericalWeightedIntegration

Subclass of NumericalSeparatedWeightedIntegration returning a complex number.

TriggerCount

Trigger counting acquisition protocol returning an integer.

class Acquisition(name: str)[source]#

Bases: quantify_scheduler.Operation

An operation representing data acquisition at the quantum-device abstraction layer.

An Acquisition must consist of (at least) an AcquisitionProtocol specifying how the acquired signal is to be processed, and an AcquisitionChannel and AcquisitionIndex specifying where the acquired data is to be stored in the RawDataset.

N.B. This class helps differentiate an acquisition operation from the regular operations. This enables us to use plot_acquisition_operations() to highlight acquisition pulses in the pulse diagrams.

class AcquisitionOperation(name: str)[source]#

Bases: Acquisition

Deprecated alias.

class Trace(duration: float, port: str, clock: str, acq_channel: int = 0, acq_index: int = 0, bin_mode: quantify_scheduler.enums.BinMode | str = BinMode.AVERAGE, t0: float = 0)[source]#

Bases: Acquisition

The Trace acquisition protocol measures a signal s(t).

Only processing performed is rescaling and adding units based on a calibrated scale. Values are returned as a raw trace (numpy array of float datatype). Length of this array depends on the sampling rate of the acquisition device.

Parameters:
  • port – The acquisition port.

  • clock – The clock used to demodulate the acquisition.

  • duration – The acquisition duration in seconds.

  • acq_channel – The data channel in which the acquisition is stored, is by default 0. Describes the “where” information of the measurement, which typically corresponds to a qubit idx.

  • acq_index – The data register in which the acquisition is stored, by default 0. Describes the “when” information of the measurement, used to label or tag individual measurements in a large circuit. Typically corresponds to the setpoints of a schedule (e.g., tau in a T1 experiment).

  • bin_mode – Describes what is done when data is written to a register that already contains a value. Only “BinMode.AVERAGE” option is available at the moment; this option stores the weighted average value of the new result and the old register value.

  • t0 – The acquisition start time in seconds, by default 0.

class WeightedIntegratedSeparated(waveform_a: Dict[str, Any], waveform_b: Dict[str, Any], port: str, clock: str, duration: float, acq_channel: int = 0, acq_index: int = 0, bin_mode: quantify_scheduler.enums.BinMode | str = BinMode.APPEND, phase: float = 0, t0: float = 0)[source]#

Bases: Acquisition

Weighted integration acquisition protocol where two sets weights are applied separately to the real and imaginary parts of the signal.

Weights are applied as:

\[\widetilde{A} = \int \mathrm{Re}(S(t))\cdot W_A(t) \mathrm{d}t\]
\[\widetilde{B} = \int \mathrm{Im}(S(t))\cdot W_B(t) \mathrm{d}t\]
Parameters:
  • waveform_a – The complex waveform used as integration weights \(W_A(t)\).

  • waveform_b – The complex waveform used as integration weights \(W_B(t)\).

  • port – The acquisition port.

  • clock – The clock used to demodulate the acquisition.

  • duration – The acquisition duration in seconds.

  • acq_channel – The data channel in which the acquisition is stored, by default 0. Describes the “where” information of the measurement, which typically corresponds to a qubit idx.

  • acq_index – The data register in which the acquisition is stored, by default 0. Describes the “when” information of the measurement, used to label or tag individual measurements in a large circuit. Typically corresponds to the setpoints of a schedule (e.g., tau in a T1 experiment).

  • bin_mode – Describes what is done when data is written to a register that already contains a value. Options are “append” which appends the result to the list or “average” which stores the weighted average value of the new result and the old register value, by default BinMode.APPEND.

  • phase – The phase of the pulse and acquisition in degrees, by default 0.

  • t0 – The acquisition start time in seconds, by default 0.

Raises:

NotImplementedError

class SSBIntegrationComplex(port: str, clock: str, duration: float, acq_channel: int = 0, acq_index: int = 0, bin_mode: quantify_scheduler.enums.BinMode | str = BinMode.AVERAGE, phase: float = 0, t0: float = 0)[source]#

Bases: Acquisition

Single sideband integration acquisition protocol with complex results.

A weighted integrated acquisition on a complex signal using a square window for the acquisition weights.

The signal is demodulated using the specified clock, and the square window then effectively specifies an integration window.

Parameters:
  • port – The acquisition port.

  • clock – The clock used to demodulate the acquisition.

  • duration – The acquisition duration in seconds.

  • acq_channel – The data channel in which the acquisition is stored, by default 0. Describes the “where” information of the measurement, which typically corresponds to a qubit idx.

  • acq_index – The data register in which the acquisition is stored, by default 0. Describes the “when” information of the measurement, used to label or tag individual measurements in a large circuit. Typically corresponds to the setpoints of a schedule (e.g., tau in a T1 experiment).

  • bin_mode – Describes what is done when data is written to a register that already contains a value. Options are “append” which appends the result to the list or “average” which stores the weighted average value of the new result and the old register value, by default BinMode.AVERAGE.

  • phase – The phase of the pulse and acquisition in degrees, by default 0.

  • t0 – The acquisition start time in seconds, by default 0.

class ThresholdedAcquisition(port: str, clock: str, duration: float, acq_channel: int = 0, acq_index: int = 0, bin_mode: quantify_scheduler.enums.BinMode | str = BinMode.AVERAGE, feedback_trigger_label: str | None = None, phase: float = 0, t0: float = 0, acq_rotation: float = 0, acq_threshold: float = 0)[source]#

Bases: Acquisition

Acquisition protocol allowing to control rotation and threshold.

This acquisition protocol is similar to the SSBIntegrationComplex acquisition protocol, but the complex result is now rotated and thresholded to produce a “0” or a “1”, as controlled by the parameters for rotation angle <qubit>.measure.acq_rotation and threshold value <qubit>.measure.acq_threshold in the device configuration (see example below).

The rotation angle and threshold value for each qubit can be set through the device configuration.

Note

Thresholded acquisition is currently only supported by the Qblox backend.

Examples

from quantify_scheduler import Schedule
from quantify_scheduler.device_under_test.transmon_element import BasicTransmonElement
from quantify_scheduler.operations.acquisition_library import ThresholdedAcquisition

# set up qubit
qubit = BasicTransmonElement("q0")
qubit.clock_freqs.readout(8.0e9)

# set rotation and threshold value
rotation, threshold = 20, -0.1
qubit.measure.acq_rotation(rotation)
qubit.measure.acq_threshold(threshold)

# basic schedule
schedule = Schedule("thresholded acquisition")
schedule.add(ThresholdedAcquisition(port="q0:res", clock="q0.ro", duration=1e-6))
{'name': '74cf40f2-b3fa-4630-8086-8662f30da489', 'operation_id': '4680103455405148084', 'timing_constraints': [{'rel_time': 0, 'ref_schedulable': None, 'ref_pt_new': None, 'ref_pt': None}], 'label': '74cf40f2-b3fa-4630-8086-8662f30da489'}
Parameters:
  • port (str) – The acquisition port.

  • clock (str) – The clock used to demodulate the acquisition.

  • duration (float) – The acquisition duration in seconds.

  • acq_channel (int) – The data channel in which the acquisition is stored, by default 0. Describes the “where” information of the measurement, which typically corresponds to a qubit idx.

  • acq_index (int) – The data register in which the acquisition is stored, by default 0. Describes the “when” information of the measurement, used to label or tag individual measurements in a large circuit. Typically corresponds to the setpoints of a schedule (e.g., tau in a T1 experiment).

  • bin_mode (BinMode or str) – Describes what is done when data is written to a register that already contains a value. Options are “append” which appends the result to the list or “average” which stores the weighted average value of the new result and the old register value, by default BinMode.AVERAGE.

  • feedback_trigger_label (str) – The label corresponding to the feedback trigger, which is mapped by the compiler to a feedback trigger address on hardware, by default None.

  • phase (float) – The phase of the pulse and acquisition in degrees, by default 0.

  • t0 (float) – The acquisition start time in seconds, by default 0.

class NumericalSeparatedWeightedIntegration(port: str, clock: str, weights_a: List[complex] | numpy.ndarray, weights_b: List[complex] | numpy.ndarray, weights_sampling_rate: float = 1000000000.0, interpolation: str = 'linear', acq_channel: int = 0, acq_index: int = 0, bin_mode: quantify_scheduler.enums.BinMode | str = BinMode.APPEND, phase: float = 0, t0: float = 0)[source]#

Bases: WeightedIntegratedSeparated

Subclass of WeightedIntegratedSeparated with parameterized waveforms as weights.

A WeightedIntegratedSeparated class using parameterized waveforms and interpolation as the integration weights.

Weights are applied as:

\[\widetilde{A} = \int \mathrm{Re}(S(t)\cdot W_A(t) \mathrm{d}t\]
\[\widetilde{B} = \int \mathrm{Im}(S(t))\cdot W_B(t) \mathrm{d}t\]
Parameters:
  • port – The acquisition port.

  • clock – The clock used to demodulate the acquisition.

  • weights_a – The list of complex values used as weights \(A(t)\) on the incoming complex signal.

  • weights_b – The list of complex values used as weights \(B(t)\) on the incoming complex signal.

  • weights_sampling_rate – The rate with which the weights have been sampled, in Hz. By default equal to 1 GHz. Note that during hardware compilation, the weights will be resampled with the sampling rate supported by the target hardware.

  • interpolation – The type of interpolation to use, by default “linear”. This argument is passed to interp1d.

  • acq_channel – The data channel in which the acquisition is stored, by default 0. Describes the “where” information of the measurement, which typically corresponds to a qubit idx.

  • acq_index – The data register in which the acquisition is stored, by default 0. Describes the “when” information of the measurement, used to label or tag individual measurements in a large circuit. Typically corresponds to the setpoints of a schedule (e.g., tau in a T1 experiment).

  • bin_mode – Describes what is done when data is written to a register that already contains a value. Options are “append” which appends the result to the list or “average” which stores the weighted average value of the new result and the old register value, by default BinMode.APPEND.

  • phase – The phase of the pulse and acquisition in degrees, by default 0.

  • t0 – The acquisition start time in seconds, by default 0.

class NumericalWeightedIntegrationComplex(waveform_a: Dict[str, Any], waveform_b: Dict[str, Any], port: str, clock: str, duration: float, acq_channel: int = 0, acq_index: int = 0, bin_mode: quantify_scheduler.enums.BinMode | str = BinMode.APPEND, phase: float = 0, t0: float = 0)[source]#

Bases: WeightedIntegratedSeparated

Deprecated, renamed to NumericalSeparatedWeightedIntegration.

class NumericalWeightedIntegration(port: str, clock: str, weights_a: List[complex] | numpy.ndarray, weights_b: List[complex] | numpy.ndarray, weights_sampling_rate: float = 1000000000.0, interpolation: str = 'linear', acq_channel: int = 0, acq_index: int = 0, bin_mode: quantify_scheduler.enums.BinMode | str = BinMode.APPEND, phase: float = 0, t0: float = 0)[source]#

Bases: NumericalSeparatedWeightedIntegration

Subclass of NumericalSeparatedWeightedIntegration returning a complex number.

Parameters:
  • port – The acquisition port.

  • clock – The clock used to demodulate the acquisition.

  • weights_a – The list of complex values used as weights \(A(t)\) on the incoming complex signal.

  • weights_b – The list of complex values used as weights \(B(t)\) on the incoming complex signal.

  • weights_sampling_rate – The rate with which the weights have been sampled, in Hz. By default equal to 1 GHz. Note that during hardware compilation, the weights will be resampled with the sampling rate supported by the target hardware.

  • t – The time values of each weight. This parameter is deprecated in favor of weights_sampling_rate. If a value is provided for t, the weights_sampling_rate parameter will be ignored.

  • interpolation – The type of interpolation to use, by default “linear”. This argument is passed to interp1d.

  • acq_channel – The data channel in which the acquisition is stored, by default 0. Describes the “where” information of the measurement, which typically corresponds to a qubit idx.

  • acq_index – The data register in which the acquisition is stored, by default 0. Describes the “when” information of the measurement, used to label or tag individual measurements in a large circuit. Typically corresponds to the setpoints of a schedule (e.g., tau in a T1 experiment).

  • bin_mode – Describes what is done when data is written to a register that already contains a value. Options are “append” which appends the result to the list or “average” which stores the weighted average value of the new result and the old register value, by default BinMode.APPEND.

  • phase – The phase of the pulse and acquisition in degrees, by default 0.

  • t0 – The acquisition start time in seconds, by default 0.

class TriggerCount(port: str, clock: str, duration: float, acq_channel: int = 0, acq_index: int = 0, bin_mode: quantify_scheduler.enums.BinMode | str = BinMode.APPEND, t0: float = 0)[source]#

Bases: Acquisition

Trigger counting acquisition protocol returning an integer.

The trigger acquisition mode is used to measure how many times the trigger level is surpassed. The level is set in the hardware configuration.

Parameters:
  • port – The acquisition port.

  • clock – The clock used to demodulate the acquisition.

  • duration – The acquisition duration in seconds.

  • acq_channel – The data channel in which the acquisition is stored, by default 0. Describes the “where” information of the measurement, which typically corresponds to a qubit idx.

  • acq_index – The data register in which the acquisition is stored, by default 0. Describes the “when” information of the measurement, used to label or tag individual measurements in a large circuit. Typically corresponds to the setpoints of a schedule (e.g., tau in a T1 experiment).

  • bin_mode – Describes what is done when data is written to a register that already contains a value. Options are “append” which appends the result to the list or “average” which stores the count value of the new result and the old register value, by default BinMode.APPEND.

  • t0 – The acquisition start time in seconds, by default 0.