-
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
Move mcx synthesis methods with ancillas to the synthesis library #12904
Conversation
One or more of the following people are relevant to this code:
|
Pull Request Test Coverage Report for Build 10338784669Warning: 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 |
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.
Nice, thanks for the effort! Should we already pending-deprecate the gate classes and refer to the synthesis functions? Once we have the MCX HLS by Sasha we can extend the deprecation message to state that users can also use the HLS plugin.
Note that in commit 7b68e57 I had to revert the new synthesized circuit names since QASM based tests are failing. |
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, this looks great! The new function names, such as synth_mcx_n_dirty_i15
, synth_mcx_1_clean_b95
, etc. are reasonable. One small question: once we integrate these into plugins, would it make sense for the plugin names to be n_dirty_i15
, 1_clean_b95
, etc. as in hls = HLSConfig(mcx=['1_clean_b95`])
?
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 @ShellyGarion! This looks very good. I had a few minor comments about explicitly adding the information about the total numbers of qubits to the new synthesis function docstrings and to the release notes , moving imports to the top-level, and providing more explicit links to the papers in the release notes. After this is addressed, I would be happy to merge.
# pylint: disable=cyclic-import | ||
from qiskit.circuit.library.standard_gates.x import C3XGate |
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.
Would it be possible to import this at the top-level, and instead add disable=cyclic-import
to x.py
?
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.
no, this will not work, since there is a real cyclic import here
releasenotes/notes/add-synth-mcx-with-ancillas-6a92078d6b0e1de4.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.
LGTM, thanks for making the changes!
Summary
See details in issue #12863.
In this PR we transfer the mcx synthesis methods with clean and dirty ancillas to the synthesis library.
Details and comments
Added 3 functions in the
qiskit/synthesis/multi-controlled
library:synth_mcx_1_clean_b95
synth_n_dirty_i15
synth_n_clean_m15