qblox_scheduler.backends.qblox.operations.control_flow_library#

Contains the control flow operations for the Qblox backend.

Classes#

ConditionalOperation

Conditional over another operation.

Module Contents#

class ConditionalOperation(body: qblox_scheduler.operations.operation.Operation | qblox_scheduler.schedules.schedule.TimeableSchedule | qblox_scheduler.schedule.Schedule, qubit_name: str, t0: float = 0.0, hardware_buffer_time: float = constants.MIN_TIME_BETWEEN_OPERATIONS * 1e-09)[source]#

Bases: qblox_scheduler.operations.control_flow_library.ConditionalOperation

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 device element on which the body will be conditioned

  • t0 – Time offset, by default 0

  • hardware_buffer_time – Time buffer, by default the minimum time between operations on the hardware

Example

A conditional reset can be implemented as follows:

# relevant imports
from qblox_scheduler import Schedule
from qblox_scheduler.operations import ConditionalOperation, Measure, X

# define conditional reset as a Schedule
conditional_reset = Schedule("conditional reset")
conditional_reset.add(Measure("q0", feedback_trigger_label="q0"))
conditional_reset.add(
    ConditionalOperation(body=X("q0"), qubit_name="q0"),
    rel_time=364e-9,
)
{'name': '4fdf8d69-af94-4673-aa7d-ac33c611bdc8', 'operation_id': '-3737101579164879377', 'timing_constraints': [TimingConstraint(ref_schedulable=None, ref_pt=None, ref_pt_new=None, rel_time=3.64e-07)], 'label': '4fdf8d69-af94-4673-aa7d-ac33c611bdc8'}

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.