squlearn.optimizers.optimizer_base.OptimizerBase

class squlearn.optimizers.optimizer_base.OptimizerBase

Base class for QNN optimizers.

minimize(fun: callable, x0: ndarray, grad: callable = None, bounds=None) OptimizerResult

Function to minimize a given function.

Parameters:
  • fun (callable) – Function to minimize.

  • x0 (numpy.ndarray) – Initial guess.

  • grad (callable) – Gradient of the function to minimize.

  • bounds (sequence) – Bounds for the parameters.

Returns:

OptimizerResult format.

Return type:

Result of the optimization in class

set_callback(callback)

Set the callback function.