tequila.optimizers.minimize

tequila.optimizers.minimize(method: str, objective, variables: list = None, initial_values: dict = None, maxiter: int = None, *args, **kwargs)[source]

Minimization function with a given optimization method.

Parameters
  • method (str:) – The optimization method (e.g. bfgs, cobyla, nelder-mead, …) see ‘tq.optimizers.show_available_methods()’ for an overview

  • objective (tq.Objective:) – The abstract tequila objective to be optimized

  • variables (list of names:) – The variables which shall be optimized given as list Can be passed as list of names or list of tq variables

  • initial_values (dict:) – Initial values for the optimization, passed as dictionary with the variable names as keys. Alternatively zero, random or a single number are accepted

  • maxiter – maximum number of iterations

  • kwargs – further keyword arguments for the actual minimization functions can also be called directly as tq.minimize_modulename e.g. tq.minimize_scipy See their documentation for more details

Returns

minimize

Return type

object

Examples

example: gradient <keyword>

gradient (Default Value: None):

Instructions for gradient compilation can be a dictionary of tequila objectives representing the gradients or a string/dictionary giving instructions for numerical gradients

>>> gradient = '2-point'
>>> gradient = {'method':'2-point', 'stepsize': 1.e-4}
>>> gradient = {'method':Callable, 'stepsize': 1.e-4}
>>> gradient = None # Analytical gradients are compiled

see optimizer_base.py for method examples.