-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 qft-plugins for custom 'qft' gates #13181
Conversation
One or more of the following people are relevant to this code:
|
Pull Request Test Coverage Report for Build 10923804686Details
💛 - Coveralls |
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 for the fix, Sasha.
# HighLevelSynthesis should replace the custom gate called "qft" | ||
# by the user-provided definition. | ||
self.assertEqual(Operator(qc2), Operator(qct)) |
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.
This test confused me at first, because I was expecting the test to be that HighLevelSynthesis
had not turned it into a QFT equivalent, but the trick is that qc2
doesn't actually encode a QFT, so the test does the right thing.
I'm fine to merge like this, just commenting more because I got a bit confused and felt like broadcasting that fact.
(cherry picked from commit 2245a4f) # Conflicts: # qiskit/transpiler/passes/synthesis/hls_plugins.py # test/python/transpiler/test_high_level_synthesis.py
(cherry picked from commit 2245a4f)
(cherry picked from commit 2245a4f) Co-authored-by: Jake Lishman <[email protected]>
(cherry picked from commit 2245a4f) Co-authored-by: Jake Lishman <[email protected]>
(cherry picked from commit 2245a4f) Co-authored-by: Jake Lishman <[email protected]>
Summary
The
HighLevelSynthesis
transpiler pass no longer raises an exception when encountering a custom gate that is called "qft" but is not an instance of classQFTGate
. Instead, the synthesis plugins for QFT gates ignore such a gate, and the gate's definition is used (if provided).Fixes #13120 and #13174.
The PR is very short and has backport potential (if desired).