operations#

Module containing the standard library of commonly used operations as well as the Operation class.

Tip

Quantify scheduler can trivially be extended by creating custom operations. Take a look at e.g., the pulse library for examples on how to implement custom pulses.

Submodules#

Package Contents#

Classes#

Acquisition

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

NumericalSeparatedWeightedIntegration

Subclass of WeightedIntegratedSeparated with parameterized waveforms as weights.

NumericalWeightedIntegration

Subclass of NumericalSeparatedWeightedIntegration returning a complex number.

SSBIntegrationComplex

Single sideband integration acquisition protocol with complex results.

ThresholdedAcquisition

Acquisition protocol allowing to control rotation and threshold.

Timetag

Acquire a single timetag per acquisition index.

TimetagTrace

The TimetagTrace acquisition protocol records timetags within an acquisition window.

Trace

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

TriggerCount

Trigger counting acquisition protocol returning an integer.

WeightedIntegratedSeparated

Weighted integration acquisition protocol where two sets weights

ConditionalOperation

Conditional over another operation.

ControlFlowOperation

Control flow operation that can be used as an Operation in Schedule.

ControlFlowSpec

Control flow specification to be used at Schedule.add.

LoopOperation

Loop over another operation predefined times.

CNOT

Conditional-NOT gate, a common entangling gate.

CZ

Conditional-phase gate, a common entangling gate.

X90

A single qubit rotation of 90 degrees around the X-axis.

Y90

A single qubit rotation of 90 degrees around the Y-axis.

Z90

A single qubit rotation of 90 degrees around the Z-axis.

H

A single qubit Hadamard gate.

Measure

A projective measurement in the Z-basis.

Reset

Reset a qubit to the \(|0\rangle\) state.

Rxy

A single qubit rotation around an axis in the equator of the Bloch sphere.

Rz

A single qubit rotation about the Z-axis of the Bloch sphere.

X

A single qubit rotation of 180 degrees around the X-axis.

Y

A single qubit rotation of 180 degrees around the Y-axis.

Z

A single qubit rotation of 180 degrees around the Z-axis.

ChargeReset

Prepare a NV to its negative charge state NV$^-$.

CRCount

Operate ionization and spin pump lasers for charge and resonance counting.

Operation

A representation of quantum circuit operations.

ChirpPulse

A linear chirp signal. A sinusoidal signal that ramps up in frequency.

DRAGPulse

A Gaussian pulse with a derivative component added to the out-of-phase channel.

GaussPulse

The GaussPulse Operation is a real-valued pulse with the specified

IdlePulse

The IdlePulse Operation is a placeholder for a specified duration of time.

MarkerPulse

Digital pulse that is HIGH for the specified duration.

NumericalPulse

A pulse where the shape is determined by specifying an array of (complex) points.

RampPulse

RampPulse Operation is a pulse that ramps from zero to a set amplitude over its duration.

ReferenceMagnitude

Dataclass defining a reference level for pulse amplitudes in units of 'V', 'dBm', or 'A'.

ResetClockPhase

An operation that resets the phase of a clock.

SetClockFrequency

Operation that sets updates the frequency of a clock.

ShiftClockPhase

Operation that shifts the phase of a clock by a specified amount.

SkewedHermitePulse

Hermite pulse intended for single qubit gates in diamond based systems.

SoftSquarePulse

A real valued square pulse convolved with a Hann window for smoothing.

SquarePulse

A real-valued pulse with the specified amplitude during the pulse.

StaircasePulse

A real valued staircase pulse, which reaches it's final amplitude in discrete steps.

SuddenNetZeroPulse

A pulse that can be used to implement a conditional phase gate in transmon qubits.

Timestamp

Operation that marks a time reference for timetags.

VoltageOffset

Operation that represents setting a constant offset to the output voltage.

WindowOperation

The WindowOperation is an operation for visualization purposes.

Functions#

composite_square_pulse(...)

An example composite pulse to implement a CZ gate.

nv_spec_pulse_mw(...)

Generate hermite pulse for spectroscopy experiment.

phase_shift(...)

Generate a ShiftClockPhase that shifts the phase of the

rxy_drag_pulse(...)

Generate a DRAGPulse that achieves the right

rxy_gauss_pulse(...)

Generate a Gaussian drive with GaussPulse that achieves

rxy_hermite_pulse(...)

Generate a Gaussian drive with GaussPulse that achieves

spin_init_pulse(→ quantify_scheduler.schedules.Schedule)

Device compilation of the spin init operation.

class Acquisition(name: str)[source]#

Bases: quantify_scheduler.operations.operation.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 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 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 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': '993c8490-bb3f-461c-9a69-e49f15654664', 'operation_id': '1268714231450859023', 'timing_constraints': [{'rel_time': 0, 'ref_schedulable': None, 'ref_pt_new': None, 'ref_pt': None}], 'label': '993c8490-bb3f-461c-9a69-e49f15654664'}
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 Timetag(duration: float, port: str, clock: str = DigitalClockResource.IDENTITY, acq_channel: int = 0, acq_index: int = 0, bin_mode: quantify_scheduler.enums.BinMode | str = BinMode.APPEND, time_source: quantify_scheduler.enums.TimeSource | str = TimeSource.FIRST, time_ref: quantify_scheduler.enums.TimeRef | str = TimeRef.START, t0: float = 0, fine_start_delay: float = 0, fine_end_delay: float = 0)[source]#

Bases: Acquisition

Acquire a single timetag per acquisition index.

Important

The exact duration of this operation, and the possible bin modes may depend on the control hardware. Please consult your hardware vendor’s Reference guide for more information.

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.APPEND.

  • time_source

    Selects the timetag data source for this acquisition type. String enumeration, one of:

    • first (default): record the first timetag in the window.

    • second: record the second timetag in the window. Can be used to measure pulse distance when combined with first as reference.

    • last: record the last timetag in the window.

  • time_ref

    Selects the time reference that the timetag is recorded in relation to. String enumeration, one of:

    • start (default): record relative to the start of the window.

    • end: record relative to the end of the window. Note that this always yields a negative timetag.

    • first: record relative to the first timetag in the window.

    • timestamp: record relative to the timestamp marked using the Timestamp operation.

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

  • fine_start_delay – Delays the start of the acquisition by the given amount in seconds. Does not delay the start time of the operation in the schedule. If the hardware supports it, this parameter can be used to shift the acquisition window by a small amount of time, independent of the hardware instruction timing grid. Currently only implemented for Qblox QTM modules, which allow only positive values for this parameter. By default 0.

  • fine_end_delay – Delays the end of the pulse by the given amount. Does not delay the end time of the operation in the schedule. If the hardware supports it, this parameter can be used to shift the acquisition window by a small amount of time, independent of the hardware instruction timing grid. Currently only implemented for Qblox QTM modules, which allow only positive values for this parameter. By default 0.

