qat.experimental.waveforms.shapes.base module
Shared decorators and helpers for waveform shape sampling.
- class WaveformShape
Bases:
ABCAbstract base class for waveform shapes.
Child classes must implement the evaluate and derivative methods to provide the specific waveform shape and its derivatives.
- abstract derivative(x, order=1)
Evaluates the derivative of the waveform shape at the given sample points.
- derivative_definition(fn=None, *, sample_parameter='x', order_parameter='order')
Coerces/validates sampling points and validates derivative order.
- Parameters:
fn¶ (
Optional[Callable[[ParamSpec(P)],TypeVar(T)]]) – The function to decorate.sample_parameter¶ (
str|int) – The parameter that contains the sample points to validate. This may be a parameter name (for example"x") or the index of a positional parameter.order_parameter¶ (
str|int) – The parameter that contains the derivative order. This may be a parameter name (for example"order") or the index of a positional parameter.
- Return type:
Callable[[ParamSpec(P)],TypeVar(T)] |Callable[[Callable[[ParamSpec(P)],TypeVar(T)]],Callable[[ParamSpec(P)],TypeVar(T)]]
- shape_definition(fn=None, *, sample_parameter='x')
Coerces and validates normalized sampling points before shape evaluation.
- Parameters:
- Return type:
Callable[[ParamSpec(P)],TypeVar(T)] |Callable[[Callable[[ParamSpec(P)],TypeVar(T)]],Callable[[ParamSpec(P)],TypeVar(T)]]