extract_fom_and_gradient#

lumopt2.optimizer.base_optimizer.extract_fom_and_gradient(result) Tuple[float, ndarray | None]#

Extract FOM and gradient from objective function result.

Parameters:
resultfloat or tuple

Result from objective function, either a scalar FOM or (fom, gradient) tuple.

Returns:
fomfloat

The FOM value.

gradientnp.ndarray or None

The gradient if available, None otherwise.