qblox_scheduler.operations.hardware_operations#

Hardware specific operations

Submodules#

Classes#

InlineQ1ASM

Initialize an InlineQ1ASM operation.

LatchReset

Operation that resets the feedback trigger addresses from the hardware.

SimpleNumericalPulse

Wrapper on top of NumericalPulse to provide a simple interface for creating a pulse

Functions#

long_chirp_pulse(...)

Create a long chirp pulse using SetClockFrequency.

long_ramp_pulse(...)

Creates a long ramp pulse by stitching together shorter ramps.

long_square_pulse(...)

Create a long square pulse using DC voltage offsets.

staircase_pulse(...)

Create a staircase-shaped pulse using DC voltage offsets.

Package Contents#

class InlineQ1ASM(program: str, duration: float, port: str, clock: str, *, waveforms: dict | None = None, safe_labels: bool = True)[source]#

Bases: qblox_scheduler.operations.operation.Operation

Initialize an InlineQ1ASM operation.

This method sets up an operation that contains inline Q1ASM code

to be injected directly into a Schedule.

All comments in the program will be prefixed with an ‘[inline]’ prefix to help identify the inline assembly within the sequencer program.

When using safe labels, then all labels included in the input program will get a prefix of ‘inj<digits>_’. By default, safe labels are always used. Labels in comments will not be modified.

Parameters:
  • program – The Q1ASM program to be injected.

  • duration – The duration of the operation in seconds.

  • port – The port on which the operation is to be executed.

  • clock – The clock associated with the operation.

  • waveforms – Dictionary containing waveform information, by default None.

  • safe_labels – Flag to indicate if safe labels should be used, by default True.

Returns:

None

Notes

Warning

When using safe_labels=False then all labels in the sequencer program are accessible from inside the inline Q1ASM injection, and so can be jumped to or overwritten. Disabling this feature is available for debugging and advanced compilation strategies only.

_name = 'InlineQ1ASM'#
program#
_duration#
port#
clock#
waveforms#
safe_labels = True#
property name: str#

Return the name of the operation.

_update() None[source]#

Update the Operation’s internals.

get_used_port_clocks() set[tuple[str, str]][source]#

Extracts which port-clock combinations are used in this operation.

Returns:

: All (port, clock) combinations this operation uses.

long_chirp_pulse(amp: float, duration: float, port: str, start_freq: float, end_freq: float, clock: str = BasebandClockResource.IDENTITY, t0: float = 0, part_duration_ns: int = constants.STITCHED_PULSE_PART_DURATION_NS, reference_magnitude: qblox_scheduler.operations.pulse_library.ReferenceMagnitude | None = None) qblox_scheduler.schedules.schedule.TimeableSchedule[source]#

Create a long chirp pulse using SetClockFrequency.

Parameters:
  • amp (float) – Amplitude of the envelope.

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

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

  • start_freq (float) – 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 (float) – End frequency of the Chirp.

  • clock (str, Optional) – Clock used to modulate the pulse. By default the baseband clock.

  • t0 (float, Optional) – Time in seconds when to start the pulses relative to the start time of the Operation in the TimeableSchedule. By default 0.

  • part_duration_ns (int, Optional) – Chunk size in nanoseconds.

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

Returns:

TimeableSchedule A TimeableSchedule object describing a chirp pulse.

Raises:

ValueError – When the duration of the pulse is not a multiple of grid_time_ns.

long_ramp_pulse(amp: float, duration: float, port: str, offset: float = 0, clock: str = BasebandClockResource.IDENTITY, t0: float = 0, part_duration_ns: int = constants.STITCHED_PULSE_PART_DURATION_NS, reference_magnitude: qblox_scheduler.operations.pulse_library.ReferenceMagnitude | None = None) qblox_scheduler.schedules.schedule.TimeableSchedule[source]#

Creates a long ramp pulse by stitching together shorter ramps.

This function creates a long ramp pulse by stitching together ramp pulses of the specified duration part_duration_ns, with DC voltage offset instructions placed in between.

Warning

This function creates a TimeableSchedule object, containing a combination of voltage offsets and waveforms. Overlapping Schedules with VoltageOffsets in time on the same port and clock may lead to unexpected results.

Parameters:
  • amp (float) – Amplitude of the ramp envelope function.

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

  • port (str) – Port of the pulse.

  • offset (float, Optional) – Starting point of the ramp pulse. By default 0.

  • clock (str, Optional) – Clock used to modulate the pulse, by default the baseband clock.

  • t0 (float, Optional) – Time in seconds when to start the pulses relative to the start time of the Operation in the TimeableSchedule. By default 0.

  • part_duration_ns (int, Optional) – Duration of each partial ramp in nanoseconds, by default STITCHED_PULSE_PART_DURATION_NS.

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

