-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Ignoring unsupported gates for Solovay-Kitaev transpiler pass #13690
Conversation
One or more of the following people are relevant to this code:
|
Pull Request Test Coverage Report for Build 13070354287Warning: 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 |
I agree it should leave |
This is indeed a valid alternative. I like the analogy with the BasisTranslator pass, though (unlike BT) SK already ignores all operations on 2 or more qubits, and it feels strange that the pass should ignore, for instance, the 2-qubit The other thing is that probably we need to make the pass recursive for control-flow ops (and not just ignore these as it happens right now), what do you think? Maybe we should first decide on the typical usages of the SK pass, when and how it would be used in a typical transpiler pipeline. |
The SK algorithm only applies to decompositions of Agree that the pass should recurse over control-flow operations. If we're intending to use the SK algorithm as part of a translation stage, we might want to consider it as an entire pipeline. To use the
In an ideal world, we'd want I wouldn't necessarily make the SK pass error out if it can't translate, since it's conceivable to me that you might want to use it in other contexts - we can make the translation stage error out in that case, potentially, where it's clear that the stage is required to fail if translation can't be done. |
Thanks @jakelishman, @Cryoris! I have added recursion for control-flow operators. If we agree that the SK pass should not error out if it can't translate, is there more you suggest to do here, modulo correcting the class documentation and polishing the release notes? Let's take the discussion of the transpilation pipeline to #13695. |
releasenotes/notes/sk-ignore-unsupported-ops-8d7d5f6fca255ffb.yaml
Outdated
Show resolved
Hide resolved
…yaml Co-authored-by: Julien Gacon <gaconju@gmail.com>
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!
Summary
The Solovay-Kitaev transpiler pass (i.e. the standalone pass and not the unitary synthesis plugin) previously considered all operations over$1$ qubit and ignored all operations over $k$ qubits for $k\ne 1$ . In doing so, it raised a transpiler error for circuits with single-qubit operations that are either parameterized or don't have a
to_matrix
method (these include barriers, measures, control-flow ops and more). This PR changes the default behavior to ignore such operations instead of raising an error.