quri_parts.algo.optimizer.tolerance module#

ftol(ftol)#

Returns a function evaluating cost function tolerance.

The return value is True when the cost function difference is less than ftol; specifically |cost_prev - cost| <= 0.5 * ftol * (|cost_prev| + |cost|) + 1e-20.

Parameters:

ftol (float) –

Return type:

Callable[[float, float], bool]

gtol(gtol)#

Returns a function evaluating gradient function tolerance.

The return value is True when amax(abs(grad)) <= gtol.

Parameters:

gtol (float) –

Return type:

Callable[[‘npt.NDArray[np.float_]’], bool]