Skip to content

qoolqit.waveforms.waveforms

source module qoolqit.waveforms.waveforms

Classes

  • Delay An empty waveform.

  • Ramp A ramp that linearly interpolates between an initial and final value.

  • Constant A constant waveform over a given duration.

  • PiecewiseLinear A piecewise linear waveform.

  • Interpolated A waveform created from interpolation of a set of data points.

  • Sin An arbitrary sine over a given duration.

source class Delay(duration: float, *args: float, **kwargs: float)

Bases : Waveform

An empty waveform.

Initializes the Waveform.

Parameters

  • duration : float the total duration of the waveform.

Attributes

  • duration : float Returns the duration of the waveform.

  • params : dict[str, float] Dictionary of parameters used by the waveform.

Methods

source method Delay.function(t: float)float

source method Delay.max()float

source method Delay.min()float

source class Ramp(duration: float, initial_value: float, final_value: float)

Bases : Waveform

A ramp that linearly interpolates between an initial and final value.

Parameters

  • duration : float the total duration.

  • initial_value : float the initial value at t = 0.

  • final_value : float the final value at t = duration.

Attributes

  • duration : float Returns the duration of the waveform.

  • params : dict[str, float] Dictionary of parameters used by the waveform.

Methods

source method Ramp.function(t: float)float

source method Ramp.max()float

source method Ramp.min()float

source class Constant(duration: float, value: float)

Bases : Waveform

A constant waveform over a given duration.

Parameters

  • duration : float the total duration.

  • value : float the value to take during the duration.

Attributes

  • duration : float Returns the duration of the waveform.

  • params : dict[str, float] Dictionary of parameters used by the waveform.

Methods

source method Constant.function(t: float)float

source method Constant.max()float

source method Constant.min()float

source class PiecewiseLinear(durations: list | tuple, values: list | tuple)

Bases : CompositeWaveform

A piecewise linear waveform.

Creates a composite waveform of N ramps that linearly interpolate through the given N+1 values.

Parameters

  • durations : list | tuple list or tuple of N duration values.

  • values : list | tuple list or tuple of N+1 waveform values.

Attributes

  • duration : float Returns the duration of the waveform.

  • params : dict[str, float] Dictionary of parameters used by the waveform.

  • durations : list[float] Returns the list of durations of each individual waveform.

  • times : list[float] Returns the list of times when each individual waveform starts.

  • waveforms : list[Waveform] Returns a list of the individual waveforms.

  • n_waveforms : int Returns the number of waveforms.

source class Interpolated(duration: float, values: ArrayLike, times: Optional[ArrayLike] = None, interpolator: str = 'PchipInterpolator', **interpolator_kwargs: Any)

Bases : Waveform

A waveform created from interpolation of a set of data points.

Initializes a new InterpolatedWaveform.

Parameters

  • duration : int The waveform duration (in ns).

  • values : ArrayLike Values of the interpolation points. Must be a list of castable to float or a parametrized object.

  • times : ArrayLike Fractions of the total duration (between 0 and 1), indicating where to place each value on the time axis. Must be a list of castable to float or a parametrized object. If not given, the values are spread evenly throughout the full duration of the waveform.

  • interpolator : str The SciPy interpolation class to use. Supports "PchipInterpolator" and "interp1d".

Attributes

  • duration : float Returns the duration of the waveform.

  • params : dict[str, float] Dictionary of parameters used by the waveform.

Methods

source method Interpolated.function(t: float)float

source method Interpolated.min()float

source method Interpolated.max()float

source class Sin(duration: float, amplitude: float = 1.0, omega: float = 1.0, phi: float = 0.0, shift: float = 0.0)

Bases : Waveform

An arbitrary sine over a given duration.

Parameters

  • duration : float the total duration.

  • amplitude : float the amplitude of the sine wave.

  • omega : float the frequency of the sine wave.

  • phi : float the phase of the sine wave.

  • shift : float the vertical shift of the sine wave.

Attributes

  • duration : float Returns the duration of the waveform.

  • params : dict[str, float] Dictionary of parameters used by the waveform.

Methods

source method Sin.function(t: float)float