class TimetagTrace(duration: float, port: str, clock: str = DigitalClockResource.IDENTITY, acq_channel: int = 0, acq_index: int = 0, bin_mode: quantify_scheduler.enums.BinMode | str = BinMode.APPEND, time_ref: quantify_scheduler.enums.TimeRef | str = TimeRef.START, t0: float = 0, fine_start_delay: float = 0, fine_end_delay: float = 0)[source]#

Bases: Acquisition

The TimetagTrace acquisition protocol records timetags within an acquisition window.

Important

The exact duration of this operation, and the possible bin modes may depend on the control hardware. Please consult your hardware vendor’s Reference guide for more information.

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.APPEND” is available at the moment; this option concatenates timetag results with the same acquisition channel and index.

  • time_ref

    Selects the time reference that the timetag is recorded in relation to. String enumeration, one of:

    • start (default): record relative to the start of the window.

    • end: record relative to the end of the window. Note that this always yields a negative timetag.

    • first: syntactic sugar for first#, where # is the current channel.

    • timestamp: record relative to the timestamp marked using the Timestamp operation.

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

  • fine_start_delay – Delays the start of the acquisition by the given amount in seconds. Does not delay the start time of the operation in the schedule. If the hardware supports it, this parameter can be used to shift the acquisition window by a small amount of time, independent of the hardware instruction timing grid. Currently only implemented for Qblox QTM modules, which allow only positive values for this parameter. By default 0.

  • fine_end_delay – Delays the end of the pulse by the given amount in seconds. Does not delay the end time of the operation in the schedule. If the hardware supports it, this parameter can be used to shift the acquisition window by a small amount of time, independent of the hardware instruction timing grid. Currently only implemented for Qblox QTM modules, which allow only positive values for this parameter. By default 0.

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.

Important

The exact duration of this operation, and the possible bin modes may depend on the control hardware. Please consult your hardware vendor’s Reference guide for more information.

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 memory location that already contains values. Which bin mode can be used for Trace acquisitions may depend on the hardware. BinMode.AVERAGE, the default, works on most hardware. This bin mode stores the weighted average value of the new result and the old values. BinMode.FIRST is used for hardware where only the result of the first acquisition in a Schedule is stored, e.g. for a Trace acquisition with Qblox QTM modules.

  • 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, fine_start_delay: float = 0, fine_end_delay: 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.

Important

The exact duration of this operation, and the possible bin modes may depend on the control hardware. Please consult your hardware vendor’s Reference guide for more information.

Parameters:
  • port – The acquisition port.

  • clock – The clock used to demodulate the acquisition.

  • duration – The duration of the operation 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 “distribution” 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.

  • fine_start_delay – Delays the start of the acquisition by the given amount in seconds. Does not delay the start time of the operation in the schedule. If the hardware supports it, this parameter can be used to shift the acquisition window by a small amount of time, independent of the hardware instruction timing grid. Currently only implemented for Qblox QTM modules, which allow only positive values for this parameter. By default 0.

  • fine_end_delay – Delays the end of the pulse by the given amount in seconds. Does not delay the end time of the operation in the schedule. If the hardware supports it, this parameter can be used to shift the acquisition window by a small amount of time, independent of the hardware instruction timing grid. Currently only implemented for Qblox QTM modules, which allow only positive values for this parameter. 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 ConditionalOperation(body: quantify_scheduler.operations.operation.Operation | quantify_scheduler.schedules.schedule.Schedule, qubit_name: str, t0: float = 0.0, hardware_buffer_time: float = 0.0)[source]#

Bases: ControlFlowOperation

Conditional over another operation.

If a preceding thresholded acquisition on qubit_name results in a “1”, the body will be executed, otherwise it will generate a wait time that is equal to the time of the subschedule, to ensure the absolute timing of later operations remains consistent.

Parameters:
  • body – Operation to be conditionally played

  • qubit_name – Name of the qubit on which the body will be conditioned

  • t0 – Time offset, by default 0

  • hardware_buffer_time – Time buffer, by default 0

Example

A conditional reset can be implemented as follows:

example

Added in version 0.22.0: For some hardware specific implementations, a hardware_buffer_time might be required to ensure the correct timing of the operations. This will be added to the duration of the body to prevent overlap with other operations.

property body: quantify_scheduler.operations.operation.Operation | quantify_scheduler.schedules.schedule.Schedule#

Body of a control flow.

property duration: float#

Duration of a control flow.

class ControlFlowOperation(name: str)[source]#

Bases: quantify_scheduler.operations.operation.Operation

Control flow operation that can be used as an Operation in Schedule.

This is an abstract class. Each concrete implementation of the control flow operation decides how and when their body operation is executed.

property body: quantify_scheduler.operations.operation.Operation | quantify_scheduler.schedules.schedule.Schedule#
Abstractmethod:

Body of a control flow.

class ControlFlowSpec[source]#

Control flow specification to be used at Schedule.add.

The users can specify any concrete control flow with the control_flow argument to Schedule.add. The ControlFlowSpec is only a type which by itself cannot be used for the control_flow argument, use any concrete control flow derived from it.

abstract create_operation(body: quantify_scheduler.operations.operation.Operation | quantify_scheduler.schedules.schedule.Schedule) quantify_scheduler.operations.operation.Operation | quantify_scheduler.schedules.schedule.Schedule[source]#

Transform the control flow specification to an operation or schedule.

class LoopOperation(body: quantify_scheduler.operations.operation.Operation | quantify_scheduler.schedules.schedule.Schedule, repetitions: int, t0: float = 0.0)[source]#

Bases: ControlFlowOperation

Loop over another operation predefined times.

Repeats the operation defined in body repetitions times. The actual implementation depends on the backend.

Parameters:
  • body – Operation to be repeated

  • repetitions – Number of repetitions

  • t0 – Time offset, by default 0

