qblox_scheduler.qblox.operations#
Module containing qblox specific operations.
Classes#
Conditional over another operation. |
|
Reset a qubit to the \(|0\rangle\) state. |
|
Operation that resets the feedback trigger addresses from the hardware. |
|
Wrapper on top of NumericalPulse to provide a simple interface for creating a pulse |
Package 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.ConditionalOperationConditional over another operation.
If a preceding thresholded acquisition on
qubit_nameresults 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': 'd77fb23e-19bc-41da-b61c-d6fec15ef176', 'operation_id': '4429412601422503962', 'timing_constraints': [TimingConstraint(ref_schedulable=None, ref_pt=None, ref_pt_new=None, rel_time=3.64e-07)], 'label': 'd77fb23e-19bc-41da-b61c-d6fec15ef176'}Added in version 0.22.0: For some hardware specific implementations, a
hardware_buffer_timemight be required to ensure the correct timing of the operations. This will be added to the duration of thebodyto prevent overlap with other operations.
- class ConditionalReset(qubit_name: str, name: str = 'conditional_reset', **kwargs)[source]#
Bases:
qblox_scheduler.operations.conditional_reset.ConditionalResetReset a qubit to the \(|0\rangle\) state.
The
ConditionalResetgate is a conditional gate that first measures the state of the device element using anThresholdedAcquisitionoperation and then performs a \(\pi\) rotation on the condition that the measured state is \(|1\rangle\). If the measured state is in \(|0\rangle\), the hardware will wait the same amount of time the \(\pi\) rotation would’ve taken to ensure that total execution time ofConditionalResetis the same regardless of the measured state.Note
The total time of the ConditionalReset is the sum of
integration time (<device_element>.measure.integration_time)
acquisition delay (<device_element>.measure.acq_delay)
trigger delay (364ns)
pi-pulse duration (<device_element>.rxy.duration)
idle time (4ns)
Note
Due to current hardware limitations, overlapping conditional resets might not work correctly if multiple triggers are sent within a 364ns window. See sec-qblox-conditional-playback for more information.
Note
ConditionalResetis currently implemented as a subschedule, but can be added to an existing schedule as if it were a gate. See examples below.- Parameters:
Examples
from qblox_scheduler import Schedule from qblox_scheduler.operations import ConditionalReset schedule = Schedule("example schedule") schedule.add(ConditionalReset("q0"))
- class LatchReset(portclock: tuple[str, str], t0: float = 0, duration: float = 4e-09)[source]#
Bases:
qblox_scheduler.operations.hardware_operations.pulse_library.LatchResetOperation that resets the feedback trigger addresses from the hardware.
Currently only implemented for Qblox backend, refer to
ResetFeedbackTriggersStrategyfor 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.hardware_operations.pulse_library.SimpleNumericalPulseWrapper 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': '36a959c1-9f30-4096-a865-fcc11bfccd75', 'operation_id': '952497686065334088', 'timing_constraints': [TimingConstraint(ref_schedulable=None, ref_pt=None, ref_pt_new=None, rel_time=0)], 'label': '36a959c1-9f30-4096-a865-fcc11bfccd75'}