Skip to content
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

Add unroll step to level2 passmanager optimization loop #5671

Merged
merged 6 commits into from
Jan 22, 2021

Conversation

mtreinish
Copy link
Member

Summary

This commit adds the basis translation step to the level 2 preset
passmanager's optimization loop. The level 2 optimization loop runs the
commutative cancellation pass which use Rx and U1 gates as part of it's
optimization step which may not be in the target basis gates. This can
result in a gate outside of the target basis ended up in the output. To
avoid this in a general manner we need to rely on the basis translation
step because we can't write a pass to do the simplified rotation in a
manner compatible with any basis (especially since the target basis
could be using custom gates).

Details and comments

Fixes #5644

This commit adds the basis translation step to the level 2 preset
passmanager's optimization loop. The level 2 optimization loop runs the
commutative cancellation pass which use Rx and U1 gates as part of it's
optimization step which may not be in the target basis gates. This can
result in a gate outside of the target basis ended up in the output. To
avoid this in a general manner we need to rely on the basis translation
step because we can't write a pass to do the simplified rotation in a
manner compatible with any basis (especially since the target basis
could be using custom gates).

Fixes Qiskit#5644
@mtreinish mtreinish added stable backport potential The bug might be minimal and/or import enough to be port to stable Changelog: Bugfix Include in the "Fixed" section of the changelog labels Jan 21, 2021
@mtreinish mtreinish added this to the 0.17 milestone Jan 21, 2021
@mtreinish mtreinish requested a review from a team as a code owner January 21, 2021 17:16
@mtreinish mtreinish merged commit 25eb58a into Qiskit:master Jan 22, 2021
@mtreinish mtreinish deleted the fix-basis-level2 branch January 22, 2021 18:41
mergify bot pushed a commit that referenced this pull request Jan 22, 2021
This commit adds the basis translation step to the level 2 preset
passmanager's optimization loop. The level 2 optimization loop runs the
commutative cancellation pass which use Rx and U1 gates as part of it's
optimization step which may not be in the target basis gates. This can
result in a gate outside of the target basis ended up in the output. To
avoid this in a general manner we need to rely on the basis translation
step because we can't write a pass to do the simplified rotation in a
manner compatible with any basis (especially since the target basis
could be using custom gates).

Fixes #5644

(cherry picked from commit 25eb58a)
mergify bot added a commit that referenced this pull request Jan 22, 2021
This commit adds the basis translation step to the level 2 preset
passmanager's optimization loop. The level 2 optimization loop runs the
commutative cancellation pass which use Rx and U1 gates as part of it's
optimization step which may not be in the target basis gates. This can
result in a gate outside of the target basis ended up in the output. To
avoid this in a general manner we need to rely on the basis translation
step because we can't write a pass to do the simplified rotation in a
manner compatible with any basis (especially since the target basis
could be using custom gates).

Fixes #5644

(cherry picked from commit 25eb58a)

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Bugfix Include in the "Fixed" section of the changelog stable backport potential The bug might be minimal and/or import enough to be port to stable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Left over U1 gates at optimization level 2
3 participants