property body: quantify_scheduler.operations.operation.Operation | quantify_scheduler.schedules.schedule.Schedule#

Body of a control flow.

property duration: float#

Duration of a control flow.

class CNOT(qC: str, qT: str, **device_overrides)[source]#

Bases: quantify_scheduler.operations.operation.Operation

Conditional-NOT gate, a common entangling gate.

Performs an X gate on the target qubit qT conditional on the state of the control qubit qC.

This operation can be represented by the following unitary:

\[\begin{split}\mathrm{CNOT} = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \\ \end{bmatrix}\end{split}\]
Parameters:
  • qC – The control qubit.

  • qT – The target qubit

  • device_overrides – Device level parameters that override device configuration values when compiling from circuit to device level.

class CZ(qC: str, qT: str, **device_overrides)[source]#

Bases: quantify_scheduler.operations.operation.Operation

Conditional-phase gate, a common entangling gate.

Performs a Z gate on the target qubit qT conditional on the state of the control qubit qC.

This operation can be represented by the following unitary:

\[\begin{split}\mathrm{CZ} = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & -1 \\ \end{bmatrix}\end{split}\]
Parameters:
  • qC – The control qubit.

  • qT – The target qubit

  • device_overrides – Device level parameters that override device configuration values when compiling from circuit to device level.

class X90(qubit: str, **device_overrides)[source]#

Bases: Rxy

A single qubit rotation of 90 degrees around the X-axis.

It is identical to the Rxy gate with theta=90 and phi=0

Defined by the unitary:

\[\begin{split}X90 = R_{X90} = \frac{1}{\sqrt{2}}\begin{bmatrix} 1 & -i \\ -i & 1 \\ \end{bmatrix}\end{split}\]
Parameters:
  • qubit – The target qubit.

  • device_overrides – Device level parameters that override device configuration values when compiling from circuit to device level.

qubit#
class Y90(qubit: str, **device_overrides)[source]#

Bases: Rxy

A single qubit rotation of 90 degrees around the Y-axis.

It is identical to the Rxy gate with theta=90 and phi=90

Defined by the unitary:

\[\begin{split}Y90 = R_{Y90} = \frac{1}{\sqrt{2}}\begin{bmatrix} 1 & -1 \\ 1 & 1 \\ \end{bmatrix}\end{split}\]
Parameters:
  • qubit – The target qubit.

  • device_overrides – Device level parameters that override device configuration values when compiling from circuit to device level.

class Z90(qubit: str, **device_overrides)[source]#

Bases: Rz

A single qubit rotation of 90 degrees around the Z-axis.

This operation can be represented by the following unitary:

\[\begin{split}Z90 = R_{Z90} = e^{-\frac{\pi/2}{2}}S = e^{-\frac{\pi/2}{2}}\sqrt{Z} = \frac{1}{\sqrt{2}}\begin{bmatrix} 1-i & 0 \\ 0 & 1+i \\ \end{bmatrix}\end{split}\]
Parameters:
  • qubit – The target qubit.

  • device_overrides – Device level parameters that override device configuration values when compiling from circuit to device level.

class H(*qubits: str, **device_overrides)[source]#

Bases: quantify_scheduler.operations.operation.Operation

A single qubit Hadamard gate.

Note that the gate uses \(R_z(\pi) = -iZ\), adding a global phase of \(-\pi/2\). This operation can be represented by the following unitary:

\[\begin{split}H = Y90 \cdot Z = \frac{-i}{\sqrt{2}}\begin{bmatrix} 1 & 1 \\ 1 & -1 \\ \end{bmatrix}\end{split}\]
Parameters:
  • qubit – The target qubit.

  • device_overrides – Device level parameters that override device configuration values when compiling from circuit to device level.

class Measure(*qubits: str, acq_channel: Hashable | None = None, acq_index: tuple[int, Ellipsis] | int | None = None, acq_protocol: Literal['SSBIntegrationComplex', 'Timetag', 'TimetagTrace', 'Trace', 'TriggerCount', 'NumericalSeparatedWeightedIntegration', 'NumericalWeightedIntegration', 'ThresholdedAcquisition'] | None = None, bin_mode: quantify_scheduler.enums.BinMode | str | None = None, feedback_trigger_label: str | None = None, **device_overrides)[source]#

Bases: quantify_scheduler.operations.operation.Operation

A projective measurement in the Z-basis.

The measurement is compiled according to the type of acquisition specified in the device configuration.

Note

Strictly speaking this is not a gate as it can not be described by a unitary.

Parameters:
  • qubits – The qubits you want to measure.

  • acq_channel – Only for special use cases. By default (if None): the acquisition channel specified in the device element is used. If set, this acquisition channel is used for this measurement.

  • acq_index – Index of the register where the measurement is stored. If None specified, this defaults to writing the result of all qubits to acq_index 0. By default None.

  • acq_protocol ("SSBIntegrationComplex" | "Trace" | "TriggerCount" | "NumericalSeparatedWeightedIntegration" | "NumericalWeightedIntegration" | None, optional) – Acquisition protocols that are supported. If None is specified, the default protocol is chosen based on the device and backend configuration. By default None.

  • bin_mode – The binning mode that is to be used. If not None, it will overwrite the binning mode used for Measurements in the circuit-to-device compilation step. By default None.

  • 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.

  • device_overrides – Device level parameters that override device configuration values when compiling from circuit to device level.

class Reset(*qubits: str, **device_overrides)[source]#

Bases: quantify_scheduler.operations.operation.Operation

Reset a qubit to the \(|0\rangle\) state.

The Reset gate is an idle operation that is used to initialize one or more qubits.

Note

Strictly speaking this is not a gate as it can not be described by a unitary.

Examples

The operation can be used in several ways:

from quantify_scheduler.operations.gate_library import Reset

reset_1 = Reset("q0")
reset_2 = Reset("q1", "q2")
reset_3 = Reset(*[f"q{i}" for i in range(3, 6)])
Parameters:
  • qubits – The qubit(s) to reset. NB one or more qubits can be specified, e.g., Reset("q0"), Reset("q0", "q1", "q2"), etc..

  • device_overrides – Device level parameters that override device configuration values when compiling from circuit to device level.

class Rxy(theta: float, phi: float, qubit: str, **device_overrides)[source]#

Bases: quantify_scheduler.operations.operation.Operation

A single qubit rotation around an axis in the equator of the Bloch sphere.

