-
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
Add back qiskit.transpiler.passes.synthesis.graysynth module #9445
Add back qiskit.transpiler.passes.synthesis.graysynth module #9445
Conversation
This commit reverts a breaking change made in Qiskit#8568, in that PR the graysynth module was moved to the qiskit.synthesis package and the cnot_synth function was also renamed as part of the move. However, this change would break any existing users of the module without any warning. To fix this for the 0.23.0 release this commit adds back the graysynth module and just exports the contents of the module in its new location. Additionally, a small wrapper function is added so that the legacy cnot_synth function name can continue to be used for the time being. In the 0.24.0 cycle we can deprecate the old module and remove them after we've giving users a warning about the change.
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 the following people are requested to review this:
|
One release note to call out is the release note for Qiskit#8568 has been changed significantly. This is based on Qiskit#9445 which is reverting some breaking changes made as part of Qiskit#8568.
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.
Looks reasonable to me. What do you think about reinstating the test for these functions?
I think the code is minimal enough here that we don't really need to worry about test coverage. All this is doing is redirecting calls from the old module to the new module and there is only one source of code so we'd essentially be testing python and not our code. That being said apparently this is causing a import cycle in the unit tests (which my manual tests didn't catch). I'll have to use a lazy import to fix this |
I've changed my mind on the testing it might be effectively one line of code but I made a typo in this so I'll add a test case that exercises the function. |
Pull Request Test Coverage Report for Build 4000870400
💛 - Coveralls |
* Add back qiskit.transpiler.passes.synthesis.graysynth module This commit reverts a breaking change made in #8568, in that PR the graysynth module was moved to the qiskit.synthesis package and the cnot_synth function was also renamed as part of the move. However, this change would break any existing users of the module without any warning. To fix this for the 0.23.0 release this commit adds back the graysynth module and just exports the contents of the module in its new location. Additionally, a small wrapper function is added so that the legacy cnot_synth function name can continue to be used for the time being. In the 0.24.0 cycle we can deprecate the old module and remove them after we've giving users a warning about the change. * Restore root qiskit.transpiler.synthesis exports * Fix import issues (cherry picked from commit bf8d6fa)
…9446) * Add back qiskit.transpiler.passes.synthesis.graysynth module This commit reverts a breaking change made in #8568, in that PR the graysynth module was moved to the qiskit.synthesis package and the cnot_synth function was also renamed as part of the move. However, this change would break any existing users of the module without any warning. To fix this for the 0.23.0 release this commit adds back the graysynth module and just exports the contents of the module in its new location. Additionally, a small wrapper function is added so that the legacy cnot_synth function name can continue to be used for the time being. In the 0.24.0 cycle we can deprecate the old module and remove them after we've giving users a warning about the change. * Restore root qiskit.transpiler.synthesis exports * Fix import issues (cherry picked from commit bf8d6fa) Co-authored-by: Matthew Treinish <[email protected]>
Note that both |
@mtreinish, thanks for taking care of this. Out of curiosity, did someone complain about the missing functionality? (Shelly and I were under an impression that if something is not mentioned anywhere in the documentation, it can probably be moved or renamed at will). On a related note, we have also renamed some of the already existing (but not documented) clifford synthesis functions -- can this be a problem? |
IMO, this was mostly just an oversight. The module was added in the 0.9.0 release (back then we weren't as careful about the documentation) and the feature was documented as a new feature in the release notes at the time. For cases like this where it's not explicitly marked as internal or private (either with a leading
Nobody complained about it afaik (although rc1 usage is typically pretty low so people might not have seen this) but I caught this going through the release notes and it was documented as a breaking change and I couldn't come up with a justification for why it needed to be breaking.
It could be if we weren't explicitly saying they were private or internal it might be best to add backwards compat wrappers to support the old names too. |
* Prepare 0.23.0 release This commit prepares the 0.23.0 release, this involves 2 steps first changing all the version numbers to 0.23.0 from 0.23.0rc1 and secondly updating the release notes to prepare them for publishing. One key thing to note is that this PR removes the 0.22.0 release notes. This is because for the 0.22.0rc1 tag we neglected to move the release notes to a separate directory. So when we did that for the 0.22.0 final release we had to forward port this back to main so that any backports to stable/0.22 would be backportable (see #8901). However, this causes reno to detect all the 0.22 release notes are incorrectly as part of the 0.23.0 development series. To fix this the simplest path forward was to remove the 0.22.0 release notes from the 0.23.0 branch (as in this PR). * Remove backported PRs * Start editting release note * More updates * Apply suggestions from code review Co-authored-by: Julien Gacon <[email protected]> * Fix docs build errors * More udpates * Update more release notes One release note to call out is the release note for #8568 has been changed significantly. This is based on #9445 which is reverting some breaking changes made as part of #8568. * More updates * Finish feature note first pass * Start upgrade notes * Move and update new release notes * Fix docs build error * Finish first pass at upgrade notes * Finish first pass at deprecation notes * Finish first pass over release notes * Fix import cycle from dagcircuit * Apply suggestions from code review Co-authored-by: Kevin Hartman <[email protected]> * Apply suggestions from code review Co-authored-by: Jake Lishman <[email protected]> * Update releasenotes/notes/0.23/prepare-0.23.0-release-0d954c91143cf9a4.yaml * Fix analysis class definition in vf2 release note Co-authored-by: Julien Gacon <[email protected]> Co-authored-by: Kevin Hartman <[email protected]> Co-authored-by: Jake Lishman <[email protected]>
Summary
This commit reverts a breaking change made in #8568, in that PR the graysynth module was moved to the qiskit.synthesis package and the cnot_synth function was also renamed as part of the move. However, this change would break any existing users of the module without any warning. To fix this for the 0.23.0 release this commit adds back the graysynth module and just exports the contents of the module in its new location. Additionally, a small wrapper function is added so that the legacy cnot_synth function name can continue to be used for the time being. In the 0.24.0 cycle we can deprecate the old module and remove them after we've giving users a warning about the change.
Details and comments