Skip to content

bloqade.analog.factory.piecewise_linear

← Module overview

functionpiecewise_linearsource

bloqade.analog.factory.piecewise_linear

Signature
def piecewise_linear(durations: List[ScalarType], values: List[ScalarType]) -> Waveform

Create a piecewise linear waveform.

Create a piecewise linear waveform from a list of durations and values. The value duration[i] is of the linear segment between values[i] and values[i+1].

Parameters

NameTypeDescription
durationsList[ScalarType]The duration of each segment
valuesList[ScalarType]The values for each segment

Returns

WaveformWaveform: The piecewise linear waveform.

Raises

TypeDescription
ValueErrorIf the length of `values` is not one greater than the length of
source