This operation can be represented by the following unitary as defined in https://doi.org/10.1109/TQE.2020.2965810:

\[\begin{split}\mathsf {R}_{xy} \left(\theta, \varphi\right) = \begin{bmatrix} \textrm {cos}(\theta /2) & -ie^{-i\varphi }\textrm {sin}(\theta /2) \\ -ie^{i\varphi }\textrm {sin}(\theta /2) & \textrm {cos}(\theta /2) \end{bmatrix}\end{split}\]
Parameters:
  • theta – Rotation angle in degrees, will be casted to the [-180, 180) domain.

  • phi – Phase of the rotation axis, will be casted to the [0, 360) domain.

  • qubit – The target qubit.

  • device_overrides – Device level parameters that override device configuration values when compiling from circuit to device level.

class Rz(theta: float, qubit: str, **device_overrides)[source]#

Bases: quantify_scheduler.operations.operation.Operation

A single qubit rotation about the Z-axis of the Bloch sphere.

This operation can be represented by the following unitary as defined in https://www.quantum-inspire.com/kbase/rz-gate/:

\[\begin{split}\mathsf {R}_{z} \left(\theta\right) = \begin{bmatrix} e^{-i\theta/2} & 0 \\ 0 & e^{i\theta/2} \end{bmatrix}\end{split}\]
Parameters:
  • theta – Rotation angle in degrees, will be cast to the [-180, 180) domain.

  • qubit – The target qubit.

  • device_overrides – Device level parameters that override device configuration values when compiling from circuit to device level.

class X(qubit: str, **device_overrides)[source]#

Bases: Rxy

A single qubit rotation of 180 degrees around the X-axis.

This operation can be represented by the following unitary:

\[\begin{split}X180 = R_{X180} = \begin{bmatrix} 0 & -i \\ -i & 0 \\ \end{bmatrix}\end{split}\]
Parameters:
  • qubit – The target qubit.

  • device_overrides – Device level parameters that override device configuration values when compiling from circuit to device level.

class Y(qubit: str, **device_overrides)[source]#

Bases: Rxy

A single qubit rotation of 180 degrees around the Y-axis.

It is identical to the Rxy gate with theta=180 and phi=90

Defined by the unitary:

\[\begin{split}Y180 = R_{Y180} = \begin{bmatrix} 0 & -1 \\ 1 & 0 \\ \end{bmatrix}\end{split}\]
Parameters:
  • qubit – The target qubit.

  • device_overrides – Device level parameters that override device configuration values when compiling from circuit to device level.

class Z(qubit: str, **device_overrides)[source]#

Bases: Rz

A single qubit rotation of 180 degrees around the Z-axis.

Note that the gate implements \(R_z(\pi) = -iZ\), adding a global phase of \(-\pi/2\). This operation can be represented by the following unitary:

\[\begin{split}Z180 = R_{Z180} = -iZ = e^{-\frac{\pi}{2}}Z = \begin{bmatrix} -i & 0 \\ 0 & i \\ \end{bmatrix}\end{split}\]
Parameters:
  • qubit – The target qubit.

  • device_overrides – Device level parameters that override device configuration values when compiling from circuit to device level.

class ChargeReset(*qubits: str)[source]#

Bases: quantify_scheduler.operations.operation.Operation

Prepare a NV to its negative charge state NV$^-$.

Create a new instance of ChargeReset operation that is used to initialize the charge state of an NV center.

Parameters:

qubit – The qubit to charge-reset. NB one or more qubits can be specified, e.g., ChargeReset("qe0"), ChargeReset("qe0", "qe1", "qe2"), etc..

class CRCount(*qubits: str, acq_channel: Hashable | None = None, acq_index: tuple[int, Ellipsis] | int = None, acq_protocol: Literal['Trace', 'TriggerCount', None] = None, bin_mode: quantify_scheduler.enums.BinMode = None)[source]#

Bases: quantify_scheduler.operations.operation.Operation

Operate ionization and spin pump lasers for charge and resonance counting.

Gate level description for an optical CR count measurement.

The measurement is compiled according to the type of acquisition specified in the device configuration.

Parameters:
  • qubits – The qubits you want to measure

  • acq_channel – Only for special use cases. By default (if None): the acquisition channel specified in the device element is used. If set, this acquisition channel is used for this measurement.

  • acq_index – Index of the register where the measurement is stored. If None specified, it will default to a list of zeros of len(qubits)

  • acq_protocol – Acquisition protocol (currently "TriggerCount" and "Trace") are supported. If None is specified, the default protocol is chosen based on the device and backend configuration.

  • bin_mode – The binning mode that is to be used. If not None, it will overwrite the binning mode used for Measurements in the quantum-circuit to quantum-device compilation step.

class Operation(name: str)[source]#

Bases: quantify_scheduler.json_utils.JSONSchemaValMixin, collections.UserDict

A representation of quantum circuit operations.

The Operation class is a JSON-compatible data structure that contains information on how to represent the operation on the quantum-circuit and/or the quantum-device layer. It also contains information on where the operation should be applied: the Resource s used.

An operation always has the following attributes:

  • duration (float): duration of the operation in seconds (can be 0).

  • hash (str): an auto generated unique identifier.

  • name (str): a readable identifier, does not have to be unique.

An Operation can contain information on several levels of abstraction. This information is used when different representations are required. Note that when initializing an operation not all of this information needs to be available as operations are typically modified during the compilation steps.

Tip

quantify_scheduler comes with a gate_library and a pulse_library , both containing common operations.

JSON schema of a valid Operation

JSON schema for a quantify sequencer operation.

type

object

properties

  • name

type

string

  • gate_info

type

object

properties

  • unitary

A unitary matrix describing the operation.

  • operation_type

Defines what class of operations this gate refers to (e.g. Rxy, CZ etc.).

type

string

  • qubits

A list of strings indicating the qubits the gate acts on. Valid qubits are strings that appear in the device_config.json file.

type

array

  • symmetric

A boolean to indicate whether a two qubit gate is symmetric. This is used in the device config compilation stage. By default, it is set as False

type

boolean

  • tex

latex snippet for plotting

type

string

  • plot_func

reference to a function for plotting this operation. If not specified, defaults to using gate_box().

type

string / null

additionalProperties

True

  • pulse_info

A list containing the pulses that are part of the operation

type

array

items

Info to generate an individual pulse.

type

object

