Skip to content
Pasqal Documentation

KaiserWaveform

class pulser.waveforms.KaiserWaveform(duration, area, beta=14.0)

Bases: Waveform

A Kaiser window of a specified duration and beta parameter.

For more information on the Kaiser window and the beta parameter, check the numpy documentation for the kaiser(M, beta) function: https://numpy.org/doc/stable/reference/generated/numpy.kaiser.html (external)

Warning

The KaiserWaveform assumes its values are in rad/µs for the area calculation. If this is not the case, the ‘area’ value should be scaled accordingly.

Parameters:
  • duration (int | Parametrized) – The waveform duration (in ns).

  • area (float | TensorLike | Parametrized) – The integral of the waveform. Can be negative, in which case it takes the positive waveform and changes the sign of all its values.

  • beta (float | Parametrized | None, default: 14.0) – The beta parameter of the Kaiser window. The default value is 14.

Attributes

duration

The duration of the pulse (in ns).

first_value

The first value in the waveform.

integral

Integral of the waveform (in [waveform units].µs).

last_value

The last value in the waveform.

samples

The value at each time step that describes the waveform.

Methods

change_duration

Returns a new waveform with modified duration.

draw

Draws the waveform.

from_max_val

Creates a Kaiser waveform with a threshold on the maximum value.

modulated_samples

The waveform samples as output of a given channel.

modulation_buffers

The minimal buffers needed around a modulated waveform.

Signatures

change_duration(new_duration)

Returns a new waveform with modified duration.

Parameters:

new_duration (int) – The duration of the new waveform.

Return type:

KaiserWaveform

Returns:

The new waveform with the same area and beta but a new duration.

draw(output_channel=None, ylabel=None)

Draws the waveform.

Parameters:
  • output_channel (Channel | None, default: None) – The output channel. If given, will draw the modulated waveform on top of the input one.

  • ylabel (str | None, default: None) – An optional label for the y-axis of the plot.

Return type:

None

classmethod from_max_val(cls, max_val, area, beta=14.0)

Creates a Kaiser waveform with a threshold on the maximum value.

Instead of defining a duration, the waveform is defined by its area and the maximum value. The duration is chosen so that the maximum value is not surpassed, but approached as closely as possible.

Warning

The KaiserWaveform assumes its values are in rad/µs for the area calculation. If this is not the case, the ‘max_val’ and ‘area’ values should be scaled accordingly.

Parameters:
  • max_val (float | Parametrized) – The maximum value threshold (in rad/µs). If negative, it is taken as the lower bound i.e. the minimum value that can be reached. The sign of max_val must match the sign of area.

  • area (float | TensorLike | Parametrized) – The area under the waveform.

  • beta (float | Parametrized | None, default: 14.0) – The beta parameter of the Kaiser window. The default value is 14.

Return type:

KaiserWaveform

modulated_samples(channel, eom=False)

The waveform samples as output of a given channel.

This duration is adjusted according to the minimal buffer times.

Parameters:
  • channel (Channel) – The channel modulating the waveform.

  • eom (bool, default: False) – Whether to modulate for the EOM.

Return type:

AbstractArray

Returns:

The array of samples after modulation.

modulation_buffers(channel, eom=False)

The minimal buffers needed around a modulated waveform.

Parameters:
  • channel (Channel) – The channel modulating the waveform.

  • eom (bool, default: False) – Whether to calculate the modulation buffers with the EOM bandwidth.

Return type:

tuple[int, int]

Returns:

The minimum buffer times at the start and end of the samples, in ns.

property duration: int

The duration of the pulse (in ns).

property first_value: float

The first value in the waveform.

property integral: float

Integral of the waveform (in [waveform units].µs).

property last_value: float

The last value in the waveform.

property samples: AbstractArray

The value at each time step that describes the waveform.

Returns:

A numpy array with a value for each time step.