Returns:

TimeableSchedule A TimeableSchedule composed of shorter ramp pulses with varying DC offsets, forming one long ramp pulse.

long_square_pulse(amp: complex | qblox_scheduler.operations.variables.Variable | collections.abc.Sequence[float | qblox_scheduler.operations.variables.Variable], duration: float, port: str, clock: str = BasebandClockResource.IDENTITY, t0: float = 0, reference_magnitude: qblox_scheduler.operations.pulse_library.ReferenceMagnitude | None = None) qblox_scheduler.schedules.schedule.TimeableSchedule[source]#

Create a long square pulse using DC voltage offsets.

Warning

This function creates a TimeableSchedule object, containing a combination of voltage offsets and waveforms. Overlapping Schedules with VoltageOffsets in time on the same port and clock may lead to unexpected results.

Parameters:
  • amp (float) – Amplitude of the envelope.

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

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

  • clock (str, Optional) – Clock used to modulate the pulse. By default the baseband clock.

  • t0 (float, Optional) – Time in seconds when to start the pulses relative to the start time of the Operation in the TimeableSchedule. By default 0.

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

Returns:

TimeableSchedule A Schedule object containing an offset instruction with the specified amplitude.

Raises:

ValueError – When the duration of the pulse is not a multiple of grid_time_ns.

staircase_pulse(start_amp: float, final_amp: float, num_steps: int, duration: float, port: str, clock: str = BasebandClockResource.IDENTITY, t0: float = 0, min_operation_time_ns: int = constants.MIN_TIME_BETWEEN_OPERATIONS, reference_magnitude: qblox_scheduler.operations.pulse_library.ReferenceMagnitude | None = None) qblox_scheduler.schedules.schedule.TimeableSchedule[source]#

Create a staircase-shaped pulse using DC voltage offsets.

This function generates a real valued staircase pulse, which reaches its final amplitude in discrete steps. In between it will maintain a plateau.

Warning

This function creates a TimeableSchedule object, containing a combination of voltage offsets and waveforms. Overlapping Schedules with VoltageOffsets in time on the same port and clock may lead to unexpected results.

Parameters:
  • start_amp (float) – Starting amplitude of the staircase envelope function.

  • final_amp (float) – Final amplitude of the staircase envelope function.

  • num_steps (int) – The number of plateaus.

  • duration (float) – Duration of the pulse in seconds.

  • port (str) – Port of the pulse.

  • clock (str, Optional) – Clock used to modulate the pulse. By default the baseband clock.

  • t0 (float, Optional) – Time in seconds when to start the pulses relative to the start time of the Operation in the TimeableSchedule. By default 0.

  • min_operation_time_ns (int, Optional) – Min operation time in ns. The duration of the long_square_pulse must be a multiple of this. By default equal to the min operation time time of Qblox modules.

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

Returns:

TimeableSchedule A Schedule object containing incrementing or decrementing offset instructions.

Raises:

ValueError – When the duration of a step is not a multiple of grid_time_ns.

class LatchReset(portclock: tuple[str, str], t0: float = 0, duration: float = 4e-09)[source]#

Bases: qblox_scheduler.operations.operation.Operation

Operation that resets the feedback trigger addresses from the hardware.

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

class SimpleNumericalPulse(samples: numpy.ndarray | list, port: str, clock: str = BasebandClockResource.IDENTITY, gain: complex | float | operations.expressions.Expression | collections.abc.Sequence[complex | float | operations.expressions.Expression] = 1, reference_magnitude: qblox_scheduler.operations.pulse_library.ReferenceMagnitude | None = None, t0: float = 0)[source]#

Bases: qblox_scheduler.operations.pulse_library.NumericalPulse

Wrapper on top of NumericalPulse to provide a simple interface for creating a pulse where the samples correspond 1:1 to the produced waveform, without needing to specify the time samples.

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

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

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

  • gain – Gain factor between -1 and 1 that multiplies with the samples, by default 1.

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

Example

from qblox_scheduler.operations.hardware_operations.pulse_library import (
    SimpleNumericalPulse
)
from qblox_scheduler import TimeableSchedule

waveform = [0.1,0.2,0.2,0.3,0.5,0.4]

schedule = TimeableSchedule("")
schedule.add(SimpleNumericalPulse(waveform, port="q0:out"))
{'name': 'ba29132b-79d9-47e4-b6db-6c69dca146de', 'operation_id': '-135102125071996548', 'timing_constraints': [TimingConstraint(ref_schedulable=None, ref_pt=None, ref_pt_new=None, rel_time=0)], 'label': 'ba29132b-79d9-47e4-b6db-6c69dca146de'}