paraqeet.measurement.smoothness.Smoothness#
- class paraqeet.measurement.smoothness.Smoothness(pwc_generator)[source]#
Bases:
NormalizableMeasurement,DifferentiableSmoothness of a pulse. It follows the definition in Heeres et al., https://arxiv.org/abs/1608.02430 (2017), in particular Eqs. 23 and 24 of the supplementary material.
- Parameters:
pwc_generator (PWCGenerator) – The generator from which we extract the pulse.
times (Array) – One-dimensional vector of timestamps.
- __init__(pwc_generator)[source]#
- Parameters:
pwc_generator (PWCGenerator)
Methods
__init__(pwc_generator)calculate_normalized_scalar(times)Returns the normalized sum of consecutive square differences of the pulse.
get_value_and_gradient(times)Measure with gradient.
measure(times)Return measurement in the range [0, 1].
- calculate_normalized_scalar(times)[source]#
Returns the normalized sum of consecutive square differences of the pulse. As the maximums difference is twice the maximum amplitude, the normalization factor is the number of piecewise constants minus 1 time sthe maximum difference squared.
- Returns:
The normalized sum of consecutive square differences in the pulse.
- Return type:
float
- Parameters:
times (Array | float)
- get_value_and_gradient(times)[source]#
Measure with gradient.
Compute the measurement value as in measure_normalized_scalar() and the gradient with respect to all parameters in the optimization map. For parameters that are not in the passed PWCGenerator the partial derivative if simply zero.
- Returns:
Tuple of function value as bare float and gradient of shape (n_parameters,)
- Return type:
Tuple[float, Array]
- Parameters:
times (Array)