In the original Qiskit QAOA implementation, the sample uses COBYLA as the classical optimizer in the following code segment:

from scipy.optimize import minimize

expectation = get_expectation(G)

res = minimize(expectation, [1.0, 1.0], method='COBYLA')

However, if I try to use BFGS, the optimizer does not optimize my angles. I know that you can pass a jacobian function, but I believe that the documentation says that this is optional for BFGS.


1 Answer 1


In the referenced textbook article, in the prior cell, it is executing what the optimizer ends up processing using the qasm simulator with 512 shots. The result that the optimizer sees will be noisy (shot noise) due to the sampling (shot) noise. While COBYLA may be able to work in such an environment other optimizers may fail because of the noise. While that article is directly using a scipy optimizer, Qiskit provides optimizers, some based-on/using scipy optimizers internally, but it has some, like SPSA designed to cater to noise. There is also a package scikit-quant that seeks to provide optimizers for quantum computing - they have a page describing this and the issue with noise here that may be of interest https://qat4chem.lbl.gov/software.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.