class CobylaOptimizer(rhobeg=1.0, rhoend=0.0001, maxfun=1000, disp=None, catol=0.0002)[source]

The SciPy COBYLA optimizer wrapped as an Qiskit OptimizationAlgorithm.

This class provides a wrapper for scipy.optimize.fmin_cobyla ( to be used within the optimization module. The arguments for fmin_cobyla are passed via the constructor.


>>> from qiskit.optimization.problems import QuadraticProgram
>>> from qiskit.optimization.algorithms import CobylaOptimizer
>>> problem = QuadraticProgram()
>>> # specify problem here
>>> optimizer = CobylaOptimizer()
>>> result = optimizer.solve(problem)

Initializes the CobylaOptimizer.

This initializer takes the algorithmic parameters of COBYLA and stores them for later use of fmin_cobyla when solve() is invoked. This optimizer can be applied to find a (local) optimum for problems consisting of only continuous variables.

  • rhobeg (float) – Reasonable initial changes to the variables.

  • rhoend (float) – Final accuracy in the optimization (not precisely guaranteed). This is a lower bound on the size of the trust region.

  • disp (Optional[int]) – Controls the frequency of output; 0 implies no output. Feasible values are {0, 1, 2, 3}.

  • maxfun (int) – Maximum number of function evaluations.

  • catol (float) – Absolute tolerance for constraint violations.



Checks whether a given problem can be solved with this optimizer.


Checks whether a given problem can be solved with the optimizer implementing this method.


Tries to solves the given problem using the optimizer.