-
Couldn't load subscription status.
- Fork 70
Replaced deprecated Qiskit classes by their respective replacement functions #237
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
Conversation
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
Pull Request Test Coverage Report for Build 16850750011Details
💛 - Coveralls |
woodsp-ibm
reviewed
Aug 7, 2025
releasenotes/notes/replaced-deprecated-classes-by-appropriate-functions-21393c8e556fad86.yaml
Outdated
Show resolved
Hide resolved
Co-authored-by: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com>
woodsp-ibm
reviewed
Aug 8, 2025
woodsp-ibm
approved these changes
Aug 11, 2025
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.
LGTM. Thanks for doing this - another great piece of work!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixes #231.
This PR replaces most of the uses of the deprecated classes based on
BlueprintCircuitby their function counterpart. Some are left in tests, andEvolvedOperatorAnsatzis still used inAdaptVQE.VQD,VQEandSamplingVQEnow raise warnings upon setting the number of qubits of their ansatz.Since it seems that
PhaseOraclewill be deprecated in Qiskit 2.2 in profit ofPhaseOraclegate, I went ahead and added support for the latter inAmplificationProblemandGrover.Concerning
AdaptVQE, following the discussion in #231, I went for adding a lot of keyword-only arguments. This allows for instantiating it using the new technique without too much code, just like the user would have instantiated itsEvolvedOperatorAnsatz. There's a concern on the typing ofVQEansatz though. On the one hand, I don't really like allowing the ansatz to beNonesince I don't think it makes much sense, but on the other hand it's a bit ridiculous to passQuantumCircuit(1)toVQE... Note that this is a typing-only problem: if the user actually passesNonefor the ansatz, it will work just fine.