-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fix UnitarySynthesis to respect synth_gates #14345
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
Fix UnitarySynthesis to respect synth_gates #14345
Conversation
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`.
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:
|
04f57b4
to
6be9a0f
Compare
Thank you for the contribution! This looks great. Could you also add release notes? |
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!
Thank you for the review! |
Pull Request Test Coverage Report for Build 14971837897Warning: 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 |
* 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
* Fix UnitarySynthesis to respect synth_gates (#14345) * 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 * Resolve the merge conflict (#14357) --------- Co-authored-by: Shuhei M. Yoshida <17794644+yoshum@users.noreply.github.com>
* 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 Qiskit#14345
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.