qat.experimental.dialect.pulse.ir.ops module
- class AcquireOp(frame, duration)
Bases:
AcquireOp,IRDLOperation,Operation,_IRNode,ABC,objectRepresents an acquisition operation, which listens to the waveform input to the channel within the reference frame. Used in qubit readout.
Example of how this looks in textual MLIR:
%frame = pulse.create_frame(%frequency) {physical_channel = "channel_1"} : !pulse.frame %duration = pulse.constant<800e-9> : !pulse.time %frame_result, %waveform_result = pulse.acquire(%frame, %duration) : (!pulse.frame, !pulse.waveform)- Variables:
frame – The SSA value representing the frame on which to perform the acquisition.
duration – The SSA value representing the duration of the acquisition, of type pulse.time.
frame_result – The SSA value representing the resulting frame after the acquisition, which can be used as an operand in later operations.
waveform_result – The SSA value representing the resulting waveform obtained from the acquisition, which can be used as an operand in later operations.
- Parameters:
- attributes: dict[str, Attribute]
The attributes attached to the operation.
- duration
Access a non-variadic construct which appears before any variadic arguments.
- frame
Access a non-variadic construct which appears before any variadic arguments.
- frame_result
Access a non-variadic construct which appears before any variadic arguments.
- classmethod get_irdl_definition()
Get the IRDL operation definition.
- location: LocationAttr
The source location attached to this operation.
- name: ClassVar[str] = 'pulse.acquire'
The operation name. Should be a static member of the class
- properties: dict[str, Attribute]
The properties attached to the operation. Properties are inherent to the definition of an operation’s semantics, and thus cannot be discarded by transformations.
- traits: ClassVar[OpTraits] = <xdsl.ir.core.OpTraits object>
Traits attached to an operation definition. This is a static field, and is made empty by default by PyRDL if not set by the operation definition.
- verify_()
- waveform_result
Access a non-variadic construct which appears before any variadic arguments.
- class AddOp(lhs, rhs, result_type)
Bases:
InternalBinaryOp[PULSE_VAR_TYPE],Generic[PULSE_VAR_TYPE]Represents addition of two values of the same type, including addition of frequencies, phases, durations, amplitudes and waveforms.
Example of how this looks in textual MLIR:
%frequency1 = pulse.constant<5e9> : !pulse.frequency %frequency2 = pulse.constant<1e9> : !pulse.frequency %result = pulse.add(%frequency1, %frequency2) : !pulse.frequency
- Variables:
lhs – The left-hand side operand of the addition operation.
rhs – The right-hand side operand of the addition operation.
result – The SSA value representing the result of the addition operation, which can be used as an operand in later operations.
- Parameters:
lhs¶ (
Union[SSAValue[TypeVar(PULSE_VAR_TYPE, bound=FrequencyType|PhaseType|TimeType|AmplitudeType|FrameType|WaveformType)],Operation]) – The left-hand side operand of the binary operation, which must be of a type within the pulse dialect.rhs¶ (
Union[SSAValue[TypeVar(PULSE_VAR_TYPE, bound=FrequencyType|PhaseType|TimeType|AmplitudeType|FrameType|WaveformType)],Operation]) – The right-hand side operand of the binary operation, which must be of a type within the pulse dialect.result_type¶ (
TypeVar(PULSE_VAR_TYPE, bound=FrequencyType|PhaseType|TimeType|AmplitudeType|FrameType|WaveformType)) – The type of the result SSA value, which must be the same as the types of the operands.
- attributes: dict[str, Attribute]
The attributes attached to the operation.
- classmethod get_irdl_definition()
Get the IRDL operation definition.
- lhs
Access a non-variadic construct which appears before any variadic arguments.
- location: LocationAttr
The source location attached to this operation.
- name: ClassVar[str] = 'pulse.add'
The operation name. Should be a static member of the class
- properties: dict[str, Attribute]
The properties attached to the operation. Properties are inherent to the definition of an operation’s semantics, and thus cannot be discarded by transformations.
- static py_operation(lhs, rhs)
Performs the addition operation on given literals.
This is used for constant folding.
- result
Access a non-variadic construct which appears before any variadic arguments.
- rhs
Access a non-variadic construct which appears before any variadic arguments.
- traits: ClassVar[OpTraits] = <xdsl.ir.core.OpTraits object>
Traits attached to an operation definition. This is a static field, and is made empty by default by PyRDL if not set by the operation definition.
- verify_()
- class BinaryOp(*, operands=None, result_types=None, properties=None, attributes=None, successors=None, regions=None)
Bases:
IRDLOperation,ABCAbstract base class for binary operations in the pulse dialect.
This is used to represent operations that take two operands of the same type and produce a result of the same type, such as addition and multiplication.
- abstract property lhs: SSAValue
- abstract property name: str
- abstract static py_operation(lhs, rhs)
Hooks in the associated Python operation to be used as part of transforms and optimizations.
- abstract property rhs: SSAValue
- class BlackmanWaveformOp(width, amplitude)
Bases:
BlackmanWaveformOp,IRDLOperation,IsAnalyticalWaveformInterface,Operation,_IRNode,ABC,objectA Blackman-window shaped pulse, offering excellent spectral leakage suppression.
Example of how this looks in textual MLIR:
- Variables:
width – The duration of the waveform, represented as a SSA value of type pulse.time.
amplitude – The amplitude of the waveform, represented as a SSA value of type pulse.amplitude.
result – The SSA value representing the resulting Blackman waveform, which can be used as an operand in later operations.
- Parameters:
- amplitude
Access a non-variadic construct which appears before any variadic arguments.
- attributes: dict[str, Attribute]
The attributes attached to the operation.
- classmethod get_irdl_definition()
Get the IRDL operation definition.
- location: LocationAttr
The source location attached to this operation.
- name: ClassVar[str] = 'pulse.blackman_waveform'
The operation name. Should be a static member of the class
- properties: dict[str, Attribute]
The properties attached to the operation. Properties are inherent to the definition of an operation’s semantics, and thus cannot be discarded by transformations.
- result
Access a non-variadic construct which appears before any variadic arguments.
- traits: ClassVar[OpTraits] = <xdsl.ir.core.OpTraits object>
Traits attached to an operation definition. This is a static field, and is made empty by default by PyRDL if not set by the operation definition.
- verify_()
- property waveform_type: type[BlackmanWaveform]
Returns the associated QAT waveform type, which can be used to evaluate the shape of the waveform.
- width
Access a non-variadic construct which appears before any variadic arguments.
- class ConstantOp(value, result_type=None)
Bases:
IRDLOperation,HasFolderInterface,Generic[PULSE_VAR_TYPE]Represents a constant value of a given type. This is used to represent constant frequencies, phases, durations, amplitudes and waveforms in the IR.
Example of how this looks in textual MLIR:
%frequency = pulse.constant<5e9> : !pulse.frequency
- Parameters:
value¶ (
PulseNumericTypedAttr[TypeVar(PULSE_VAR_TYPE, bound=FrequencyType|PhaseType|TimeType|AmplitudeType|FrameType|WaveformType)]) – The value of the constant, which is a PulseNumericTypedAttr such as FrequencyAttr, PhaseAttr, TimeAttr or AmplitudeAttr.result_type¶ (
Optional[TypeVar(PULSE_VAR_TYPE, bound=FrequencyType|PhaseType|TimeType|AmplitudeType|FrameType|WaveformType)]) – The type of the result SSA value. If not provided, it will be inferred from the type of the value.
- attributes: dict[str, Attribute]
The attributes attached to the operation.
- fold()
Returns the constant value, used within constant operation folding.
- Return type:
Sequence[SSAValue|Attribute] |None
- classmethod get_irdl_definition()
Get the IRDL operation definition.
- location: LocationAttr
The source location attached to this operation.
- name: ClassVar[str] = 'pulse.constant'
The operation name. Should be a static member of the class
- properties: dict[str, Attribute]
The properties attached to the operation. Properties are inherent to the definition of an operation’s semantics, and thus cannot be discarded by transformations.
- result
Access a non-variadic construct which appears before any variadic arguments.
- traits: ClassVar[OpTraits] = <xdsl.ir.core.OpTraits object>
Traits attached to an operation definition. This is a static field, and is made empty by default by PyRDL if not set by the operation definition.
- value
Accessor for an operation property.
- verify()
Verifies that the result type is consistent with the attribute provided.
- verify_()
- class CosWaveformOp(width, amplitude, frequency, internal_phase)
Bases:
CosWaveformOp,IRDLOperation,IsAnalyticalWaveformInterface,Operation,_IRNode,ABC,objectA cosine-oscillating envelope.
Example of how this looks in textual MLIR:
%width = pulse.constant<128e-9> : !pulse.time %amplitude = pulse.constant<0.5> : !pulse.amplitude %frequency = pulse.constant<5e9> : !pulse.frequency %internal_phase = pulse.constant<1.5708> : !pulse.phase %waveform = pulse.cos_waveform(%width, %amplitude, %frequency, %internal_phase) : !pulse.waveform- Variables:
width – The duration of the waveform, represented as a SSA value of type pulse.time.
amplitude – The amplitude of the waveform, represented as a SSA value of type pulse.amplitude.
frequency – The oscillation frequency of the waveform, represented as a SSA value of type pulse.frequency.
internal_phase – The internal phase offset of the waveform, represented as a SSA value of type pulse.phase.
result – The SSA value representing the resulting cosine waveform.
- Parameters:
width¶ (
SSAValue|Operation) – The duration of the waveform, represented as a SSA value of type pulse.time.amplitude¶ (
SSAValue|Operation) – The amplitude of the waveform, represented as a SSA value of type pulse.amplitude.frequency¶ (
SSAValue|Operation) – The oscillation frequency of the waveform, represented as a SSA value of type pulse.frequency.internal_phase¶ (
SSAValue|Operation) – The internal phase offset of the waveform, represented as a SSA value of type pulse.phase.
- amplitude
Access a non-variadic construct which appears before any variadic arguments.
- attributes: dict[str, Attribute]
The attributes attached to the operation.
- frequency
Access a non-variadic construct which appears before any variadic arguments.
- classmethod get_irdl_definition()
Get the IRDL operation definition.
- internal_phase
Access a non-variadic construct which appears before any variadic arguments.
- location: LocationAttr
The source location attached to this operation.
- name: ClassVar[str] = 'pulse.cos_waveform'
The operation name. Should be a static member of the class
- properties: dict[str, Attribute]
The properties attached to the operation. Properties are inherent to the definition of an operation’s semantics, and thus cannot be discarded by transformations.
- result
Access a non-variadic construct which appears before any variadic arguments.
- traits: ClassVar[OpTraits] = <xdsl.ir.core.OpTraits object>
Traits attached to an operation definition. This is a static field, and is made empty by default by PyRDL if not set by the operation definition.
- verify_()
- property waveform_type: type[CosWaveform]
Returns the associated QAT waveform type, which can be used to evaluate the shape of the waveform.
- width
Access a non-variadic construct which appears before any variadic arguments.
- class CreateFrameOp(frequency, physical_channel, imbalance=None, phase_offset=None, acquire_allowed=None, pulse_allowed=None, track_phase=None)
Bases:
CreateFrameOp,IRDLOperation,Operation,_IRNode,ABC,objectCreates a frame, which is a medium for waveforms to be played at a given frequency, and tracks any phase manipulations.
Frames are associated with a physical channel that the pulses will be played on. They can have many-to-one association, allowing multiple frames to act concurrently on a single physical channel.
They are defined by a static frequency, and optionally take attributes associated with the control hardware calibrated for that frame.
Example of how this looks in textual MLIR:
%frame = pulse.create_frame(%frequency) {physical_channel = "channel_1"} : !pulse.frame- Variables:
frequency – The frequency of the frame.
physical_channel – A string property containing the physical channel identifier.
imbalance – An optional attribute that stores the imbalance between I and Q paths, obtained from mixer calibrations.
phase_offset – An optional attribute that stores the phase offset between I and Q paths, obtained from mixer calibrations.
acquire_allowed – An optional boolean attribute that states if the frame is allowed to do acquisitions. This annotation is motivated by the fact not all IO channels might allow acquisition, and also simplifies allocation logic. Defaults to True.
pulse_allowed – An optional boolean attribute that states if the frame is allowed to play pulses. This annotation is motivated by optimization logic for allocation on the hardware. Defaults to True.
track_phase – An optional boolean attribute that states if phase strictly needs to be tracked when frame swapping on hardware. If False, this highly simplifies allocation logic, allowing us to make more efficient use of hardware. This should be used carefully. Defaults to True.
result – The SSA value representing the Frame. Can only be consumed by a single operation.
- Parameters:
frequency¶ (
SSAValue|Operation) – The SSA value representing the frequency of the frame.physical_channel¶ (
StringAttr) – The string attribute containing the physical channel identifier.imbalance¶ (
Optional[FloatAttr]) – The float attribute representing the imbalance between I and Q paths, obtained from mixer calibrations. Optional.phase_offset¶ (
Optional[FloatAttr]) – The float attribute representing the phase offset between I and Q paths, obtained from mixer calibrations. Optional.acquire_allowed¶ (
Optional[IntegerAttr[IntegerType]]) – The boolean attribute stating if the frame is allowed to do acquisitions. Defaults to an attribute with True.pulse_allowed¶ (
Optional[IntegerAttr[IntegerType]]) – The boolean attribute stating if the frame is allowed to play pulses. Defaults to an attribute with True.track_phase¶ (
Optional[IntegerAttr[IntegerType]]) – The boolean attribute stating if phase strictly needs to be tracked when frame swapping on hardware. Defaults to an attribute with True.
- acquire_allowed
Accessor for an operation attribute.
- attributes: dict[str, Attribute]
The attributes attached to the operation.
- frequency
Access a non-variadic construct which appears before any variadic arguments.
- classmethod get_irdl_definition()
Get the IRDL operation definition.
- imbalance
Accessor for an optional operation attribute.
- location: LocationAttr
The source location attached to this operation.
- name: ClassVar[str] = 'pulse.create_frame'
The operation name. Should be a static member of the class
- phase_offset
Accessor for an optional operation attribute.
- physical_channel
Accessor for an operation property.
- properties: dict[str, Attribute]
The properties attached to the operation. Properties are inherent to the definition of an operation’s semantics, and thus cannot be discarded by transformations.
- pulse_allowed
Accessor for an operation attribute.
- result
Access a non-variadic construct which appears before any variadic arguments.
- track_phase
Accessor for an operation attribute.
- traits: ClassVar[OpTraits] = <xdsl.ir.core.OpTraits object>
Traits attached to an operation definition. This is a static field, and is made empty by default by PyRDL if not set by the operation definition.
- verify_()
- class DragGaussianWaveformOp(width, amplitude, std_dev, beta, zero_at_edges)
Bases:
DragGaussianWaveformOp,IRDLOperation,IsAnalyticalWaveformInterface,Operation,_IRNode,ABC,objectDrag Gaussian, tighter on one side and long tail on the other.
Example of how this looks in textual MLIR:
%width = pulse.constant<128e-9> : !pulse.time %amplitude = pulse.constant<0.5> : !pulse.amplitude %std_dev = pulse.constant<32e-9> : !pulse.time %beta = arith.constant<0.1> : !f64 %waveform = pulse.drag_gaussian_waveform<true>(%width, %amplitude, %std_dev, %beta) : !pulse.waveform- Variables:
width – The duration of the waveform, represented as a SSA value of type pulse.time.
amplitude – The amplitude of the waveform, represented as a SSA value of type pulse.amplitude.
std_dev – The SSA value representation of the standard deviation parameter governing the width of the Gaussian.
beta – The SSA value representation of the DRAG coefficient, controlling the magnitude of the imaginary component of the waveform.
zero_at_edges – A boolean property indicating whether to normalise the envelope to zero at its edges.
result – The SSA value representing the resulting DRAG Gaussian waveform, which can be used as an operand in later operations.
- Parameters:
width¶ (
SSAValue|Operation) – The duration of the waveform, represented as a SSA value of type pulse.time.amplitude¶ (
SSAValue|Operation) – The amplitude of the waveform, represented as a SSA value of type pulse.amplitude.std_dev¶ (
SSAValue|Operation) – The SSA value representation of the standard deviation parameter governing the width of the Gaussian.beta¶ (
SSAValue|Operation) – The SSA value representation of the DRAG coefficient, controlling the magnitude of the imaginary component of the waveform.zero_at_edges¶ (
IntegerAttr[IntegerType]) – The boolean property indicating whether to normalise the envelope to zero at its edges.
- amplitude
Access a non-variadic construct which appears before any variadic arguments.
- attributes: dict[str, Attribute]
The attributes attached to the operation.
- beta
Access a non-variadic construct which appears before any variadic arguments.
- classmethod get_irdl_definition()
Get the IRDL operation definition.
- location: LocationAttr
The source location attached to this operation.
- name: ClassVar[str] = 'pulse.drag_gaussian_waveform'
The operation name. Should be a static member of the class
- properties: dict[str, Attribute]
The properties attached to the operation. Properties are inherent to the definition of an operation’s semantics, and thus cannot be discarded by transformations.
- result
Access a non-variadic construct which appears before any variadic arguments.
- std_dev
Access a non-variadic construct which appears before any variadic arguments.
- traits: ClassVar[OpTraits] = <xdsl.ir.core.OpTraits object>
Traits attached to an operation definition. This is a static field, and is made empty by default by PyRDL if not set by the operation definition.
- verify_()
- property waveform_type: type[DragGaussianWaveform]
Returns the associated QAT waveform type, which can be used to evaluate the shape of the waveform.
- width
Access a non-variadic construct which appears before any variadic arguments.
- zero_at_edges
Accessor for an operation property.
- class ExtraSoftSquareWaveformOp(width, amplitude, std_dev, rise)
Bases:
ExtraSoftSquareWaveformOp,IRDLOperation,IsAnalyticalWaveformInterface,Operation,_IRNode,ABC,objectA square pulse with heavily softened edges.
Example of how this looks in textual MLIR:
%width = pulse.constant<128e-9> : !pulse.time %amplitude = pulse.constant<0.5> : !pulse.amplitude %std_dev = pulse.constant<32e-9> : !pulse.time %rise = arith.constant<0.1> : !f64 %waveform = pulse.extra_soft_square_waveform(%width, %amplitude, %std_dev, %rise) : !pulse.waveform- Variables:
width – The duration of the waveform, represented as a SSA value of type pulse.time.
amplitude – The amplitude of the waveform, represented as a SSA value of type pulse.amplitude.
std_dev – Half-width parameter governing the flat-top duration.
rise – Edge rise/fall scale. Larger values give a softer slope than
SofterSquareWaveformbecause the tanh transitions are shifted inward by more than onerisestep on each side.result – The SSA value representing the resulting softened square waveform, which can be used as an operand in later operations.
- Parameters:
width¶ (
SSAValue|Operation) – The duration of the square waveform, represented as a SSA value of type pulse.time.amplitude¶ (
SSAValue|Operation) – The amplitude of the square waveform, represented as a SSA value of type pulse.amplitude.std_dev¶ (
SSAValue|Operation) – The SSA value representation of the standard deviation parameter governing the flat-top duration.rise¶ (
SSAValue|Operation) – The SSA value representation of the rise parameter.
- amplitude
Access a non-variadic construct which appears before any variadic arguments.
- attributes: dict[str, Attribute]
The attributes attached to the operation.
- classmethod get_irdl_definition()
Get the IRDL operation definition.
- location: LocationAttr
The source location attached to this operation.
- name: ClassVar[str] = 'pulse.extra_soft_square_waveform'
The operation name. Should be a static member of the class
- properties: dict[str, Attribute]
The properties attached to the operation. Properties are inherent to the definition of an operation’s semantics, and thus cannot be discarded by transformations.
- result
Access a non-variadic construct which appears before any variadic arguments.
- rise
Access a non-variadic construct which appears before any variadic arguments.
- std_dev
Access a non-variadic construct which appears before any variadic arguments.
- traits: ClassVar[OpTraits] = <xdsl.ir.core.OpTraits object>
Traits attached to an operation definition. This is a static field, and is made empty by default by PyRDL if not set by the operation definition.
- verify_()
- property waveform_type: type[ExtraSoftSquareWaveform]
Returns the associated QAT waveform type, which can be used to evaluate the envelope.
- width
Access a non-variadic construct which appears before any variadic arguments.
- class GaussianSquareWaveformOp(width, amplitude, std_dev, square_width, zero_at_edges)
Bases:
GaussianSquareWaveformOp,IRDLOperation,IsAnalyticalWaveformInterface,Operation,_IRNode,ABC,objectA square pulse with a Gaussian rise and fall at the edges, i.e a flat-top pulse with Gaussian-shaped rise and fall flanks. The envelope is flat (value = 1) over the inner square_width and decays as a Gaussian outside that region.
Example of how this looks in textual MLIR:
%width = pulse.constant<128e-9> : !pulse.time %amplitude = pulse.constant<0.5> : !pulse.amplitude %std_dev = pulse.constant<32e-9> : !pulse.time %square_width = pulse.constant<64e-9> : !pulse.time %waveform = pulse.gaussian_square_waveform<true>(%width, %amplitude, %std_dev,%square_width) : !pulse.waveform- Variables:
width – The duration of the waveform, represented as a SSA value of type pulse.time.
amplitude – The amplitude of the waveform, represented as a SSA value of type pulse.amplitude.
square_width – Duration of the central flat-top section.
std_dev – Standard deviation of the Gaussian flanks. Larger values produce more gradual rise/fall; smaller values produce steeper flanks.
zero_at_edges – If True, the envelope is offset and rescaled so that it is exactly zero at the outermost sample points.
result – The SSA value representing the resulting Gaussian-square waveform, which can be used as an operand in later operations.
- amplitude
Access a non-variadic construct which appears before any variadic arguments.
- attributes: dict[str, Attribute]
The attributes attached to the operation.
- classmethod get_irdl_definition()
Get the IRDL operation definition.
- location: LocationAttr
The source location attached to this operation.
- name: ClassVar[str] = 'pulse.gaussian_square_waveform'
The operation name. Should be a static member of the class
- properties: dict[str, Attribute]
The properties attached to the operation. Properties are inherent to the definition of an operation’s semantics, and thus cannot be discarded by transformations.
- result
Access a non-variadic construct which appears before any variadic arguments.
- square_width
Access a non-variadic construct which appears before any variadic arguments.
- std_dev
Access a non-variadic construct which appears before any variadic arguments.
- traits: ClassVar[OpTraits] = <xdsl.ir.core.OpTraits object>
Traits attached to an operation definition. This is a static field, and is made empty by default by PyRDL if not set by the operation definition.
- verify_()
- property waveform_type: type[GaussianSquareWaveform]
The type of the waveform shape that this operation produces.
This is used to determine how to evaluate the shape of the waveform.
- width
Access a non-variadic construct which appears before any variadic arguments.
- zero_at_edges
Accessor for an operation property.
- class GaussianWaveformOp(width, amplitude, rise)
Bases:
GaussianWaveformOp,IRDLOperation,IsAnalyticalWaveformInterface,Operation,_IRNode,ABC,objectRepresents a Gaussian waveform, defined by its duration, amplitude, and standard deviation.
Example of how this looks in textual MLIR:
%width = pulse.constant<128e-9> : !pulse.time %amplitude = pulse.constant<0.5> : !pulse.amplitude %rise = arith.constant<0.1> : !f64 %waveform = pulse.gaussian_waveform(%width, %amplitude, %rise) : !pulse.waveform
- Variables:
width – The duration of the waveform, represented as a SSA value of type pulse.time.
amplitude – The amplitude of the waveform, represented as a SSA value of type pulse.amplitude.
rise – Dimensionless shape parameter contributing to the effective width k = width * rise. A larger rise spreads the Gaussian; a smaller rise narrows it.
result – The SSA value representing the resulting Gaussian waveform, which can be used as an operand in later operations.
- Parameters:
width¶ (
SSAValue|Operation) – The duration of the waveform, represented as a SSA value of type pulse.time.amplitude¶ (
SSAValue|Operation) – The amplitude of the waveform, represented as a SSA value of type pulse.amplitude.rise¶ (
SSAValue|Operation) – The SSA value representation of the rise parameter.
- amplitude
Access a non-variadic construct which appears before any variadic arguments.
- attributes: dict[str, Attribute]
The attributes attached to the operation.
- classmethod get_irdl_definition()
Get the IRDL operation definition.
- location: LocationAttr
The source location attached to this operation.
- name: ClassVar[str] = 'pulse.gaussian_waveform'
The operation name. Should be a static member of the class
- properties: dict[str, Attribute]
The properties attached to the operation. Properties are inherent to the definition of an operation’s semantics, and thus cannot be discarded by transformations.
- result
Access a non-variadic construct which appears before any variadic arguments.
- rise
Access a non-variadic construct which appears before any variadic arguments.
- traits: ClassVar[OpTraits] = <xdsl.ir.core.OpTraits object>
Traits attached to an operation definition. This is a static field, and is made empty by default by PyRDL if not set by the operation definition.
- verify_()
- property waveform_type: type[GaussianWaveform]
Returns the associated QAT waveform type, which can be used to evaluate the shape of the waveform.
- width
Access a non-variadic construct which appears before any variadic arguments.
- class GaussianZeroEdgeWaveformOp(width, amplitude, std_dev, zero_at_edges)
Bases:
GaussianZeroEdgeWaveformOp,IRDLOperation,IsAnalyticalWaveformInterface,Operation,_IRNode,ABC,objectA Gaussian pulse that can be normalized to be zero at the edges.
Example of how this looks in textual MLIR:
%width = pulse.constant<128e-9> : !pulse.time %amplitude = pulse.constant<0.5> : !pulse.amplitude %std_dev = pulse.constant<32e-9> : !pulse.time %waveform = pulse.gaussian_zero_edge_waveform<true>(%width, %amplitude, %std_dev) : !pulse.waveform- Variables:
width – The duration of the waveform, represented as a SSA value of type pulse.time.
amplitude – The amplitude of the waveform, represented as a SSA value of type pulse.amplitude.
std_dev – The SSA value representation of the standard deviation parameter governing the width of the Gaussian.
zero_at_edges – A boolean property indicating whether to normalise the envelope to zero at its edges.
result – The SSA value representing the resulting Gaussian waveform, which can be used as an operand in later operations.
- Parameters:
width¶ (
SSAValue|Operation) – The duration of the waveform, represented as a SSA value of type pulse.time.amplitude¶ (
SSAValue|Operation) – The amplitude of the waveform, represented as a SSA value of type pulse.amplitude.std_dev¶ (
SSAValue|Operation) – The SSA value representation of the standard deviation parameter governing the width of the Gaussian.zero_at_edges¶ (
IntegerAttr[IntegerType]) – The boolean property indicating whether to normalise the envelope to zero at its edges.
- amplitude
Access a non-variadic construct which appears before any variadic arguments.
- attributes: dict[str, Attribute]
The attributes attached to the operation.
- classmethod get_irdl_definition()
Get the IRDL operation definition.
- location: LocationAttr
The source location attached to this operation.
- name: ClassVar[str] = 'pulse.gaussian_zero_edge_waveform'
The operation name. Should be a static member of the class
- properties: dict[str, Attribute]
The properties attached to the operation. Properties are inherent to the definition of an operation’s semantics, and thus cannot be discarded by transformations.
- result
Access a non-variadic construct which appears before any variadic arguments.
- std_dev
Access a non-variadic construct which appears before any variadic arguments.
- traits: ClassVar[OpTraits] = <xdsl.ir.core.OpTraits object>
Traits attached to an operation definition. This is a static field, and is made empty by default by PyRDL if not set by the operation definition.
- verify_()
- property waveform_type: type[GaussianZeroEdgeWaveform]
Returns the associated QAT waveform type, which can be used to evaluate the shape of the waveform.
- width
Access a non-variadic construct which appears before any variadic arguments.
- zero_at_edges
Accessor for an operation property.
- class InternalBinaryOp(lhs, rhs, result_type)
Bases:
BinaryOp,Generic[PULSE_VAR_TYPE],ABCAbstract base class for operations that take two operands of a type within the pulse dialect and return a result of the same type, such as addition and subtraction.
- Parameters:
lhs¶ (
Union[SSAValue[TypeVar(PULSE_VAR_TYPE, bound=FrequencyType|PhaseType|TimeType|AmplitudeType|FrameType|WaveformType)],Operation]) – The left-hand side operand of the binary operation, which must be of a type within the pulse dialect.rhs¶ (
Union[SSAValue[TypeVar(PULSE_VAR_TYPE, bound=FrequencyType|PhaseType|TimeType|AmplitudeType|FrameType|WaveformType)],Operation]) – The right-hand side operand of the binary operation, which must be of a type within the pulse dialect.result_type¶ (
TypeVar(PULSE_VAR_TYPE, bound=FrequencyType|PhaseType|TimeType|AmplitudeType|FrameType|WaveformType)) – The type of the result SSA value, which must be the same as the types of the operands.
- attributes: dict[str, Attribute]
The attributes attached to the operation.
- lhs = <xdsl.irdl.operations._OperandFieldDef object>
- location: LocationAttr
The source location attached to this operation.
- properties: dict[str, Attribute]
The properties attached to the operation. Properties are inherent to the definition of an operation’s semantics, and thus cannot be discarded by transformations.
- result = <xdsl.irdl.operations._ResultFieldDef object>
- rhs = <xdsl.irdl.operations._OperandFieldDef object>
- traits: ClassVar[OpTraits]
Traits attached to an operation definition. This is a static field, and is made empty by default by PyRDL if not set by the operation definition.
- verify()
Ensures that the types of the operands and result are consistent.
- class ModulateOp(lhs, rhs)
Bases:
InternalBinaryOp[WaveformType]Represents the modulation of a waveform by another waveform.
Modulation of two waveforms does a pointwise multiplication of the two waveforms, resulting in a new waveform that has the same duration as the input waveforms.
%duration = pulse.constant<128e-9> : !pulse.time %amplitude1 = pulse.constant<0.5> : !pulse.amplitude %waveform1 = pulse.square_waveform(%duration, %amplitude1) : !pulse.waveform %amplitude2 = pulse.constant<0.25> : !pulse.amplitude %waveform2 = pulse.square_waveform(%duration, %amplitude2) : !pulse.waveform %result = pulse.modulate(%waveform1, %waveform2) : !pulse.waveform
- Variables:
lhs – The left-hand side operand of the modulation operation, which is a waveform.
rhs – The right-hand side operand of the modulation operation, which is a waveform.
result – The SSA value representing the result of the modulation operation, which can be used as an operand in later operations.
- Parameters:
lhs¶ (
Union[SSAValue[WaveformType],Operation]) – The left-hand side operand of the modulation operation, which is a waveform.rhs¶ (
Union[SSAValue[WaveformType],Operation]) – The right-hand side operand of the modulation operation, which is a waveform.
- attributes: dict[str, Attribute]
The attributes attached to the operation.
- classmethod get_irdl_definition()
Get the IRDL operation definition.
- lhs
Access a non-variadic construct which appears before any variadic arguments.
- location: LocationAttr
The source location attached to this operation.
- name: ClassVar[str] = 'pulse.modulate'
The operation name. Should be a static member of the class
- properties: dict[str, Attribute]
The properties attached to the operation. Properties are inherent to the definition of an operation’s semantics, and thus cannot be discarded by transformations.
- static py_operation(lhs, rhs)
Performs the modulation operation on given literals.
This is used for constant folding.
- result
Access a non-variadic construct which appears before any variadic arguments.
- rhs
Access a non-variadic construct which appears before any variadic arguments.
- traits: ClassVar[OpTraits] = <xdsl.ir.core.OpTraits object>
Traits attached to an operation definition. This is a static field, and is made empty by default by PyRDL if not set by the operation definition.
- verify_()
- class ModuloOp(lhs, rhs, result_type)
Bases:
InternalBinaryOp[PhaseType]Represents the modulo operation on two phases.
Example of how this looks in textual MLIR:
%phase1 = pulse.constant<3.5> : !pulse.phase %phase2 = pulse.constant<1.0> : !pulse.phase %result = pulse.modulo(%phase1, %phase2) : !pulse.phase
- Variables:
lhs – The left-hand side operand of the modulo operation, which must be phase type.
rhs – The right-hand side operand of the modulo operation, which must be phase type.
- Parameters:
lhs¶ (
Union[SSAValue[TypeVar(PULSE_VAR_TYPE, bound=FrequencyType|PhaseType|TimeType|AmplitudeType|FrameType|WaveformType)],Operation]) – The left-hand side operand of the binary operation, which must be of a type within the pulse dialect.rhs¶ (
Union[SSAValue[TypeVar(PULSE_VAR_TYPE, bound=FrequencyType|PhaseType|TimeType|AmplitudeType|FrameType|WaveformType)],Operation]) – The right-hand side operand of the binary operation, which must be of a type within the pulse dialect.result_type¶ (
TypeVar(PULSE_VAR_TYPE, bound=FrequencyType|PhaseType|TimeType|AmplitudeType|FrameType|WaveformType)) – The type of the result SSA value, which must be the same as the types of the operands.
- attributes: dict[str, Attribute]
The attributes attached to the operation.
- classmethod get_irdl_definition()
Get the IRDL operation definition.
- lhs
Access a non-variadic construct which appears before any variadic arguments.
- location: LocationAttr
The source location attached to this operation.
- name: ClassVar[str] = 'pulse.modulo'
The operation name. Should be a static member of the class
- properties: dict[str, Attribute]
The properties attached to the operation. Properties are inherent to the definition of an operation’s semantics, and thus cannot be discarded by transformations.
- static py_operation(lhs, rhs)
Performs the modulo operation on given literals.
This is used for constant folding.
- result
Access a non-variadic construct which appears before any variadic arguments.
- rhs
Access a non-variadic construct which appears before any variadic arguments.
- traits: ClassVar[OpTraits] = <xdsl.ir.core.OpTraits object>
Traits attached to an operation definition. This is a static field, and is made empty by default by PyRDL if not set by the operation definition.
- verify_()
- class PhaseOp(frame, phase)
Bases:
IRDLOperation,ABCAbstract base class for operations that manipulate the phase of a frame.
- Parameters:
- attributes: dict[str, Attribute]
The attributes attached to the operation.
- frame = <xdsl.irdl.operations._OperandFieldDef object>
- location: LocationAttr
The source location attached to this operation.
- abstract property name: str
To be specified by subclasses to define the operation name in MLIR.
- phase = <xdsl.irdl.operations._OperandFieldDef object>
- properties: dict[str, Attribute]
The properties attached to the operation. Properties are inherent to the definition of an operation’s semantics, and thus cannot be discarded by transformations.
- result = <xdsl.irdl.operations._ResultFieldDef object>
- traits: ClassVar[OpTraits]
Traits attached to an operation definition. This is a static field, and is made empty by default by PyRDL if not set by the operation definition.
- class PhaseSetOp(frame, phase)
Bases:
PhaseSetOp,PhaseOp,IRDLOperation,Operation,_IRNode,ABC,objectResets the accumulated phase of a frame to a given value.
Example of how this looks in textual MLIR:
%frame = pulse.create_frame(%frequency) {physical_channel = "channel_1"} : !pulse.frame %phase = pulse.constant<1.5708> : !pulse.phase %frame2 = pulse.phase_set(%frame, %phase) : !pulse.frame- Variables:
frame – The SSA value representing the frame whose phase is being set.
phase – The SSA value representing the phase operand, which specifies the value to which to set the phase.
result – The SSA value representing the resulting frame with the set phase, which can be used as an operand in later operations.
- Parameters:
- attributes: dict[str, Attribute]
The attributes attached to the operation.
- frame
Access a non-variadic construct which appears before any variadic arguments.
- classmethod get_irdl_definition()
Get the IRDL operation definition.
- location: LocationAttr
The source location attached to this operation.
- name: ClassVar[str] = 'pulse.phase_set'
The operation name. Should be a static member of the class
- phase
Access a non-variadic construct which appears before any variadic arguments.
- properties: dict[str, Attribute]
The properties attached to the operation. Properties are inherent to the definition of an operation’s semantics, and thus cannot be discarded by transformations.
- result
Access a non-variadic construct which appears before any variadic arguments.
- traits: ClassVar[OpTraits] = <xdsl.ir.core.OpTraits object>
Traits attached to an operation definition. This is a static field, and is made empty by default by PyRDL if not set by the operation definition.
- verify_()
- class PhaseShiftOp(frame, phase)
Bases:
PhaseShiftOp,PhaseOp,IRDLOperation,Operation,_IRNode,ABC,objectChanges the phase of a frame by a given amount. The resulting phase is relative to the current phase of the frame.
Phase shifts are used to create phase differences in superpositions of quantum states. They are how we implement virtual-Z gates.
Example of how this looks in textual MLIR:
%frame = pulse.create_frame(%frequency) {physical_channel = "channel_1"} : !pulse.frame %phase = pulse.constant<1.5708> : !pulse.phase %frame2 = pulse.phase_shift(%frame, %phase) : !pulse.frame- Variables:
frame – The SSA value representing the frame whose phase is being shifted.
phase – The SSA value representing the phase operand, which specifies the amount by which to shift the phase.
result – The SSA value representing the resulting frame with the shifted phase, which can be used as an operand in later operations.
- Parameters:
- attributes: dict[str, Attribute]
The attributes attached to the operation.
- frame
Access a non-variadic construct which appears before any variadic arguments.
- classmethod get_irdl_definition()
Get the IRDL operation definition.
- location: LocationAttr
The source location attached to this operation.
- name: ClassVar[str] = 'pulse.phase_shift'
The operation name. Should be a static member of the class
- phase
Access a non-variadic construct which appears before any variadic arguments.
- properties: dict[str, Attribute]
The properties attached to the operation. Properties are inherent to the definition of an operation’s semantics, and thus cannot be discarded by transformations.
- result
Access a non-variadic construct which appears before any variadic arguments.
- traits: ClassVar[OpTraits] = <xdsl.ir.core.OpTraits object>
Traits attached to an operation definition. This is a static field, and is made empty by default by PyRDL if not set by the operation definition.
- verify_()
- class PulseOp(frame, waveform)
Bases:
PulseOp,IRDLOperation,Operation,_IRNode,ABC,objectRepresents a pulse, which is a waveform played on a frame at a given frequency, and with a given phase.
Example of how this looks in textual MLIR:
%frame = pulse.create_frame(%frequency) {physical_channel = "channel_1"} : !pulse.frame %duration = arith.constant<128e-9> : !pulse.time %amplitude = arith.constant<0.5> : !pulse.amplitude %waveform = pulse.square_waveform(%duration, %amplitude) : !pulse.waveform %frame2 = pulse.pulse(%frame, %waveform) : !pulse.frame- Variables:
frame – The SSA value representing the frame on which to play the pulse.
waveform – The SSA value representing the waveform to be played, of type pulse.waveform.
result – The SSA value representing the resulting frame after playing the pulse, which can be used as an operand in later operations.
- Parameters:
- attributes: dict[str, Attribute]
The attributes attached to the operation.
- frame
Access a non-variadic construct which appears before any variadic arguments.
- classmethod get_irdl_definition()
Get the IRDL operation definition.
- location: LocationAttr
The source location attached to this operation.
- name: ClassVar[str] = 'pulse.pulse'
The operation name. Should be a static member of the class
- properties: dict[str, Attribute]
The properties attached to the operation. Properties are inherent to the definition of an operation’s semantics, and thus cannot be discarded by transformations.
- result
Access a non-variadic construct which appears before any variadic arguments.
- traits: ClassVar[OpTraits] = <xdsl.ir.core.OpTraits object>
Traits attached to an operation definition. This is a static field, and is made empty by default by PyRDL if not set by the operation definition.
- verify_()
- waveform
Access a non-variadic construct which appears before any variadic arguments.
- class RoundedSquareWaveformOp(width, amplitude, rise, std_dev)
Bases:
RoundedSquareWaveformOp,IRDLOperation,IsAnalyticalWaveformInterface,Operation,_IRNode,ABC,objectA square pulse with smooth erf-shaped (S-curve) rise and fall.
____ / ___| |___
Example of how this looks in textual MLIR:
%width = pulse.constant<128e-9> : !pulse.time %amplitude = pulse.constant<0.5> : !pulse.amplitude %rise = arith.constant<0.1> : !f64 %std_dev = pulse.constant<32e-9> : !pulse.time %waveform = pulse.rounded_square_waveform(%width, %amplitude, %rise, %std_dev) : !pulse.waveform
- Variables:
width – The duration of the waveform, represented as a SSA value of type pulse.time.
amplitude – The amplitude of the waveform, represented as a SSA value of type pulse.amplitude.
rise – The SSA value representation of the rise parameter.
std_dev – The SSA value representation of the standard deviation parameter governing the flat-top duration.
result – The SSA value representing the resulting rounded square waveform that can be used as an operand in later operations.
- Parameters:
width¶ (
SSAValue|Operation) – The duration of the waveform, represented as a SSA value of type pulse.time.amplitude¶ (
SSAValue|Operation) – The amplitude of the waveform, represented as a SSA value of type pulse.amplitude.rise¶ (
SSAValue|Operation) – The SSA value representation of the rise parameter.std_dev¶ (
SSAValue|Operation) – The SSA value representation of the standard deviation parameter governing the flat-top duration.
- amplitude
Access a non-variadic construct which appears before any variadic arguments.
- attributes: dict[str, Attribute]
The attributes attached to the operation.
- classmethod get_irdl_definition()
Get the IRDL operation definition.
- location: LocationAttr
The source location attached to this operation.
- name: ClassVar[str] = 'pulse.rounded_square_waveform'
The operation name. Should be a static member of the class
- properties: dict[str, Attribute]
The properties attached to the operation. Properties are inherent to the definition of an operation’s semantics, and thus cannot be discarded by transformations.
- result
Access a non-variadic construct which appears before any variadic arguments.
- rise
Access a non-variadic construct which appears before any variadic arguments.
- std_dev
Access a non-variadic construct which appears before any variadic arguments.
- traits: ClassVar[OpTraits] = <xdsl.ir.core.OpTraits object>
Traits attached to an operation definition. This is a static field, and is made empty by default by PyRDL if not set by the operation definition.
- verify_()
- property waveform_type: type[RoundedSquareWaveform]
Returns the associated QAT waveform type, which can be used to evaluate the shape of the waveform.
- width
Access a non-variadic construct which appears before any variadic arguments.
- class ScaleOp(lhs, rhs, result_type)
Bases:
BinaryOp,Generic[PULSE_VAR_TYPE]Represents the scaling of a type in the pulse dialect by some dimensionless quantity, represented by a floating point or complex number. This is used for scaling operations that are not necessarily multiplication, e.g. scaling the duration of a waveform by some factor.
Example of how this looks in textual MLIR:
%duration = pulse.constant<128e-9> : !pulse.time %scale = arith.constant<0.5> : !f64 %result = pulse.scale(%scale, %duration) : !pulse.time
- Variables:
lhs – The scaling factor, which is a dimensionless quantity represented by a floating point or complex number.
rhs – The operand to be scaled, which can be a frequency, phase, duration, amplitude or waveform.
result – The SSA value representing the result of the scaling operation, which can be used as an operand in later operations.
- Parameters:
lhs¶ (
SSAValue|Operation) – The scaling factor, which is a dimensionless quantity represented by a standard type such as integer, float or complex.rhs¶ (
Union[SSAValue[TypeVar(PULSE_VAR_TYPE, bound=FrequencyType|PhaseType|TimeType|AmplitudeType|FrameType|WaveformType)],Operation]) – The operand of the operation, which must be of a type within the pulse dialect.result_type¶ (
TypeVar(PULSE_VAR_TYPE, bound=FrequencyType|PhaseType|TimeType|AmplitudeType|FrameType|WaveformType)) – The type of the result SSA value, which must be the same as the type of the rhs operand.
- attributes: dict[str, Attribute]
The attributes attached to the operation.
- classmethod get_irdl_definition()
Get the IRDL operation definition.
- lhs
Access a non-variadic construct which appears before any variadic arguments.
- location: LocationAttr
The source location attached to this operation.
- name: ClassVar[str] = 'pulse.scale'
The operation name. Should be a static member of the class
- properties: dict[str, Attribute]
The properties attached to the operation. Properties are inherent to the definition of an operation’s semantics, and thus cannot be discarded by transformations.
- static py_operation(lhs, rhs)
Performs the scaling operation on given literals.
This is used for constant folding.
- result
Access a non-variadic construct which appears before any variadic arguments.
- rhs
Access a non-variadic construct which appears before any variadic arguments.
- traits: ClassVar[OpTraits] = <xdsl.ir.core.OpTraits object>
Traits attached to an operation definition. This is a static field, and is made empty by default by PyRDL if not set by the operation definition.
- verify()
Ensures that the type of the operand and result are consistent.
- verify_()
- class SechWaveformOp(width, amplitude, std_dev)
Bases:
SechWaveformOp,IRDLOperation,IsAnalyticalWaveformInterface,Operation,_IRNode,ABC,objectA hyperbolic-secant (sech) pulse envelope.
Implements a sech pulse defined by sech(x / width). Note that it is not normalized to be zero at the edges. The sech pulse has the desirable property of being its own Fourier transform (up to scaling), making it self-similar in time and frequency.
Example of how this looks in textual MLIR:
%width = pulse.constant<128e-9> : !pulse.time %amplitude = pulse.constant<0.5> : !pulse.amplitude %std_dev = pulse.constant<32e-9> : !pulse.time %waveform = pulse.sech_waveform(%width, %amplitude, %std_dev) : !pulse.waveform
- Variables:
width – The duration of the waveform, represented as a SSA value of type pulse.time.
amplitude – The amplitude of the waveform, represented as a SSA value of type pulse.amplitude.
std_dev – The SSA value representation of the width parameter sigma of the sech pulse.
result – The SSA value representing the resulting sech waveform, which can be used as an operand in later operations.
- Parameters:
width¶ (
SSAValue|Operation) – The duration of the waveform, represented as a SSA value of type pulse.time.amplitude¶ (
SSAValue|Operation) – The amplitude of the waveform, represented as a SSA value of type pulse.amplitude.std_dev¶ (
SSAValue|Operation) – The SSA value representation of the width parameter sigma of the sech pulse.
- amplitude
Access a non-variadic construct which appears before any variadic arguments.
- attributes: dict[str, Attribute]
The attributes attached to the operation.
- classmethod get_irdl_definition()
Get the IRDL operation definition.
- location: LocationAttr
The source location attached to this operation.
- name: ClassVar[str] = 'pulse.sech_waveform'
The operation name. Should be a static member of the class
- properties: dict[str, Attribute]
The properties attached to the operation. Properties are inherent to the definition of an operation’s semantics, and thus cannot be discarded by transformations.
- result
Access a non-variadic construct which appears before any variadic arguments.
- std_dev
Access a non-variadic construct which appears before any variadic arguments.
- traits: ClassVar[OpTraits] = <xdsl.ir.core.OpTraits object>
Traits attached to an operation definition. This is a static field, and is made empty by default by PyRDL if not set by the operation definition.
- verify_()
- property waveform_type: type[SechWaveform]
Returns the associated QAT waveform type, which can be used to evaluate the shape of the waveform.
- width
Access a non-variadic construct which appears before any variadic arguments.
- class SetupHoldWaveformOp(width, amplitude, amp_setup, rise)
Bases:
SetupHoldWaveformOp,IRDLOperation,IsAnalyticalWaveformInterface,Operation,_IRNode,ABC,objectA two-level rectangular pulse with a high-amplitude setup portion followed by a lower-amplitude hold portion.
Example of how this looks in textual MLIR:
%width = pulse.constant<128e-9> : !pulse.time %amplitude = pulse.constant<0.5> : !pulse.amplitude %rise = pulse.constant<32e-9> : !pulse.time %amp_setup = pulse.constant<0.5> : !pulse.amplitude %waveform = pulse.setup_hold_waveform(%width, %amplitude, %amp_setup, %rise) : !pulse.waveform- Variables:
width – The total duration of the waveform, represented as a SSA value of type pulse.time.
amplitude – The amplitude of the hold portion of the waveform, represented as a SSA value of type pulse.amplitude.
amp_setup – The amplitude of the setup portion of the waveform, represented as a SSA value of type pulse.amplitude.
rise – The duration of the setup portion of the waveform, represented as a SSA value of type pulse.time.
result – The SSA value representing the resulting setup-hold waveform, which can be used as an operand in later operations.
- Parameters:
width¶ (
SSAValue|Operation) – The total duration of the waveform, represented as a SSA value of type pulse.time.amplitude¶ (
SSAValue|Operation) – The amplitude of the hold portion of the waveform, represented as a SSA value of type pulse.amplitude.amp_setup¶ (
SSAValue|Operation) – The amplitude of the setup portion of the waveform, represented as a SSA value of type pulse.amplitude.rise¶ (
SSAValue|Operation) – The duration of the setup portion of the waveform, represented as a SSA value of type pulse.time.
- amp_setup
Access a non-variadic construct which appears before any variadic arguments.
- amplitude
Access a non-variadic construct which appears before any variadic arguments.
- attributes: dict[str, Attribute]
The attributes attached to the operation.
- classmethod get_irdl_definition()
Get the IRDL operation definition.
- location: LocationAttr
The source location attached to this operation.
- name: ClassVar[str] = 'pulse.setup_hold_waveform'
The operation name. Should be a static member of the class
- properties: dict[str, Attribute]
The properties attached to the operation. Properties are inherent to the definition of an operation’s semantics, and thus cannot be discarded by transformations.
- result
Access a non-variadic construct which appears before any variadic arguments.
- rise
Access a non-variadic construct which appears before any variadic arguments.
- traits: ClassVar[OpTraits] = <xdsl.ir.core.OpTraits object>
Traits attached to an operation definition. This is a static field, and is made empty by default by PyRDL if not set by the operation definition.
- verify_()
- property waveform_type: type[SetupHoldWaveform]
Returns the associated QAT waveform type, which can be used to evaluate the shape of the waveform.
- width
Access a non-variadic construct which appears before any variadic arguments.
- class SinWaveformOp(width, amplitude, frequency, internal_phase)
Bases:
SinWaveformOp,IRDLOperation,IsAnalyticalWaveformInterface,Operation,_IRNode,ABC,objectA sine-oscillating envelope.
Example of how this looks in textual MLIR:
%width = pulse.constant<128e-9> : !pulse.time %amplitude = pulse.constant<0.5> : !pulse.amplitude %frequency = pulse.constant<5e9> : !pulse.frequency %internal_phase = pulse.constant<1.5708> : !pulse.phase %waveform = pulse.sin_waveform(%width, %amplitude, %frequency, %internal_phase) : !pulse.waveform- Variables:
width – The duration of the waveform, represented as a SSA value of type pulse.time.
amplitude – The amplitude of the waveform, represented as a SSA value of type pulse.amplitude.
frequency – The oscillation frequency of the waveform, represented as a SSA value of type pulse.frequency.
internal_phase – The internal phase offset of the waveform, represented as a SSA value of type pulse.phase.
result – The SSA value representing the resulting sine waveform.
- Parameters:
width¶ (
SSAValue|Operation) – The duration of the waveform, represented as a SSA value of type pulse.time.amplitude¶ (
SSAValue|Operation) – The amplitude of the waveform, represented as a SSA value of type pulse.amplitude.frequency¶ (
SSAValue|Operation) – The oscillation frequency of the waveform, represented as a SSA value of type pulse.frequency.internal_phase¶ (
SSAValue|Operation) – The internal phase offset of the waveform, represented as a SSA value of type pulse.phase.
- amplitude
Access a non-variadic construct which appears before any variadic arguments.
- attributes: dict[str, Attribute]
The attributes attached to the operation.
- frequency
Access a non-variadic construct which appears before any variadic arguments.
- classmethod get_irdl_definition()
Get the IRDL operation definition.
- internal_phase
Access a non-variadic construct which appears before any variadic arguments.
- location: LocationAttr
The source location attached to this operation.
- name: ClassVar[str] = 'pulse.sin_waveform'
The operation name. Should be a static member of the class
- properties: dict[str, Attribute]
The properties attached to the operation. Properties are inherent to the definition of an operation’s semantics, and thus cannot be discarded by transformations.
- result
Access a non-variadic construct which appears before any variadic arguments.
- traits: ClassVar[OpTraits] = <xdsl.ir.core.OpTraits object>
Traits attached to an operation definition. This is a static field, and is made empty by default by PyRDL if not set by the operation definition.
- verify_()
- property waveform_type: type[SinWaveform]
Returns the associated QAT waveform type, which can be used to evaluate the shape of the waveform.
- width
Access a non-variadic construct which appears before any variadic arguments.
- class SoftSquareWaveformOp(width, amplitude, rise)
Bases:
SoftSquareWaveformOp,IRDLOperation,IsAnalyticalWaveformInterface,Operation,_IRNode,ABC,objectA square pulse with smooth
tanh-shaped rise and fall edges.The envelope uses two hyperbolic-tangent steps to produce rounded transitions while maintaining a flat top.
Example of how this looks in textual MLIR:
%width = pulse.constant<128e-9> : !pulse.time %amplitude = pulse.constant<0.5> : !pulse.amplitude %rise = arith.constant<0.1> : !f64 %waveform = pulse.soft_square_waveform(%width, %amplitude, %rise) : !pulse.waveform
- Variables:
width – The duration of the waveform, represented as a SSA value of type pulse.time.
amplitude – The amplitude of the waveform, represented as a SSA value of type pulse.amplitude.
rise – Controls the steepness of the tanh transition. Larger values produce a more gradual edge; smaller values approach a sharp step.
result – The SSA value representing the resulting softened square waveform, which can be used as an operand in later operations.
- Parameters:
- amplitude
Access a non-variadic construct which appears before any variadic arguments.
- attributes: dict[str, Attribute]
The attributes attached to the operation.
- classmethod get_irdl_definition()
Get the IRDL operation definition.
- location: LocationAttr
The source location attached to this operation.
- name: ClassVar[str] = 'pulse.soft_square_waveform'
The operation name. Should be a static member of the class
- properties: dict[str, Attribute]
The properties attached to the operation. Properties are inherent to the definition of an operation’s semantics, and thus cannot be discarded by transformations.
- result
Access a non-variadic construct which appears before any variadic arguments.
- rise
Access a non-variadic construct which appears before any variadic arguments.
- traits: ClassVar[OpTraits] = <xdsl.ir.core.OpTraits object>
Traits attached to an operation definition. This is a static field, and is made empty by default by PyRDL if not set by the operation definition.
- verify_()
- property waveform_type: type[SoftSquareWaveform]
Returns the associated QAT waveform type, which can be used to evaluate the shape of the waveform.
- width
Access a non-variadic construct which appears before any variadic arguments.
- class SofterGaussianWaveformOp(width, amplitude, rise)
Bases:
SofterGaussianWaveformOp,IRDLOperation,IsAnalyticalWaveformInterface,Operation,_IRNode,ABC,objectA Gaussian envelope normalised so the minimum is zero and peak is one.
Uses the same underlying
GaussianFunctionasGaussianWaveformbut subtracts the edge value and rescales, ensuring the pulse is exactly zero at ±width/2 (approximately) and peaks at 1.Example of how this looks in textual MLIR:
%width = pulse.constant<128e-9> : !pulse.time %amplitude = pulse.constant<0.5> : !pulse.amplitude %rise = arith.constant<0.1> : !f64 %waveform = pulse.softer_gaussian_waveform(%width, %amplitude, %rise) : !pulse.waveform- Variables:
width – The duration of the waveform, represented as a SSA value of type pulse.time.
amplitude – The amplitude of the waveform, represented as a SSA value of type pulse.amplitude.
rise – Shape parameter contributing to the effective width.
result – The SSA value representing the resulting softened Gaussian waveform, which can be used as an operand in later operations.
- Parameters:
width¶ (
SSAValue|Operation) – The duration of the waveform, represented as a SSA value of type pulse.time.amplitude¶ (
SSAValue|Operation) – The amplitude of the waveform, represented as a SSA value of type pulse.amplitude.rise¶ (
SSAValue|Operation) – The SSA value representation of the rise parameter.
- amplitude
Access a non-variadic construct which appears before any variadic arguments.
- attributes: dict[str, Attribute]
The attributes attached to the operation.
- classmethod get_irdl_definition()
Get the IRDL operation definition.
- location: LocationAttr
The source location attached to this operation.
- name: ClassVar[str] = 'pulse.softer_gaussian_waveform'
The operation name. Should be a static member of the class
- properties: dict[str, Attribute]
The properties attached to the operation. Properties are inherent to the definition of an operation’s semantics, and thus cannot be discarded by transformations.
- result
Access a non-variadic construct which appears before any variadic arguments.
- rise
Access a non-variadic construct which appears before any variadic arguments.
- traits: ClassVar[OpTraits] = <xdsl.ir.core.OpTraits object>
Traits attached to an operation definition. This is a static field, and is made empty by default by PyRDL if not set by the operation definition.
- verify_()
- property waveform_type: type[SofterGaussianWaveform]
Returns the associated QAT waveform type, which can be used to evaluate the shape of the waveform.
- width
Access a non-variadic construct which appears before any variadic arguments.
- class SofterSquareWaveformOp(width, amplitude, std_dev, rise)
Bases:
SofterSquareWaveformOp,IRDLOperation,IsAnalyticalWaveformInterface,Operation,_IRNode,ABC,objectA normalised double-tanh square pulse with extra edge softening.
Similar to
SoftSquareWaveformbut the envelope is normalised so that the peak is always one and the edges are pulled further toward zero by offsetting with the rise parameter on both sides.Example of how this looks in textual MLIR:
%width = pulse.constant<128e-9> : !pulse.time %amplitude = pulse.constant<0.5> : !pulse.amplitude %std_dev = pulse.constant<32e-9> : !pulse.time %rise = arith.constant<0.1> : !f64 %waveform = pulse.softer_square_waveform(%width, %amplitude, %std_dev, %rise) : !pulse.waveform- Variables:
width – The duration of the waveform, represented as a SSA value of type pulse.time.
amplitude – The amplitude of the waveform, represented as a SSA value of type pulse.amplitude.
std_dev – Half-width parameter governing the flat-top duration.
rise – Edge rise/fall scale. Larger values give a softer slope than
SoftSquareWaveformbecause the tanh transitions are shifted inward by exactly onerisestep on each side.result – The SSA value representing the resulting softened square waveform, which can be used as an operand in later operations.
- Parameters:
width¶ (
SSAValue|Operation) – The duration of the square waveform, represented as a SSA value of type pulse.time.amplitude¶ (
SSAValue|Operation) – The amplitude of the square waveform, represented as a SSA value of type pulse.amplitude.std_dev¶ (
SSAValue|Operation) – Half-width parameter governing the flat-top duration.rise¶ (
SSAValue|Operation) – The SSA value representation of the rise parameter.
- amplitude
Access a non-variadic construct which appears before any variadic arguments.
- attributes: dict[str, Attribute]
The attributes attached to the operation.
- classmethod get_irdl_definition()
Get the IRDL operation definition.
- location: LocationAttr
The source location attached to this operation.
- name: ClassVar[str] = 'pulse.softer_square_waveform'
The operation name. Should be a static member of the class
- properties: dict[str, Attribute]
The properties attached to the operation. Properties are inherent to the definition of an operation’s semantics, and thus cannot be discarded by transformations.
- result
Access a non-variadic construct which appears before any variadic arguments.
- rise
Access a non-variadic construct which appears before any variadic arguments.
- std_dev
Access a non-variadic construct which appears before any variadic arguments.
- traits: ClassVar[OpTraits] = <xdsl.ir.core.OpTraits object>
Traits attached to an operation definition. This is a static field, and is made empty by default by PyRDL if not set by the operation definition.
- verify_()
- property waveform_type: type[SofterSquareWaveform]
Returns the associated QAT waveform type, which can be used to evaluate the envelope.
- width
Access a non-variadic construct which appears before any variadic arguments.
- class SquareWaveformOp(width, amplitude)
Bases:
SquareWaveformOp,IRDLOperation,IsAnalyticalWaveformInterface,Operation,_IRNode,ABC,objectRepresents a square waveform, defined by its duration and amplitude.
Example of how this looks in textual MLIR:
%duration = pulse.constant<128e-9> : !pulse.time %amplitude = pulse.constant<0.5> : !pulse.amplitude %waveform = pulse.square_waveform(%duration, %amplitude) : !pulse.waveform
- Variables:
width – The duration of the square waveform, represented as a SSA value of type pulse.time.
amplitude – The amplitude of the square waveform, represented as a SSA value of type pulse.amplitude.
result – The SSA value representing the resulting square waveform, which can be used as an operand in later operations.
- Parameters:
- amplitude
Access a non-variadic construct which appears before any variadic arguments.
- attributes: dict[str, Attribute]
The attributes attached to the operation.
- classmethod get_irdl_definition()
Get the IRDL operation definition.
- location: LocationAttr
The source location attached to this operation.
- name: ClassVar[str] = 'pulse.square_waveform'
The operation name. Should be a static member of the class
- properties: dict[str, Attribute]
The properties attached to the operation. Properties are inherent to the definition of an operation’s semantics, and thus cannot be discarded by transformations.
- result
Access a non-variadic construct which appears before any variadic arguments.
- traits: ClassVar[OpTraits] = <xdsl.ir.core.OpTraits object>
Traits attached to an operation definition. This is a static field, and is made empty by default by PyRDL if not set by the operation definition.
- verify_()
- property waveform_type: type[SquareWaveform]
Returns the associated QAT waveform type, which can be used to evaluate the shape of the waveform.
- width
Access a non-variadic construct which appears before any variadic arguments.
- class StartContinuousWaveformOp(frame, amplitude)
Bases:
StartContinuousWaveformOp,IRDLOperation,Operation,_IRNode,ABC,objectRepresents the start of a continuous waveform, which is a waveform that is played indefinitely until a corresponding stop operation is reached.
Example of how this looks in textual MLIR, paired with
StopContinuousWaveformOp:%frame = pulse.create_frame(%frequency) {physical_channel = "channel_1"} : !pulse.frame %amplitude = pulse.constant<0.5> : !pulse.amplitude %frame2 = pulse.start_continuous_waveform(%frame, %amplitude) : !pulse.frame %duration = pulse.constant<800e-9> : !pulse.time %frame3 = pulse.wait(%frame2, %duration) : !pulse.frame %frame4 = pulse.stop_continuous_waveform(%frame3) : !pulse.frame- Variables:
frame – The SSA value representing the frame on which to start the continuous waveform.
amplitude – The SSA value representing the amplitude of the continuous waveform, of type pulse.amplitude.
result – The SSA value representing the resulting frame after starting the continuous waveform, which can be used as an operand in later operations.
- Parameters:
- amplitude
Access a non-variadic construct which appears before any variadic arguments.
- attributes: dict[str, Attribute]
The attributes attached to the operation.
- frame
Access a non-variadic construct which appears before any variadic arguments.
- classmethod get_irdl_definition()
Get the IRDL operation definition.
- location: LocationAttr
The source location attached to this operation.
- name: ClassVar[str] = 'pulse.start_continuous_waveform'
The operation name. Should be a static member of the class
- properties: dict[str, Attribute]
The properties attached to the operation. Properties are inherent to the definition of an operation’s semantics, and thus cannot be discarded by transformations.
- result
Access a non-variadic construct which appears before any variadic arguments.
- traits: ClassVar[OpTraits] = <xdsl.ir.core.OpTraits object>
Traits attached to an operation definition. This is a static field, and is made empty by default by PyRDL if not set by the operation definition.
- verify_()
- class StopContinuousWaveformOp(frame)
Bases:
StopContinuousWaveformOp,IRDLOperation,Operation,_IRNode,ABC,objectRepresents stopping a continuous waveform, which is a waveform that is played indefinitely until a corresponding stop operation is reached. Paired with
StartContinuousWaveformOp.- Variables:
frame – The SSA value representing the frame on which to stop the continuous waveform.
result – The SSA value representing the resulting frame after stopping the continuous waveform, which can be used as an operand in later operations.
- Parameters:
frame¶ (
SSAValue|Operation) – The SSA value representing the frame on which to stop the continuous waveform.
- attributes: dict[str, Attribute]
The attributes attached to the operation.
- frame
Access a non-variadic construct which appears before any variadic arguments.
- classmethod get_irdl_definition()
Get the IRDL operation definition.
- location: LocationAttr
The source location attached to this operation.
- name: ClassVar[str] = 'pulse.stop_continuous_waveform'
The operation name. Should be a static member of the class
- properties: dict[str, Attribute]
The properties attached to the operation. Properties are inherent to the definition of an operation’s semantics, and thus cannot be discarded by transformations.
- result
Access a non-variadic construct which appears before any variadic arguments.
- traits: ClassVar[OpTraits] = <xdsl.ir.core.OpTraits object>
Traits attached to an operation definition. This is a static field, and is made empty by default by PyRDL if not set by the operation definition.
- verify_()
- class SubOp(lhs, rhs, result_type)
Bases:
InternalBinaryOp[PULSE_VAR_TYPE],Generic[PULSE_VAR_TYPE]Represents subtraction of two values of the same types, including frequencies, phases, durations, amplitudes and waveforms.
Example of how this looks in textual MLIR:
%frequency1 = pulse.constant<5e9> : !pulse.frequency %frequency2 = pulse.constant<1e9> : !pulse.frequency %result = pulse.sub(%frequency1, %frequency2) : !pulse.frequency
- Variables:
lhs – The left-hand side operand of the subtraction operation.
rhs – The right-hand side operand of the subtraction operation.
result – The SSA value representing the result of the subtraction operation, which can be used as an operand in later operations.
- Parameters:
lhs¶ (
Union[SSAValue[TypeVar(PULSE_VAR_TYPE, bound=FrequencyType|PhaseType|TimeType|AmplitudeType|FrameType|WaveformType)],Operation]) – The left-hand side operand of the binary operation, which must be of a type within the pulse dialect.rhs¶ (
Union[SSAValue[TypeVar(PULSE_VAR_TYPE, bound=FrequencyType|PhaseType|TimeType|AmplitudeType|FrameType|WaveformType)],Operation]) – The right-hand side operand of the binary operation, which must be of a type within the pulse dialect.result_type¶ (
TypeVar(PULSE_VAR_TYPE, bound=FrequencyType|PhaseType|TimeType|AmplitudeType|FrameType|WaveformType)) – The type of the result SSA value, which must be the same as the types of the operands.
- attributes: dict[str, Attribute]
The attributes attached to the operation.
- classmethod get_irdl_definition()
Get the IRDL operation definition.
- lhs
Access a non-variadic construct which appears before any variadic arguments.
- location: LocationAttr
The source location attached to this operation.
- name: ClassVar[str] = 'pulse.sub'
The operation name. Should be a static member of the class
- properties: dict[str, Attribute]
The properties attached to the operation. Properties are inherent to the definition of an operation’s semantics, and thus cannot be discarded by transformations.
- static py_operation(lhs, rhs)
Performs the subtraction operation on given literals.
This is used for constant folding.
- result
Access a non-variadic construct which appears before any variadic arguments.
- rhs
Access a non-variadic construct which appears before any variadic arguments.
- traits: ClassVar[OpTraits] = <xdsl.ir.core.OpTraits object>
Traits attached to an operation definition. This is a static field, and is made empty by default by PyRDL if not set by the operation definition.
- verify_()
- class SynchronizeOp(*frames)
Bases:
SynchronizeOp,IRDLOperation,Operation,_IRNode,ABC,objectSynchronizes a set of frames, ensuring they all progress to the same time.
This is used to ensure operations on different frames are correctly synchronized in time.
Example of how this looks in textual MLIR:
%frame1 = pulse.create_frame(%frequency1) {physical_channel = "channel_1"} : !pulse.frame %frame2 = pulse.create_frame(%frequency2) {physical_channel = "channel_2"} : !pulse.frame %frame3, %frame4 = pulse.sync(%frame1,%frame2) : (!pulse.frame, !pulse.frame)- Variables:
frames – A list of SSA values representing the frames to be synchronized.
result – A list of SSA values representing the resulting synchronized frames, which can be used as operands in later operations. The order of the results corresponds to the order of the input frames.
- Parameters:
frames¶ (
SSAValue|Operation) – A variable number of SSA values representing the frames to be synchronized.
- attributes: dict[str, Attribute]
The attributes attached to the operation.
- frames
Access a variadic construct in the case where it is the only variadic.
- classmethod get_irdl_definition()
Get the IRDL operation definition.
- location: LocationAttr
The source location attached to this operation.
- name: ClassVar[str] = 'pulse.sync'
The operation name. Should be a static member of the class
- properties: dict[str, Attribute]
The properties attached to the operation. Properties are inherent to the definition of an operation’s semantics, and thus cannot be discarded by transformations.
- result
Access a variadic construct in the case where it is the only variadic.
- traits: ClassVar[OpTraits] = <xdsl.ir.core.OpTraits object>
Traits attached to an operation definition. This is a static field, and is made empty by default by PyRDL if not set by the operation definition.
- verify()
Verifies that at least two frames are being synchronized, and that the number of results matches the number of operands.
- verify_()
- class WaitOp(frame, duration)
Bases:
WaitOp,IRDLOperation,Operation,_IRNode,ABC,objectProgresses time on a given frame by a specified amount, without playing any waveform.
This is used to ensure waveforms are played at the correct time.
Example of how this looks in textual MLIR:
%frame = pulse.create_frame(%frequency) {physical_channel = "channel_1"} : !pulse.frame %frame2 = pulse.wait(%frame, %duration) : !pulse.frameNote
In older versions of QAT-IR, this operation was called “Delay”.
- Variables:
frame – The SSA value representing the frame on which to wait.
duration – The SSA value representing the amount of time to wait, of type pulse.time.
result – The SSA value representing the resulting frame after waiting, which can be used as an operand in later operations.
- Parameters:
- attributes: dict[str, Attribute]
The attributes attached to the operation.
- duration
Access a non-variadic construct which appears before any variadic arguments.
- frame
Access a non-variadic construct which appears before any variadic arguments.
- classmethod get_irdl_definition()
Get the IRDL operation definition.
- location: LocationAttr
The source location attached to this operation.
- name: ClassVar[str] = 'pulse.wait'
The operation name. Should be a static member of the class
- properties: dict[str, Attribute]
The properties attached to the operation. Properties are inherent to the definition of an operation’s semantics, and thus cannot be discarded by transformations.
- result
Access a non-variadic construct which appears before any variadic arguments.
- traits: ClassVar[OpTraits] = <xdsl.ir.core.OpTraits object>
Traits attached to an operation definition. This is a static field, and is made empty by default by PyRDL if not set by the operation definition.
- verify_()