qblox_scheduler.operations.pulse_factories#
A module containing factory functions for pulses on the quantum-device layer.
These factories are used to take a parametrized representation of on a operation and use that to create an instance of the operation itself.
Functions#
|
If is_phase_shift, then we use the phase_shift argument of the pulse_cls |
|
Generate a |
|
Generate a Gaussian drive with |
|
Generate a |
An example composite pulse to implement a CZ gate. |
|
|
Generate a Hermite or Gaussian drive pulse for a specified rotation on the Bloch sphere. |
|
Generate a microwave pulse for spectroscopy experiments. |
|
Device compilation of the spin init operation. |
Raise an error indicating that the requested gate or pulse is not implemented. |
Module Contents#
- _add_phase_to_pulse(is_phase_shift: bool, pulse_cls: type, phase: float | qblox_scheduler.operations.expressions.Expression, **pulse_kwargs) qblox_scheduler.schedules.TimeableSchedule | qblox_scheduler.operations.Operation[source]#
If is_phase_shift, then we use the phase_shift argument of the pulse_cls instead of the phase argument. This is needed because both have advantages, and disadvantages. The phase_shift allows expressions, but needs update parameter instructions, so introduces new timing restrictions. The phase argument does not allow expressions, but does not need any update parameters, so more flexible with timing.
In more detail, the phase_shift needs to insert a phase shift (set_ph_delta) before and after the pulse instead of transforming the waveform directly. And this is more limiting (because of an update parameters operation which take few ns), so if it’s not necessary, we transform the waveform with phase instead of modifying the NCO with phase_shift.
This is supposed to be a temporary wrapper until we do not find a good solution how to make phase work as an expression in all cases.
- rxy_drag_pulse(amp180: float, beta: float | qblox_scheduler.operations.expressions.Expression, theta: float | qblox_scheduler.operations.expressions.Expression, phi: float | qblox_scheduler.operations.expressions.Expression, port: str, duration: float, clock: str, reference_magnitude: qblox_scheduler.operations.pulse_library.ReferenceMagnitude | None = None) qblox_scheduler.operations.pulse_library.DRAGPulse[source]#
Generate a
DRAGPulsethat achieves the right rotation anglethetabased on a calibrated pi-pulse amplitude and beta parameter based on linear interpolation of the pulse amplitudes.- Parameters:
amp180 – Unitless amplitude of excitation pulse to get the maximum 180 degree theta.
beta – 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 | qblox_scheduler.operations.expressions.Expression, phi: float | qblox_scheduler.operations.expressions.Expression, port: str, duration: float, clock: str, reference_magnitude: qblox_scheduler.operations.pulse_library.ReferenceMagnitude | None = None) qblox_scheduler.operations.pulse_library.GaussPulse[source]#
Generate a Gaussian drive with
GaussPulsethat achieves the right rotation anglethetabased 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.
- phase_shift(theta: float | qblox_scheduler.operations.expressions.Expression, clock: str) qblox_scheduler.operations.pulse_library.ShiftClockPhase[source]#
Generate a
ShiftClockPhasethat shifts the phase of theclockby an angle theta.- Parameters:
theta – Angle to shift the clock by, in degrees.
clock – Name of the clock to shift.
- Returns:
: ShiftClockPhase operation.
- 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: qblox_scheduler.operations.pulse_library.ReferenceMagnitude | None = None, t0: float = 0) qblox_scheduler.schedules.TimeableSchedule[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 device elements.
- 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 TimeableSchedule.
- Returns:
: SquarePulse operation.
- rxy_pulse(amp180: float, skewness: float, theta: float | qblox_scheduler.operations.expressions.Expression, phi: float | qblox_scheduler.operations.expressions.Expression, port: str, duration: float, clock: str, pulse_shape: Literal['SkewedHermitePulse', 'GaussPulse'], reference_magnitude: qblox_scheduler.operations.pulse_library.ReferenceMagnitude | None = None) qblox_scheduler.operations.pulse_library.SkewedHermitePulse | qblox_scheduler.operations.pulse_library.GaussPulse[source]#
Generate a Hermite or Gaussian drive pulse for a specified rotation on the Bloch sphere.
The pulse achieves the desired rotation angle
thetausing a calibrated pi-pulse amplitudeamp180. The shape of the pulse can be either a skewed Hermite pulse or a Gaussian pulse, depending on the specified pulse_shape.- Parameters:
amp180 (float) – Unitless amplitude of the excitation pulse for a 180-degree rotation.
skewness (float) – Amplitude correction for the Hermite pulse. A value of 0 results in a standard Hermite pulse.
theta (float) – Rotation angle around an equatorial axis on the Bloch sphere, in degrees.
phi (float) – Phase of the pulse, in degrees.
port (str) – Name of the port where the pulse will be played.
duration (float) – Duration of the pulse, in seconds.
clock (str) – Name of the clock used to modulate the pulse.
pulse_shape (Literal["SkewedHermitePulse", "GaussPulse"]) – Shape of the pulse to be generated.
reference_magnitude (pulse_library.ReferenceMagnitude | None, Optional) – Reference magnitude for hardware configuration. If not provided, defaults to None.
- Returns:
pulse_library.SkewedHermitePulse | pulse_library.GaussPulse The generated pulse operation based on the specified shape and parameters.
- nv_spec_pulse_mw(duration: float, amplitude: float, clock: str, port: str, pulse_shape: Literal['SquarePulse', 'SkewedHermitePulse', 'GaussPulse'], reference_magnitude: qblox_scheduler.operations.pulse_library.ReferenceMagnitude | None = None) qblox_scheduler.operations.pulse_library.SquarePulse | qblox_scheduler.operations.pulse_library.SkewedHermitePulse | qblox_scheduler.operations.pulse_library.GaussPulse[source]#
Generate a microwave pulse for spectroscopy experiments.
The pulse can take one of three shapes: Square, Skewed Hermite, or Gaussian, based on the specified pulse_shape. This function supports frequency-modulated pulses for spectroscopy applications.
- Parameters:
duration (float) – Duration of the pulse, in seconds.
amplitude (float) – Amplitude of the pulse.
clock (str) – Name of the clock used for frequency modulation.
port (str) – Name of the port where the pulse is applied.
pulse_shape (Literal["SquarePulse", "SkewedHermitePulse", "GaussPulse"]) – Shape of the pulse. The default is “SquarePulse”.
reference_magnitude (pulse_library.ReferenceMagnitude | None, Optional) – Scaling value and unit for the unitless amplitude. If not provided, settings from the hardware configuration are used.
- Returns:
pulse_library.SquarePulse | pulse_library.SkewedHermitePulse | pulse_library.GaussPulse The generated pulse operation based on the specified shape and parameters.
- 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) qblox_scheduler.schedules.TimeableSchedule[source]#
Device compilation of the spin init operation.
- non_implemented_pulse(**kwargs) qblox_scheduler.schedules.TimeableSchedule[source]#
Raise an error indicating that the requested gate or pulse is not implemented.