-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Add alternative and deprecation warning * Add deprecation test * Apply Julien's suggestion Co-authored-by: Julien Gacon <gaconju@gmail.com> * Apply suggestions from Julien's code review * Move optimizer setting to init * Fix ddt import * Fix lint * Add reno --------- Co-authored-by: Julien Gacon <gaconju@gmail.com> (cherry picked from commit f0d3937) Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>
- Loading branch information
1 parent
2e861ba
commit e1d5cfe
Showing
5 changed files
with
144 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
releasenotes/notes/fix-aqc-optimizer-typehint-34b54c6278d23f79.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
fixes: | ||
- | | ||
The use of the (deprecated) ``Optimizer`` class on :class:`~.AQC` did not have a | ||
non-deprecated alternative path, which should have been introduced in | ||
the original ``qiskit-algorithms`` deprecation PR | ||
[#10406](https://github.com/Qiskit/qiskit/pull/10406). | ||
It now accepts a callable that implements the :class:`~.Minimizer` protocol, | ||
as explicitly stated in the deprecation warning. The callable can look like the | ||
following example: | ||
.. code-block:: python | ||
from scipy.optimize import minimize | ||
from qiskit.transpiler.synthesis.aqc.aqc import AQC | ||
optimizer = partial(minimize, args=(), method="L-BFGS-B", options={"maxiter": 200}) | ||
aqc = AQC(optimizer=optimizer) | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters