-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Deprecates StochasticSwap
and suggests the use of SabreSwap
#12983
Conversation
Thank you for opening a new pull request. Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone. One or more of the following people are relevant to this code:
|
|
StochasticSwap
and suggests the use of SabreSwap
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.
Thanks a lot @danielbultrini, the PR looks really good, I just added a tiny suggestion for a typo, and you need to sign the CLA agreement mentioned in the comment above for us to be able to merge it into Qiskit!
(note that you can apply the suggestion directly by clicking on the "Commit suggestion" button under it)
Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>
Thanks @ElePT ! After a bit more work, all tests passed. I signed the CLA, but for some reason it's still showing as unsigned (although another bot comment says it's signed). It was a great learning experience to go through this process |
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.
Thanks again @danielbultrini :) The PR is almost there, I just added a few minor comments to polish the final details. I think that the CLA shouldn't be an issue, as the license CI check passes. As you have seen, deprecations can be trickier to handle than they seem, so this is really good work!!
releasenotes/notes/deprecate-StochasticSwap-451f46b273602b7b.yaml
Outdated
Show resolved
Hide resolved
releasenotes/notes/deprecate-StochasticSwap-451f46b273602b7b.yaml
Outdated
Show resolved
Hide resolved
Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>
Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>
…into fix/12552/1
releasenotes/notes/deprecate-StochasticSwap-451f46b273602b7b.yaml
Outdated
Show resolved
Hide resolved
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.
I just applied some minor suggestions for the wording of the TODOs, and I think we are good to go!! Approving the PR :)
Pull Request Test Coverage Report for Build 10469003353Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
* first attempt to fix issue 12552 * first attempt to fix issue 12552 * fixed issue 12552 and unittest * formatted and completed 12552 * formatted and completed 12552 documentation * fixed unit tests 12552 * Update qiskit/transpiler/passes/routing/stochastic_swap.py Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com> * linted * passed all tests, including compiler test * final linting and unittest passing - hopefully * Update qiskit/transpiler/passes/routing/stochastic_swap.py Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com> * Update releasenotes/notes/deprecate-StochasticSwap-451f46b273602b7b.yaml Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com> * added test * Apply suggestions from code review --------- Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>
* tiny follow up * Update releasenotes/notes/deprecate-StochasticSwap-451f46b273602b7b.yaml Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com> --------- Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com> (cherry picked from commit b90c7a7) # Conflicts: # qiskit/transpiler/passes/routing/stochastic_swap.py # releasenotes/notes/deprecate-StochasticSwap-451f46b273602b7b.yaml
Summary
I added depreciation warnings for issue #12552 and modified unit tests to capture the new errors. Documentation with examples has also been added.
Details and comments
I have added a deprecation warning to the
StochasticSwap
class and a description of how to change things. All relevant tests were made to capture the warning, but some tests which check all different types of these passes (i.e. Sabre, look ahead) where split so that the stochastic method may easily be removed in future. In one class of test (test_mappers.py) StochasticSwap had to be removed, as the method used to run the tests made it prohibitively hard to easily check for warnings in the stochastic case exclusively.