I am trying to reproduce the QAOA example from https://qiskit.org/textbook/ch-applications/qaoa.html and learn how to opt for a different optimizer.
The relevant block in the example is (towards the end of the example):
from scipy.optimize import minimize expectation = get_expectation(G, p=1) res = minimize(expectation, [1.0, 1.0], method='COBYLA') res
This effectively calls for COBYLA from scipy. However, in qiskit.algorithms.optimizers we can see a lot of other options: https://qiskit.org/documentation/stubs/qiskit.algorithms.optimizers.html
At the moment, for the block of code given above I cannot figure out how to change my optimizer. Say I want to apply ADAM or GradientDescent or SPSA. It is not clear to me how I can do that since just passing the argument 'ADAM' (for example) as below
res = minimize(expectation, [1.0, 1.0], method='ADAM')
ValueError: Unknown solver ADAM error. I get the corresponding error when I try other optimizers too.
How can I deal with this?