-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Fix lack of alternative for Optimizer in AQC
#11099
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
c303c2d
Add alternative and deprecation warning
ElePT c4b2f8f
Add deprecation test
ElePT 053b378
Apply Julien's suggestion
ElePT 63ec7ab
Apply suggestions from Julien's code review
ElePT 9a78904
Move optimizer setting to init
ElePT 2397358
Merge branch 'aqc-depr-fix' of https://github.com/ElePT/qiskit-terra …
ElePT 42c608b
Fix ddt import
ElePT b169d3f
Fix lint
ElePT d5d7ffc
Add reno
ElePT File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that the introduction of the alternative should have happened before, I am considering this a "bugfix", and showing the corresponding release note, but it is a bit of a tricky PR because I could also see it as being a new feature.