You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This returns a class instance dedicated to each waveform kind.
In #7821 , we replaced the base class of them from ParametricPulse to SymbolicPulse. In contrast to parametric pulse, symbolic pulse can uniquely determine waveform with instance variables self._envelope and self._pulse_type which are a symbolic equation and string, respectively. This means, these subclasses are no longer necessary and we can turn everything into symbolic pulse instance. This can simplify the deserialization logic of QPY (actually type information is not stored).
Proposal
I want to convert Gaussian class into a symbolic pulse factory while keeping camel case :
However, because we have never prohibited users from using type information, we need proper communication with some warning mechanism. Adding deprecation warning in symbolic pulse constructor is very annoying since it will issue tones of warnings (e.g. loading each pulse in backend CmdDef). Probably overriding __instancecheck__ method to show deprecation warning is possible, however, this is not sensitive to, for example, __class__.__name__.
The text was updated successfully, but these errors were encountered:
What should we add?
Background
We have four parametric pulse subclass in pulse library, namely,
Gaussian
,GaussianSquare
,Drag
,Constant
.This returns a class instance dedicated to each waveform kind.
In #7821 , we replaced the base class of them from
ParametricPulse
toSymbolicPulse
. In contrast to parametric pulse, symbolic pulse can uniquely determine waveform with instance variablesself._envelope
andself._pulse_type
which are a symbolic equation and string, respectively. This means, these subclasses are no longer necessary and we can turn everything into symbolic pulse instance. This can simplify the deserialization logic of QPY (actually type information is not stored).Proposal
I want to convert
Gaussian
class into a symbolic pulse factory while keeping camel case :so that user code works without deprecation, e.g.
Problems
However, sometimes type information is used in the codebase. For example, in the RZX transpiler pass:
https://github.com/Qiskit/qiskit-terra/blob/10822404936e98df01f2975ef43b8378006621ba/qiskit/transpiler/passes/calibration/builders.py#L163-L168
I can update such use case in our codebase. This can be written without type information like below.
However, because we have never prohibited users from using type information, we need proper communication with some warning mechanism. Adding deprecation warning in symbolic pulse constructor is very annoying since it will issue tones of warnings (e.g. loading each pulse in backend CmdDef). Probably overriding
__instancecheck__
method to show deprecation warning is possible, however, this is not sensitive to, for example,__class__.__name__
.The text was updated successfully, but these errors were encountered: