Skip to content

Commit

Permalink
Fix maxfun default in L_BFGS (Qiskit/qiskit#8285)
Browse files Browse the repository at this point in the history
* Fix maxfun and rm deprecated arg

* update docs, rm "epsilon"

* add reno

* lint

* update reno
  • Loading branch information
Cryoris authored Jul 4, 2022
1 parent b4b20f6 commit 7b4f9d3
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions qiskit_algorithms/optimizers/l_bfgs_b.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import numpy as np


from .scipy_optimizer import SciPyOptimizer


Expand All @@ -39,7 +38,7 @@ class L_BFGS_B(SciPyOptimizer): # pylint: disable=invalid-name
and also to form an estimate of the Hessian matrix (second derivative) of :math:`f`.
L-BFGS-B extends L-BFGS to handle simple, per-variable bound constraints.
Uses scipy.optimize.fmin_l_bfgs_b.
Uses ``scipy.optimize.fmin_l_bfgs_b``.
For further detail, please refer to
https://docs.scipy.org/doc/scipy/reference/optimize.minimize-lbfgsb.html
"""
Expand All @@ -49,10 +48,9 @@ class L_BFGS_B(SciPyOptimizer): # pylint: disable=invalid-name
# pylint: disable=unused-argument
def __init__(
self,
maxfun: int = 1000,
maxfun: int = 15000,
maxiter: int = 15000,
ftol: float = 10 * np.finfo(float).eps,
factr: Optional[float] = None,
iprint: int = -1,
eps: float = 1e-08,
options: Optional[dict] = None,
Expand All @@ -63,17 +61,18 @@ def __init__(
Args:
maxfun: Maximum number of function evaluations.
maxiter: Maximum number of iterations.
ftol: The iteration stops when (f\^k - f\^{k+1})/max{\|f\^k\|,\|f\^{k+1}\|,1} <= ftol.
iprint: Controls the frequency of output. iprint < 0 means no output;
iprint = 0 print only one line at the last iteration; 0 < iprint < 99
print also f and \|proj g\| every iprint iterations; iprint = 99 print
details of every iteration except n-vectors; iprint = 100 print also the
changes of active set and final x; iprint > 100 print details of
every iteration including x and g.
ftol: The iteration stops when
:math:`(f^k - f^{k+1}) / \max\{|f^k|, |f^{k+1}|,1\} \leq \text{ftol}`.
iprint: Controls the frequency of output. ``iprint < 0`` means no output;
``iprint = 0`` print only one line at the last iteration; ``0 < iprint < 99``
print also :math:`f` and :math:`|\text{proj} g|` every iprint iterations;
``iprint = 99`` print details of every iteration except n-vectors; ``iprint = 100``
print also the changes of active set and final :math:`x`; ``iprint > 100`` print
details of every iteration including :math:`x` and :math:`g`.
eps: If jac is approximated, use this value for the step size.
options: A dictionary of solver options.
max_evals_grouped: Max number of default gradient evaluations performed simultaneously.
kwargs: additional kwargs for scipy.optimize.minimize.
kwargs: additional kwargs for ``scipy.optimize.minimize``.
"""
if options is None:
options = {}
Expand Down

0 comments on commit 7b4f9d3

Please sign in to comment.