braket.pulse.waveforms module
- class braket.pulse.waveforms.Waveform[source]
Bases:
ABC
A waveform is a time-dependent envelope that can be used to emit signals on an output port or receive signals from an input port. As such, when transmitting signals to the qubit, a frame determines time at which the waveform envelope is emitted, its carrier frequency, and it’s phase offset. When capturing signals from a qubit, at minimum a frame determines the time at which the signal is captured. See https://openqasm.com/language/openpulse.html#waveforms for more details.
- class braket.pulse.waveforms.ArbitraryWaveform(amplitudes: list[complex], id: str | None = None)[source]
Bases:
Waveform
An arbitrary waveform with amplitudes at each timestep explicitly specified using an array.
Initializes an
ArbitraryWaveform
.- Parameters:
amplitudes (list[complex]) – Array of complex values specifying the waveform amplitude at each timestep. The timestep is determined by the sampling rate of the frame to which waveform is applied to.
id (Optional[str]) – The identifier used for declaring this waveform. A random string of ascii characters is assigned by default.
- class braket.pulse.waveforms.ConstantWaveform(length: float | FreeParameterExpression, iq: complex, id: str | None = None)[source]
Bases:
Waveform
,Parameterizable
A constant waveform which holds the supplied
iq
value as its amplitude for the specified length.Initializes a
ConstantWaveform
.- Parameters:
length (Union[float, FreeParameterExpression]) – Value (in seconds) specifying the duration of the waveform.
iq (complex) – complex value specifying the amplitude of the waveform.
id (Optional[str]) – The identifier used for declaring this waveform. A random string of ascii characters is assigned by default.
- property parameters: list[FreeParameterExpression | FreeParameter | float]
Returns the parameters associated with the object, either unbound free parameter expressions or bound values.
- Returns:
list[Union[FreeParameterExpression, FreeParameter, float]] – a list of parameters.
- bind_values(**kwargs: FreeParameter | str) ConstantWaveform [source]
Takes in parameters and returns an object with specified parameters replaced with their values.
- Parameters:
**kwargs (Union[FreeParameter, str]) – Arbitrary keyword arguments.
- Returns:
ConstantWaveform – A copy of this waveform with the requested parameters bound.
- class braket.pulse.waveforms.DragGaussianWaveform(length: float | FreeParameterExpression, sigma: float | FreeParameterExpression, beta: float | FreeParameterExpression, amplitude: float | FreeParameterExpression = 1, zero_at_edges: bool = False, id: str | None = None)[source]
Bases:
Waveform
,Parameterizable
A gaussian waveform with an additional gaussian derivative component and lifting applied.
Initializes a
DragGaussianWaveform
.- Parameters:
length (Union[float, FreeParameterExpression]) – Value (in seconds) specifying the duration of the waveform.
sigma (Union[float, FreeParameterExpression]) – A measure (in seconds) of how wide or narrow the Gaussian peak is.
beta (Union[float, FreeParameterExpression]) – The correction amplitude.
amplitude (Union[float, FreeParameterExpression]) – The amplitude of the waveform envelope. Defaults to 1.
zero_at_edges (bool) – bool specifying whether the waveform amplitude is clipped to zero at the edges. Defaults to False.
id (Optional[str]) – The identifier used for declaring this waveform. A random string of ascii characters is assigned by default.
- property parameters: list[FreeParameterExpression | FreeParameter | float]
Returns the parameters associated with the object, either unbound free parameter expressions or bound values.
- bind_values(**kwargs: FreeParameter | str) DragGaussianWaveform [source]
Takes in parameters and returns an object with specified parameters replaced with their values.
- Parameters:
**kwargs (Union[FreeParameter, str]) – Arbitrary keyword arguments.
- Returns:
DragGaussianWaveform – A copy of this waveform with the requested parameters bound.
- class braket.pulse.waveforms.GaussianWaveform(length: float | FreeParameterExpression, sigma: float | FreeParameterExpression, amplitude: float | FreeParameterExpression = 1, zero_at_edges: bool = False, id: str | None = None)[source]
Bases:
Waveform
,Parameterizable
A waveform with amplitudes following a gaussian distribution for the specified parameters.
Initializes a
GaussianWaveform
.- Parameters:
length (Union[float, FreeParameterExpression]) – Value (in seconds) specifying the duration of the waveform.
sigma (Union[float, FreeParameterExpression]) – A measure (in seconds) of how wide or narrow the Gaussian peak is.
amplitude (Union[float, FreeParameterExpression]) – The amplitude of the waveform envelope. Defaults to 1.
zero_at_edges (bool) – bool specifying whether the waveform amplitude is clipped to zero at the edges. Defaults to False.
id (Optional[str]) – The identifier used for declaring this waveform. A random string of ascii characters is assigned by default.
- property parameters: list[FreeParameterExpression | FreeParameter | float]
Returns the parameters associated with the object, either unbound free parameter expressions or bound values.
- bind_values(**kwargs: FreeParameter | str) GaussianWaveform [source]
Takes in parameters and returns an object with specified parameters replaced with their values.
- Parameters:
**kwargs (Union[FreeParameter, str]) – Arbitrary keyword arguments.
- Returns:
GaussianWaveform – A copy of this waveform with the requested parameters bound.
- class braket.pulse.waveforms.ErfSquareWaveform(length: float | FreeParameterExpression, width: float | FreeParameterExpression, sigma: float | FreeParameterExpression, off_center: float | FreeParameterExpression = 0, amplitude: float | FreeParameterExpression = 1, zero_at_edges: bool = False, id: str | None = None)[source]
Bases:
Waveform
,Parameterizable
A square waveform with smoothed edges.
Initializes a
ErfSquareWaveform
.\[(\text{step}((t-t_1)/sigma) + \text{step}(-(t-t_2)/sigma) - 1)\]where \(\text{step}(t)\) is the rounded step function defined as \((erf(t)+1)/2\) and \(t_1\) and \(t_2\) are the timestamps at the half height. The waveform is scaled such that its maximum is equal to
amplitude
.- Parameters:
length (float | FreeParameterExpression) – Duration (in seconds) from the start to the end of the waveform.
width (float | FreeParameterExpression) – Duration (in seconds) between the half height of the two edges.
sigma (float | FreeParameterExpression) – A characteristic time of how quickly the edges rise and fall.
off_center (float | FreeParameterExpression) – Shift the smoothed square waveform earlier or later in time. When positive, the smoothed square is shifted later (to the right), otherwise earlier (to the left). Defaults to 0.
amplitude (float | FreeParameterExpression) – The amplitude of the waveform envelope. Defaults to 1.
zero_at_edges (bool) – Whether the waveform is scaled such that it has zero value at the edges. Defaults to False.
id (str | None) – The identifier used for declaring this waveform. A random string of ascii characters is assigned by default.
- property parameters: list[FreeParameterExpression | FreeParameter | float]
Returns the parameters associated with the object, either unbound free parameter expressions or bound values.
- bind_values(**kwargs: FreeParameter | str) ErfSquareWaveform [source]
Takes in parameters and returns an object with specified parameters replaced with their values.
- Parameters:
**kwargs (FreeParameter | str) – Arbitrary keyword arguments.
- Returns:
ErfSquareWaveform – A copy of this waveform with the requested parameters bound.