pygsti.optimize.minimize

pygsti.optimize.minimize(fn, x0, method='cg', callback=None, tol=1e-10, maxiter=1000000, maxfev=None, stopval=None, jac=None)

Minimizes the function fn starting at x0.

This is a gateway function to all other minimization routines within this module, providing a common interface to many different minimization methods (including and extending beyond those available from scipy.optimize).

Parameters:
  • fn (function) – The function to minimize.
  • x0 (numpy array) – The starting point (argument to fn).
  • method (string, optional) – Which minimization method to use. Allowed values are: “simplex” : uses fmin_simplex “supersimplex” : uses fmin_supersimplex “customcg” : uses fmax_cg (custom CG method) “brute” : uses scipy.optimize.brute “basinhopping” : uses scipy.optimize.basinhopping with L-BFGS-B “swarm” : uses fmin_particle_swarm “evolve” : uses fmin_evolutionary (which uses DEAP) < methods available from scipy.optimize.minimize >
  • callback (function, optional) – A callback function to be called in order to track optimizer progress. Should have signature: myCallback(x, f=None, accepted=None). Note that create_obj_func_printer(...) function can be used to create a callback.
  • tol (float, optional) – Tolerance value used for all types of tolerances available in a given method.
  • maxiter (int, optional) – Maximum iterations.
  • maxfev (int, optional) – Maximum function evaluations; used only when available, and defaults to maxiter.
  • stopval (float, optional) – For basinhopping method only. When f <= stopval then basinhopping outer loop will terminate. Useful when a bound on the minimum is known.
  • jac (function) – Jacobian function.
Returns:

Includes members ‘x’, ‘fun’, ‘success’, and ‘message’.

Return type:

scipy.optimize.Result object