properties

  • port

A string specifying the port used by the pulse.

type

string / null

  • clock

A string specifying the clock used to modulate the pulse.

type

string

  • wf_func

reference to a function to generate the pulse of this operation.

type

string / null

  • t0

Starting time of the pulse with respect to the start of the operation in seconds.

type

number

  • duration

The duration of the pulse in seconds.

type

number

  • acquisition_info

A list containing the acquisitions that are part of the operation

type

array

items

Info to generate an individual acquisition.

type

object

properties

  • port

A string specifying the port used by the acquisition.

type

string

  • clock

A string specifying the clock used to demodulate the acquisition.

type

string

  • t0

Starting time of the pulse with respect to the start of the operation in seconds.

type

number

  • duration

The duration of the acquisition in seconds.

type

number

  • acq_channel

The acquisition channel to use.

type

number

  • acq_index

The acquisition index where to store the result of the acquisition protocol.

type

number

  • acq_return_type

Describes the return type of an acquisition performed using this protocol.

additionalProperties

True

  • logic_info

Not Implemented.

additionalProperties

False

Note

Two different Operations containing the same information generate the same hash and are considered identical.

schema_filename = 'operation.json'#
_class_signature = None#
_duration: float = 0#
_update() None[source]#

Update the Operation’s internals.

property name: str#

Return the name of the operation.

property duration: float#

Determine operation duration from pulse_info.

If the operation contains no pulse info, it is assumed to be ideal and have zero duration.

property hash: str#

A hash based on the contents of the Operation.

Needs to be a str for easy compatibility with json.

classmethod _get_signature(parameters: dict) str[source]#

Returns the constructor call signature of this instance for serialization.

The string constructor representation can be used to recreate the object using eval(signature).

Parameters:

parameters (dict) – The current data dictionary.

add_gate_info(gate_operation: Operation) None[source]#

Updates self.data[‘gate_info’] with contents of gate_operation.

Parameters:

gate_operation – an operation containing gate_info.

add_device_representation(device_operation: Operation) None[source]#

Adds device-level representation details to the current operation.

Parameters:

device_operation – an operation containing the pulse_info and/or acquisition info describing how to represent the current operation at the quantum-device layer.

add_pulse(pulse_operation: Operation) None[source]#

Adds pulse_info of pulse_operation Operation to this Operation.

Parameters:

pulse_operation – an operation containing pulse_info.

add_acquisition(acquisition_operation: Operation) None[source]#

Adds acquisition_info of acquisition_operation Operation to this Operation.

Parameters:

acquisition_operation – an operation containing acquisition_info.

classmethod is_valid(object_to_be_validated: Operation) bool[source]#

Validates the object’s contents against the schema.

Additionally checks if the hash property of the object evaluates correctly.

property valid_gate: bool#

An operation is a valid gate if it has gate-level representation details.

property valid_pulse: bool#

An operation is a valid pulse if it has pulse-level representation details.

property valid_acquisition: bool#

An operation is a valid acquisition if it has pulse-level acquisition representation details.

property is_conditional_acquisition: bool#

An operation is conditional if one of the following holds, self is an an acquisition with a feedback_trigger_label assigned to it.

property is_control_flow: bool#

Determine if operation is a control flow operation.

Returns:

Whether the operation is a control flow operation.

Return type:

bool

property has_voltage_offset: bool#

Checks if the operation contains information for a voltage offset.

composite_square_pulse(square_amp: float, square_duration: float, square_port: str, square_clock: str, virt_z_parent_qubit_phase: float, virt_z_parent_qubit_clock: str, virt_z_child_qubit_phase: float, virt_z_child_qubit_clock: str, reference_magnitude: quantify_scheduler.operations.pulse_library.ReferenceMagnitude | None = None, t0: float = 0) quantify_scheduler.operations.pulse_library.SquarePulse[source]#

An example composite pulse to implement a CZ gate.

It applies the square pulse and then corrects for the phase shifts on both the qubits.

Parameters:
  • square_amp – Amplitude of the square envelope.

  • square_duration – The square pulse duration in seconds.

  • square_port – Port of the pulse, must be capable of playing a complex waveform.

  • square_clock – Clock used to modulate the pulse.

  • virt_z_parent_qubit_phase – The phase shift in degrees applied to the parent qubit.

  • virt_z_parent_qubit_clock – The clock of which to shift the phase applied to the parent qubit.

  • virt_z_child_qubit_phase – The phase shift in degrees applied to the child qubit.

  • virt_z_child_qubit_clock – The clock of which to shift the phase applied to the child qubit.

  • reference_magnitude (ReferenceMagnitude,) – Optional scaling value and unit for the unitless amplitude. Uses settings in hardware config if not provided.

  • t0 – Time in seconds when to start the pulses relative to the start time of the Operation in the Schedule.

Returns:

SquarePulse operation.

nv_spec_pulse_mw(duration: float, amplitude: float, clock: str, port: str, reference_magnitude: quantify_scheduler.operations.pulse_library.ReferenceMagnitude | None = None) quantify_scheduler.operations.pulse_library.SkewedHermitePulse[source]#

Generate hermite pulse for spectroscopy experiment.

This is a simplified version of the SkewedHermitePulse. It is not skewed. It also sets the phase to 0. This means that no rotation about the z-axis is applied on the qubit.

Parameters:
  • duration – Pulse duration in seconds

  • amplitude – Amplitude of the hermite pulse

  • skewness – Skewness of hermite pulse

  • clock – Name of clock for frequency modulation of hermite pulse

  • port – Name of port where hermite pulse is applied

  • reference_magnitude (ReferenceMagnitude,) – Optional scaling value and unit for the unitless amplitude. Uses settings in hardware config if not provided.

Returns:

Hermite pulse operation

phase_shift(theta: float, clock: str) quantify_scheduler.operations.pulse_library.ShiftClockPhase[source]#

Generate a ShiftClockPhase that shifts the phase of the clock by an angle theta.

Parameters:
  • theta – Angle to shift the clock by, in degrees.

  • clock – Name of the clock to shift.

Returns:

ShiftClockPhase operation.

rxy_drag_pulse(amp180: float, motzoi: float, theta: float, phi: float, port: str, duration: float, clock: str, reference_magnitude: quantify_scheduler.operations.pulse_library.ReferenceMagnitude | None = None) quantify_scheduler.operations.pulse_library.DRAGPulse[source]#

