qat.experimental.waveforms.shapes.sech module
Implements the sampling definitions for a Sech waveform shape.
The Sech waveform is defined by a hyperbolic secant function, which is parameterised by
fractional_breadth, a dimensionless parameter that sets the fractional_breadth of the
waveform; decreasing fractional_breadth makes the waveform more narrow, while increasing
fractional_breadth makes the waveform more broad. The Sech waveform is also
parameterised by the parameter regularize, which if set to True, applies a simple
shift and rescaling to the Sech function so that it has zero value at the edges.
The waveform is defined as
where \(\sigma\) sets the fractional_breadth of the Sech function. \(C\) is the
shift value, and \(N\) is the rescale (regularize) value, which are defined as
and \(N = 1 - C\). If regularize = False, then \(C = 0\) and \(N = 1\).
This implements the legacy SechWaveform under the parameterisations
fractional_breadth = 2 * std_dev / width, and regularize = zero_at_edges.
- class SechWaveformShape(fractional_breadth=0.3333333333333333, regularize=False)
Bases:
WaveformShapeWaveform-shape wrapper for sech sampling functions.
- derivative(x, order=1)
Evaluates the derivative of the sech waveform shape.
- Return type:
ndarray[tuple[int,...],dtype[complexfloating]]
- evaluate(x)
Evaluates the sech waveform shape at the sample points.
- Return type:
ndarray[tuple[int,...],dtype[complexfloating]]
-
fractional_breadth:
float= 0.3333333333333333
- classmethod from_absolute(width, absolute_breadth, regularize=False)
Constructs from absolute parameters.
- Parameters:
- Return type:
- classmethod from_legacy(std_dev, width, zero_at_edges=False)
Constructs from legacy
SechWaveformparameters.- Parameters:
- Return type:
-
regularize:
bool= False
- sample_sech_waveform(x, *, fractional_breadth=0.3333333333333333, regularize=False)
Samples a Sech waveform shape.
- Parameters:
x¶ (
ndarray[tuple[int,...],dtype[floating]] |list[float]) – The list of values in the range [-1, 1] to sample the waveform for.fractional_breadth¶ (
float) – The standard deviation of the Sech function, default is1/3.regularize¶ (
bool) – IfTrue, applies a shift and rescaling so that the waveform is zero at the edges. Default isFalse.
- Return type:
ndarray[tuple[int,...],dtype[complexfloating]]
- sample_sech_waveform_derivative(x, order=1, *, fractional_breadth=0.3333333333333333, regularize=False)
Samples the derivative of a Sech waveform shape.
- Parameters:
x¶ (
ndarray[tuple[int,...],dtype[floating]] |list[float]) – The list of values in the range [-1, 1] to sample the waveform for.fractional_breadth¶ (
float) – The standard deviation of the Sech function, default is1/3.regularize¶ (
bool) – IfTrue, applies a shift and rescaling so that the waveform is zero at the edges. Default isFalse.order¶ (
int) – The order of the derivative to sample. Default is1.
- Return type:
ndarray[tuple[int,...],dtype[complexfloating]]