-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fix UnitarySynthesis to respect synth_gates (backport #14345) #14351
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
Conversation
* Fix UnitarySynthesis to respect synth_gates This commit fixes UnitarySynthesis. It has a parameter `synth_gates`, which is meant to be a list of gates that are synthesized. However, the previous implementation did not respect this parameter, and only synthesized the gates named `unitary`. This commit fixes this issue by checking if gate's name is in `synth_gates`. * Add tests for UnitarySynthesis' synth_gates * Fix the default Rust impl of UnitarySynthesis * Add the release note for #14345 (cherry picked from commit 0c2ce64) # Conflicts: # crates/accelerate/src/unitary_synthesis.rs
Cherry-pick of 0c2ce64 has failed:
To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
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:
|
I'll take care of the conflict. In the main branch from which the commit in this PR is cherry-picked, |
How can I contribute to it? Can anyone give me the permission to update the PR, or should I create a new PR to |
Note that the PR's name is
Can you please check if this works for you? |
No, I tried it but got the following error:
From this and this document, I suspect that explicit permission from Qiskit's maintainers is necessary for me to directly push to the PR branch. |
Thanks @yoshum. I was not sure about the process myself, but apparently the correct way is for you to open a PR targeting the |
Thank you! I'll try it. |
Pull Request Test Coverage Report for Build 15002139511Details
💛 - Coveralls |
Fixes #14343
Summary
This commit fixes UnitarySynthesis. It has a parameter
synth_gates
, which is meant to be a list of gates that are synthesized. However, the previous implementation did not respect this parameter, and only synthesized the gates namedunitary
. This commit fixes this issue by checking if gate's name is insynth_gates
.Details and comments
When a non-default method is specified, the DAG nodes are traversed in
UnitarySynthesis._run_main_loop
. There, the name of the node is checked, and in the original implementation, the operation is synthesized if the name isunitary
. This PR fixes this condition so that the synthesis takes place if the name is insynth_gates
.When the method argument is not given, UnitarySynthesis invokes the rust version of
run_main_loop
, which basically has the same structure. The PR also fixes it.This is an automatic backport of pull request #14345 done by Mergify.