Skip to content

Add unroll step to level2 passmanager optimization loop#5671

Merged
mtreinish merged 6 commits into
Qiskit:masterfrom
mtreinish:fix-basis-level2
Jan 22, 2021
Merged

Add unroll step to level2 passmanager optimization loop#5671
mtreinish merged 6 commits into
Qiskit:masterfrom
mtreinish:fix-basis-level2

Conversation

@mtreinish
Copy link
Copy Markdown
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 Make Mergify open a backport PR to the most recent stable branch on merge. Changelog: Fixed Add a "Fixed" entry in the GitHub Release 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: Fixed Add a "Fixed" entry in the GitHub Release changelog. stable backport potential Make Mergify open a backport PR to the most recent stable branch on merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Left over U1 gates at optimization level 2

3 participants