calix.common.algorithms.NoisyBinarySearch

class calix.common.algorithms.NoisyBinarySearch(noise_amplitude: int = 5)

Bases: calix.common.algorithms.BinarySearch

Perform binary search with noisy start parameters.

The start of the search is not the middle of the range, but some integer noise given by noise_amplitude is added beforehand. This is useful to avoid issues that arise from setting many CapMem cells to the same value (CapMem crosstalk, issue 2654). The binary search takes an extra step to compensate for the initial offsets.

The NoisyBinarySearch algorithm is typically used to prevent that many CapMem cells are set to the same value. Since a binary search could theoretically drive many cells to the same CapMem value in the final steps, more steps are taken into account in the end to find an optimal value.

Variables

noise_amplitude – Amount of noise to add at the start of the calibration. Must be a positive integer; use the algorithm BinarySearch to work without noise.

__init__(noise_amplitude: int = 5)
Raises

ValueError – if noise_amplitude is not greater than zero.

Methods

__init__([noise_amplitude])

raises ValueError

if noise_amplitude is not greater than zero.

hook_to_calibration(calibration)

Make an instance of a calibration known to the algorithm, allowing to use parameters set there.

Attributes

calibration: Optional[Calib]
hook_to_calibration(calibration: calix.common.base.Calib)

Make an instance of a calibration known to the algorithm, allowing to use parameters set there.

Parameters

calibration – Instance of calibration class that will be run with this algorithm.

Raises

ExcessiveNoiseError – If the applied noise amplitude is more than a quarter of the calibration range, since that noise would lead to hitting the range boundaries instantly.

initial_parameters: Optional[np.ndarray]
n_steps: Optional[int]
step_increments: Optional[np.ndarray]