Generate a DRAGPulse that achieves the right rotation angle theta based on a calibrated pi-pulse amplitude and motzoi parameter based on linear interpolation of the pulse amplitudes.

Parameters:
  • amp180 – Unitless amplitude of excitation pulse to get the maximum 180 degree theta.

  • motzoi – Unitless amplitude of the derivative component, the DRAG-pulse parameter.

  • theta – Angle in degrees to rotate around an equatorial axis on the Bloch sphere.

  • phi – Phase of the pulse in degrees.

  • port – Name of the port where the pulse is played.

  • duration – Duration of the pulse in seconds.

  • clock – Name of the clock used to modulate the pulse.

  • reference_magnitude (ReferenceMagnitude,) – Optional scaling value and unit for the unitless amplitude. Uses settings in hardware config if not provided.

Returns:

DRAGPulse operation.

rxy_gauss_pulse(amp180: float, theta: float, phi: float, port: str, duration: float, clock: str, reference_magnitude: quantify_scheduler.operations.pulse_library.ReferenceMagnitude | None = None) quantify_scheduler.operations.pulse_library.GaussPulse[source]#

Generate a Gaussian drive with GaussPulse that achieves the right rotation angle theta based on a calibrated pi-pulse amplitude.

Parameters:
  • amp180 – Unitless amplitude of excitation pulse to get the maximum 180 degree theta.

  • theta – Angle in degrees to rotate around an equatorial axis on the Bloch sphere.

  • phi – Phase of the pulse in degrees.

  • port – Name of the port where the pulse is played.

  • duration – Duration of the pulse in seconds.

  • clock – Name of the clock used to modulate the pulse.

  • reference_magnitude (ReferenceMagnitude,) – Optional scaling value and unit for the unitless amplitude. Uses settings in hardware config if not provided.

Returns:

GaussPulse operation.

rxy_hermite_pulse(amp180: float, skewness: float, theta: float, phi: float, port: str, duration: float, clock: str, reference_magnitude: quantify_scheduler.operations.pulse_library.ReferenceMagnitude | None = None) quantify_scheduler.operations.pulse_library.SkewedHermitePulse[source]#

Generate a Gaussian drive with GaussPulse that achieves the right rotation angle theta based on a calibrated pi-pulse amplitude.

Parameters:
  • amp180 – Unitless amplitude of excitation pulse to get the maximum 180 degree theta.

  • skewness – First-order amplitude correction to the Hermite pulse. Skewness of 0 returns a standard hermite pulse.

  • theta – Angle in degrees to rotate around an equatorial axis on the Bloch sphere.

  • phi – Phase of the pulse in degrees.

  • port – Name of the port where the pulse is played.

  • duration – Duration of the pulse in seconds.

  • clock – Name of the clock used to modulate the pulse.

  • reference_magnitude (ReferenceMagnitude,) – hardware config if not provided.

Returns:

GaussPulse operation.

spin_init_pulse(square_duration: float, ramp_diff: float, parent_port: str, parent_clock: str, parent_square_amp: float, parent_ramp_amp: float, parent_ramp_rate: float, child_port: str, child_clock: str, child_square_amp: float, child_ramp_amp: float, child_ramp_rate: float) quantify_scheduler.schedules.Schedule[source]#

Device compilation of the spin init operation.

class ChirpPulse(amp: float, duration: float, port: str, clock: str, start_freq: float, end_freq: float, reference_magnitude: ReferenceMagnitude | None = None, t0: float = 0)[source]#

Bases: quantify_scheduler.operations.operation.Operation

A linear chirp signal. A sinusoidal signal that ramps up in frequency.

Parameters:
  • amp – Unitless amplitude of the envelope.

  • duration – Duration of the pulse.

  • port – The port of the pulse.

  • clock – Clock used to modulate the pulse.

  • start_freq – Start frequency of the Chirp. Note that this is the frequency at which the waveform is calculated, this may differ from the clock frequency.

  • end_freq – End frequency of the Chirp.

  • reference_magnitude – Scaling value and unit for the unitless amplitude. Uses settings in hardware config if not provided.

  • t0 – Shift of the start time with respect to the start of the operation.

class DRAGPulse(G_amp: float, D_amp: float, phase: float, duration: float, port: str, clock: str, reference_magnitude: ReferenceMagnitude | None = None, sigma: float = None, t0: float = 0)[source]#

Bases: quantify_scheduler.operations.operation.Operation

A Gaussian pulse with a derivative component added to the out-of-phase channel. It uses the specified amplitude and sigma. If sigma is not specified it is set to 1/4 of the duration.

The DRAG pulse is intended for single qubit gates in transmon based systems. It can be calibrated to reduce unwanted excitations of the \(|1\rangle - |2\rangle\) transition (Motzoi et al. [MGRW09] and Gambetta et al. [GMMW11]).

The waveform is generated using waveforms.drag() .

Parameters:
  • G_amp – Unitless amplitude of the Gaussian envelope.

  • D_amp – Unitless amplitude of the derivative component, the DRAG-pulse parameter.

  • duration – The pulse duration in seconds.

  • phase – Phase of the pulse in degrees.

  • clock – Clock used to modulate the pulse.

  • port – Port of the pulse, must be capable of carrying a complex waveform.

  • reference_magnitude – Scaling value and unit for the unitless amplitude. Uses settings in hardware config if not provided.

  • sigma – Width of the Gaussian envelope in seconds. If not provided, the sigma is set to 1/4 of the duration.

  • t0 – Time in seconds when to start the pulses relative to the start time of the Operation in the Schedule.

class GaussPulse(G_amp: float, phase: float, duration: float, port: str, clock: str = BasebandClockResource.IDENTITY, reference_magnitude: ReferenceMagnitude | None = None, sigma: float = None, t0: float = 0)[source]#

Bases: quantify_scheduler.operations.operation.Operation

The GaussPulse Operation is a real-valued pulse with the specified amplitude and sigma. If sigma is not specified it is set to 1/4 of the duration.

The waveform is generated using waveforms.drag() whith a D_amp set to zero, corresponding to a Gaussian pulse.

