Skip to content

bloqade.analog.factory.piecewise_constant

← Module overview

functionpiecewise_constantsource

bloqade.analog.factory.piecewise_constant

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

Create a piecewise linear waveform.

Create a piecewise constant waveform from a list of durations and values. The value duration[i] corresponds to the length of time for the i’th segment with a value of values[i].

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 the same as the length of
source