ScalableSymbolicPulse#
- class qiskit.pulse.library.ScalableSymbolicPulse(pulse_type, duration, amp, angle, parameters=None, name=None, limit_amplitude=None, envelope=None, constraints=None, valid_amp_conditions=None)[ソース]#
ベースクラス:
SymbolicPulse
Subclass of
SymbolicPulse
for pulses with scalable envelope.Instance of
ScalableSymbolicPulse
behaves the same as an instance ofSymbolicPulse
, but its envelope is assumed to have a scalable form \(\text{amp}\times\exp\left(i\times\text{angle}\right)\times\text{F} \left(t,\text{parameters}\right)\), where \(\text{F}\) is some function describing the rest of the envelope, and both amp and angle are real (float). Note that both amp and angle are stored in theparameters
dictionary of theScalableSymbolicPulse
instance.When two
ScalableSymbolicPulse
objects are equated, instead of comparing amp and angle individually, only the complex amplitude :math:』text{amp}timesexpleft(itimestext{angle}right)』 is compared.Create a scalable symbolic pulse.
バージョン 0.25.0 で非推奨: Setting
amp
to a complex in the ScalableSymbolicPulse constructor is deprecated as of qiskit-terra 0.25.0. It will be removed no earlier than 3 months after the release date. Instead, use a float foramp
(for the magnitude) and a float forangle
- パラメータ:
pulse_type (str) – Display name of this pulse shape.
duration (ParameterExpression | int) – Duration of pulse.
amp (ParameterExpression | float) – The magnitude of the complex amplitude of the pulse.
angle (ParameterExpression | float) – The phase of the complex amplitude of the pulse.
parameters (Dict[str, ParameterExpression | complex] | None) – Dictionary of pulse parameters that defines the pulse envelope.
name (str | None) – Display name for this particular pulse envelope.
limit_amplitude (bool | None) – If
True
, then limit the absolute value of the amplitude of the waveform to 1. The default isTrue
and the amplitude is constrained to 1.envelope (Expr | None) – Pulse envelope expression.
constraints (Expr | None) – Pulse parameter constraint expression.
valid_amp_conditions (Expr | None) – Extra conditions to skip a full-waveform check for the amplitude limit. If this condition is not met, then the validation routine will investigate the full-waveform and raise an error when the amplitude norm of any data point exceeds 1.0. If not provided, the validation always creates a full-waveform.
- 例外:
PulseError – If both amp is complex and angle is not None or 0.
Attributes
- constraints#
Return symbolic expression for the pulse parameter constraints.
- duration#
- envelope#
Return symbolic expression for the pulse envelope.
- id#
Unique identifier for this pulse.
- limit_amplitude = True#
- name#
- parameters#
- pulse_type#
Return display name of the pulse shape.
- valid_amp_conditions#
Return symbolic expression for the pulse amplitude constraints.
Methods
- draw(style=None, backend=None, time_range=None, time_unit='dt', show_waveform_info=True, plotter='mpl2d', axis=None)#
Plot the interpolated envelope of pulse.
- パラメータ:
style (Dict[str, Any] | None) – Stylesheet options. This can be dictionary or preset stylesheet classes. See
IQXStandard
,IQXSimple
, andIQXDebugging
for details of preset stylesheets.backend (Optional[BaseBackend]) – Backend object to play the input pulse program. If provided, the plotter may use to make the visualization hardware aware.
time_range (Tuple[int, int] | None) – Set horizontal axis limit. Tuple
(tmin, tmax)
.time_unit (str) – The unit of specified time range either
dt
orns
. The unit ofns
is available only whenbackend
object is provided.show_waveform_info (bool) – Show waveform annotations, i.e. name, of waveforms. Set
True
to show additional information about waveforms.plotter (str) –
Name of plotter API to generate an output image. One of following APIs should be specified:
mpl2d: Matplotlib API for 2D image generation. Matplotlib API to generate 2D image. Charts are placed along y axis with vertical offset. This API takes matplotlib.axes.Axes as `axis` input.
axis and style kwargs may depend on the plotter.
axis (Any | None) – Arbitrary object passed to the plotter. If this object is provided, the plotters use a given
axis
instead of internally initializing a figure object. This object format depends on the plotter. See plotter argument for details.
- 戻り値:
Visualization output data. The returned data type depends on the
plotter
. If matplotlib family is specified, this will be amatplotlib.pyplot.Figure
data.
- get_waveform()#
Return a Waveform with samples filled according to the formula that the pulse represents and the parameter values it contains.
Since the returned array is a discretized time series of the continuous function, this method uses a midpoint sampler. For
duration
, return:\[\{f(t+0.5) \in \mathbb{C} | t \in \mathbb{Z} \wedge 0<=t<\texttt{duration}\}\]- 戻り値:
A waveform representation of this pulse.
- 例外:
PulseError – When parameters are not assigned.
PulseError – When expression for pulse envelope is not assigned.
- 戻り値の型:
- validate_parameters()#
Validate parameters.
- 例外:
PulseError – If the parameters passed are not valid.