Parameters:
  • G_amp – Unitless amplitude of the Gaussian envelope.

  • duration – The pulse duration in seconds.

  • phase – Phase of the pulse in degrees.

  • clock – Clock used to modulate the pulse. By default the baseband clock.

  • port – Port of the pulse, must be capable of carrying a complex waveform.

  • reference_magnitude – Scaling value and unit for the unitless amplitude. Uses settings in hardware config if not provided.

  • sigma – Width of the Gaussian envelope in seconds. If not provided, the sigma is set to 1/4 of the duration.

  • t0 – Time in seconds when to start the pulses relative to the start time of the Operation in the Schedule.

class IdlePulse(duration: float)[source]#

Bases: quantify_scheduler.operations.operation.Operation

The IdlePulse Operation is a placeholder for a specified duration of time.

Parameters:

duration – The duration of idle time in seconds.

class MarkerPulse(duration: float, port: str, t0: float = 0, clock: str = DigitalClockResource.IDENTITY, fine_start_delay: float = 0, fine_end_delay: float = 0)[source]#

Bases: quantify_scheduler.operations.operation.Operation

Digital pulse that is HIGH for the specified duration.

Marker pulse is played on marker output. Currently only implemented for Qblox backend.

Parameters:
  • duration – Duration of the HIGH signal.

  • port – Name of the associated port.

  • t0 – Time in seconds when to start the pulses relative to the start time of the Operation in the Schedule.

  • clock – Name of the associated clock. By default DigitalClockResource. This only needs to be specified if a custom clock name is used for a digital channel (for example, when a port-clock combination of a device element is used with a digital channel).

  • fine_start_delay – Delays the start of the pulse by the given amount in seconds. Does not delay the start time of the operation in the schedule. If the hardware supports it, this parameter can be used to shift the pulse by a small amount of time, independent of the hardware instruction timing grid. Currently only implemented for Qblox QTM modules, which allow only positive values for this parameter. By default 0.

  • fine_end_delay – Delays the end of the pulse by the given amount in seconds. Does not delay the end time of the operation in the schedule. If the hardware supports it, this parameter can be used to shift the pulse by a small amount of time, independent of the hardware instruction timing grid. Currently only implemented for Qblox QTM modules, which allow only positive values for this parameter. By default 0.

class NumericalPulse(samples: numpy.ndarray | list, t_samples: numpy.ndarray | list, port: str, clock: str = BasebandClockResource.IDENTITY, reference_magnitude: ReferenceMagnitude | None = None, t0: float = 0, interpolation: str = 'linear')[source]#

Bases: quantify_scheduler.operations.operation.Operation

A pulse where the shape is determined by specifying an array of (complex) points.

