qat.experimental.waveforms.shapes.gaussian module
Implements the sampling definitions for a Gaussian waveform shape.
The Gaussian waveform is defined as a standard Gaussian function, with optional normalisation so it can be zero at the boundary of the waveform. The parameters for the waveform are
fractional_breadth: The standard deviation of the Gaussian function, which controls the fractional_breadth of the waveform. A larger value offractional_breadthresults in a broader waveform, and a smaller value results in a narrower peak. The default value issqrt(2)/3, which coincides with the legacy implementation (which is1/3under that parameterisation).regularize: IfTrue, the waveform is normalised so that it has value zero at the edges of the waveform. Equivalent tozero_at_edgesin the legacy implementation. It isFalseby default.
The Gaussian waveform is defined as
where fractional_breadth is the standard deviation. C is the shift value, and N
is the regularization value, where N and C are one and zero respectively if
regularize = False, and are otherwise defined as
and \(N = 1 - C\).
This implements the legacy GaussianWaveform, GaussianZeroEdgeWaveform,
DragGaussianWaveform, and the SofterGaussianWaveform with the following
parameterisations:
GaussianWaveform:fractional_breadth = sqrt(2) * fractional_rise,regularize = False,GaussianZeroEdgeWaveform:fractional_breadth = 2 * std_dev / width,regularize = zero_at_edges,DragGaussianWaveform:fractional_breadth = std_dev,regularize = zero_at_edges, where DRAG is implemented away from the waveform definition, using the derivatives,SofterGaussianWaveform:fractional_breadth = sqrt(2) * fractional_rise,regularize = True.
- class GaussianWaveformShape(fractional_breadth=np.float64(0.47140452079103173), regularize=False)
Bases:
WaveformShapeWaveform-shape wrapper for Gaussian sampling functions.
- derivative(x, order=1)
Evaluates the derivative of the Gaussian waveform shape.
- Return type:
ndarray[tuple[int,...],dtype[complexfloating]]
- evaluate(x)
Evaluates the Gaussian waveform shape at the sample points.
- Return type:
ndarray[tuple[int,...],dtype[complexfloating]]
-
fractional_breadth:
float= np.float64(0.47140452079103173)
- classmethod from_absolute(width, absolute_breadth, regularize=False)
Constructs from absolute parameters.
- Parameters:
- Return type:
- classmethod from_gaussian_waveform(rise)
Constructs from legacy
GaussianWaveformparameters.- Parameters:
rise¶ (
float) – Theriseparameter from the legacy implementation.- Return type:
- classmethod from_gaussian_zero_edge_waveform(std_dev, width, zero_at_edges=True)
Constructs from legacy
GaussianZeroEdgeWaveform/DragGaussianWaveformparameters.- Parameters:
- Return type:
- classmethod from_softer_gaussian_waveform(rise)
Constructs from legacy
SofterGaussianWaveformparameters.- Parameters:
rise¶ (
float) – Theriseparameter from the legacy implementation.- Return type:
-
regularize:
bool= False
- sample_gaussian_waveform(x, *, fractional_breadth=np.float64(0.47140452079103173), regularize=False)
Samples a Gaussian 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 Gaussian function, default issqrt(2)/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_gaussian_waveform_derivative(x, order=1, *, fractional_breadth=np.float64(0.47140452079103173), regularize=False)
Samples the derivative of a Gaussian waveform shape.
The derivative is calculated using the Hermite polynomial of order
order, and the Gaussian function. Note this is the Physicist’s Hermite polynomial, and not the Probabilist’s Hermite polynomial.- 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 Gaussian function, default issqrt(2)/3, which coincides with the legacy implementation under the new definition.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]]