-
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
Deprecate loose custom basis gates in preset pm pipieline #13394
Conversation
One or more of the following people are relevant to this code:
|
Pull Request Test Coverage Report for Build 11702502035Warning: 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.
Overall LGTM, thanks and good catch with the target-skipping condition! I have couple small comments, one is important.
releasenotes/notes/deprecate-custom-basis-gates-transpile-e4b5893377f23acb.yaml
Show resolved
Hide resolved
@@ -433,9 +448,14 @@ def generate_preset_pass_manager( | |||
def _parse_basis_gates(basis_gates, backend, inst_map, skip_target): | |||
name_mapping = {} |
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.
Dead code now
…ranspile internally
Thanks for the review! Really good catch with |
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.
Overall looks good, thanks for all the changes and for handling the newly exposed deprecation warnings. I've left one question for you to confirm in qsd.py
; assuming you will, I think this PR is good to go hence already approving.
circ, basis_gates=["u", "cx", "qsd2q"], optimization_level=0, qubits_initially_zero=False | ||
) | ||
hls = HighLevelSynthesis(basis_gates=["u", "cx", "qsd2q"], qubits_initially_zero=False) | ||
ccirc = hls(circ) |
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.
Previously transpile
built a flow containing UnitarySynthesis
, HighLevelSynthesis
and BasisTranslator
. Looking at qs_decomposition
seems that this change is safe in the sense that HighLevelSynthesis
should be sufficient. Can you just confirm?
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.
Yes, I believe it is, I also briefly confirmed it with @Cryoris.
Summary
This PR is a spinoff of #12850 that introduces the deprecation warning for loose custom basis gates as an input to transpile/generate_preset_pm. This is a pre-requisite for eventually merging #12850. Moving forward, users can still provide custom basis gates but they need to be included as part of a
Target
instance.Details and comments
The PR also modifies a few oversights found in
generate_preset_pass_manager
that didn't have user impact but should be corrected to set the stage for a target-only pipeline:or
instead of anand
(fixed in L453/466)