If points are required between the specified samples (such as could be required by the sampling rate of the hardware), meaning \(t[n] < t' < t[n+1]\), scipy.interpolate.interp1d will be used to interpolate between the two points and determine the value.

Parameters:
  • samples – An array of (possibly complex) values specifying the shape of the pulse.

  • t_samples – An array of values specifying the corresponding times at which the samples are evaluated.

  • port – The port that the pulse should be played on.

  • clock – Clock used to (de)modulate the pulse. By default the baseband clock.

  • reference_magnitude – Scaling value and unit for the unitless samples. Uses settings in hardware config if not provided.

  • t0 – Time in seconds when to start the pulses relative to the start time of the Operation in the Schedule.

  • interpolation – Specifies the type of interpolation used. This is passed as the “kind” argument to scipy.interpolate.interp1d.

class RampPulse(amp: float, duration: float, port: str, clock: str = BasebandClockResource.IDENTITY, reference_magnitude: ReferenceMagnitude | None = None, offset: float = 0, t0: float = 0)[source]#

Bases: quantify_scheduler.operations.operation.Operation

RampPulse Operation is a pulse that ramps from zero to a set amplitude over its duration.

The pulse is given as a function of time \(t\) and the parameters offset and amplitude by

\[P(t) = \mathrm{offset} + t \times \mathrm{amp}.\]
Parameters:
  • amp – Unitless amplitude of the ramp envelope function.

  • duration – The pulse duration in seconds.

  • offset – Starting point of the ramp pulse

  • port – Port of the pulse.

  • clock – Clock used to modulate the pulse. By default the baseband clock.

  • reference_magnitude – Scaling value and unit for the unitless amplitude. Uses settings in hardware config if not provided.

  • t0 – Time in seconds when to start the pulses relative to the start time of the Operation in the Schedule.

class ReferenceMagnitude[source]#

Dataclass defining a reference level for pulse amplitudes in units of ‘V’, ‘dBm’, or ‘A’.

value: float#
unit: Literal['V', 'dBm', 'A']#
classmethod from_parameter(parameter: qcodes.InstrumentChannel) ReferenceMagnitude | None[source]#

Initialize from ReferenceMagnitude QCoDeS InstrumentChannel values.

class ResetClockPhase(clock: str, t0: float = 0)[source]#

Bases: quantify_scheduler.operations.operation.Operation

An operation that resets the phase of a clock.

Parameters:

clock – The clock of which to reset the phase.

class SetClockFrequency(clock: str, clock_freq_new: float | None, t0: float = 0)[source]#

Bases: quantify_scheduler.operations.operation.Operation

Operation that sets updates the frequency of a clock.

This is a low-level operation and therefore depends on the backend.

Currently only implemented for Qblox backend, refer to NcoSetClockFrequencyStrategy for more details.

Parameters:
  • clock – The clock for which a new frequency is to be set.

  • clock_freq_new – The new frequency in Hz. If None, it will reset to the clock frequency set by the configuration or resource.

  • t0 – Time in seconds when to execute the command relative to the start time of the Operation in the Schedule.

  • duration – (deprecated) The duration of the operation in seconds.

class ShiftClockPhase(phase_shift: float, clock: str, t0: float = 0)[source]#

Bases: quantify_scheduler.operations.operation.Operation

Operation that shifts the phase of a clock by a specified amount.

This is a low-level operation and therefore depends on the backend.

Currently only implemented for Qblox backend, refer to NcoPhaseShiftStrategy for more details.

Parameters:
  • phase_shift – The phase shift in degrees.

  • clock – The clock of which to shift the phase.

  • t0 – Time in seconds when to execute the command relative to the start time of the Operation in the Schedule.

  • duration – (deprecated) The duration of the operation in seconds.

class SkewedHermitePulse(duration: float, amplitude: float, skewness: float, phase: float, port: str, clock: str, reference_magnitude: ReferenceMagnitude | None = None, t0: float = 0)[source]#

Bases: quantify_scheduler.operations.operation.Operation

Hermite pulse intended for single qubit gates in diamond based systems.

The waveform is generated using skewed_hermite().

Parameters:
  • duration – The pulse duration in seconds.

  • amplitude – Unitless amplitude of the hermite pulse.

  • skewness – Skewness in the frequency space.

  • phase – Phase of the pulse in degrees.

  • clock – Clock used to modulate the pulse.

  • port – Port of the pulse, must be capable of carrying a complex waveform.

  • reference_magnitude – Scaling value and unit for the unitless amplitude. Uses settings in hardware config if not provided.

  • t0 – Time in seconds when to start the pulses relative to the start time of the Operation in the Schedule. By default 0.

class SoftSquarePulse(amp: float, duration: float, port: str, clock: str = BasebandClockResource.IDENTITY, reference_magnitude: ReferenceMagnitude | None = None, t0: float = 0)[source]#

Bases: quantify_scheduler.operations.operation.Operation

A real valued square pulse convolved with a Hann window for smoothing.

Parameters:
  • amp – Unitless amplitude of the envelope.

  • duration – The pulse duration in seconds.

  • port – Port of the pulse, must be capable of playing a complex waveform.

  • clock – Clock used to modulate the pulse. By default the baseband clock.

  • reference_magnitude – Scaling value and unit for the unitless amplitude. Uses settings in hardware config if not provided.

  • t0 – Time in seconds when to start the pulses relative to the start time of the Operation in the Schedule.

class SquarePulse(amp: complex, duration: float, port: str, clock: str = BasebandClockResource.IDENTITY, reference_magnitude: ReferenceMagnitude | None = None, t0: float = 0)[source]#

Bases: quantify_scheduler.operations.operation.Operation

A real-valued pulse with the specified amplitude during the pulse.

Parameters:
  • amp – Unitless complex valued amplitude of the envelope.

  • duration – The pulse duration in seconds.

  • port – Port of the pulse, must be capable of playing a complex waveform.

  • clock – Clock used to modulate the pulse. By default the baseband clock.

  • reference_magnitude – Scaling value and unit for the unitless amplitude. Uses settings in hardware config if not provided.

  • t0 – Time in seconds when to start the pulses relative to the start time of the Operation in the Schedule.

class StaircasePulse(start_amp: float, final_amp: float, num_steps: int, duration: float, port: str, clock: str = BasebandClockResource.IDENTITY, reference_magnitude: ReferenceMagnitude | None = None, t0: float = 0)[source]#

Bases: quantify_scheduler.operations.operation.Operation

A real valued staircase pulse, which reaches it’s final amplitude in discrete steps.

In between it will maintain a plateau.

Parameters:
  • start_amp – Starting unitless amplitude of the staircase envelope function.

  • final_amp – Final unitless amplitude of the staircase envelope function.

  • num_steps – The number of plateaus.

  • duration – Duration of the pulse in seconds.

  • port – Port of the pulse.

  • clock – Clock used to modulate the pulse. By default the baseband clock.

  • reference_magnitude – Scaling value and unit for the unitless amplitude. Uses settings in hardware config if not provided.

  • t0 – Time in seconds when to start the pulses relative to the start time of the Operation in the Schedule.

class SuddenNetZeroPulse(amp_A: float, amp_B: float, net_zero_A_scale: float, t_pulse: float, t_phi: float, t_integral_correction: float, port: str, clock: str = BasebandClockResource.IDENTITY, reference_magnitude: ReferenceMagnitude | None = None, t0: float = 0)[source]#

Bases: quantify_scheduler.operations.operation.Operation

A pulse that can be used to implement a conditional phase gate in transmon qubits.

The sudden net-zero (SNZ) pulse is defined in Negîrneac et al. [NAM+21].

Parameters:
  • amp_A – Unitless amplitude of the main square pulse.

  • amp_B – Unitless scaling correction for the final sample of the first square and first sample of the second square pulse.

  • net_zero_A_scale – Amplitude scaling correction factor of the negative arm of the net-zero pulse.

  • t_pulse – The total duration of the two half square pulses

  • t_phi – The idling duration between the two half pulses

  • t_integral_correction – The duration in which any non-zero pulse amplitude needs to be corrected.

  • port – Port of the pulse, must be capable of playing a complex waveform.

  • clock – Clock used to modulate the pulse. By default the baseband clock.

  • reference_magnitude – Scaling value and unit for the unitless amplitude. Uses settings in hardware config if not provided.

  • t0 – Time in seconds when to start the pulses relative to the start time of the Operation in the Schedule.

class Timestamp(port: str, t0: float = 0, clock: str = DigitalClockResource.IDENTITY)[source]#

Bases: quantify_scheduler.operations.operation.Operation

Operation that marks a time reference for timetags.

Specifically, all timetags in Timetag and TimetagTrace are measured relative to the timing of this operation, if they have a matching port and clock, and if time_ref=TimeRef.TIMESTAMP is given as an argument.

Parameters:
  • port – The same port that the timetag acquisition is defined on.

  • clock – The same clock that the timetag acquisition is defined on.

  • t0 – Time offset (in seconds) of this Operation, relative to the start time in the Schedule. By default 0.

class VoltageOffset(offset_path_I: float, offset_path_Q: float, port: str, clock: str = BasebandClockResource.IDENTITY, t0: float = 0, reference_magnitude: ReferenceMagnitude | None = None)[source]#

Bases: quantify_scheduler.operations.operation.Operation

Operation that represents setting a constant offset to the output voltage.

Please refer to Voltage offsets in the reference guide for more details.

Parameters:
  • offset_path_I (float) – Offset of path I.

  • offset_path_Q (float) – Offset of path Q.

  • port (str) – Port of the voltage offset.

  • clock (str, optional) – Clock used to modulate the voltage offset. By default the baseband clock.

  • duration (float, optional) – (deprecated) The time to hold the offset for (in seconds).

  • t0 (float, optional) – Time in seconds when to start the pulses relative to the start time of the Operation in the Schedule.

  • reference_magnitude – Scaling value and unit for the unitless amplitude. Uses settings in hardware config if not provided.

class WindowOperation(window_name: str, duration: float, t0: float = 0.0)[source]#

Bases: quantify_scheduler.operations.operation.Operation

The WindowOperation is an operation for visualization purposes.

The WindowOperation has a starting time and duration.

property window_name: str#

Return the window name of this operation.