qiskit-community / qiskit-algorithms

A library of quantum algorithms for Qiskit.
https://qiskit-community.github.io/qiskit-algorithms/
Apache License 2.0
116 stars 59 forks source link

SPSA doc string out of date #106

Closed Durd3nT closed 9 months ago

Durd3nT commented 12 months ago

Environment

What is happening?

The small code examples in the doc string of qiskit_algorithms/optimizers/spsa.py still show the old signature of optimizers in qiskit instead of the new scipy-style optimizers. This includes a method optimize that is now called minimize, returning point, value, niter instead of OptimizationResult objects, etc.

How can we reproduce the issue?

--

What should happen?

The code examples shout show the new way of using optimizers in qiskit.

Any suggestions?

No response

woodsp-ibm commented 11 months ago

Thanks for noticing and raising this issue. It is also using StateFn which was part of qiskit.opflow which was deprecated and will no longer be present in the upcoming Qiskit 1.0. The first part could be re-done showing it used with an Estimator. Though I do not know how much value there is in that given its usage is no different syntactically than any other optimizer in that regard.