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 simplify of U3->U1/U2 in OneQubitEulerDecomposer #5554

Merged
merged 63 commits into from
Feb 19, 2021

Conversation

enavarro51
Copy link
Contributor

@enavarro51 enavarro51 commented Dec 21, 2020

Summary

Fixes #5468
Fixes #5556

Details and comments

This PR will simplify U3 gates in the OneQubitEulerDecomposer to U1 when theta is 0 and to U2 when theta is pi/2. This will allow the use of Optimize1qGatesDecomposition exclusively or in additional cases over Optimize1qGates. This first draft leaves the optimization as is.

The next phase will be to implement the conditions for optimization as discussed in #5531.

@enavarro51
Copy link
Contributor Author

enavarro51 commented Dec 28, 2020

@kdk and @mtreinish. The latest commits fix several issues with Optimize1qGatesDecomposition (O1GD). See #5556. The solution here was to skip over runs with delay, snapshot, or custom gates. Alternatively these checks could be added to the collect_1q_runs filter_fn function.
Edited: Actually it looks like #5570 will take care of this problem. This draft includes that change for testing purposes assuming #5570 will be merged first.

In the current version of this draft, setting optimization_level=1 will implement the previous behavior where Optimize1qGates (O1G) is called if U1, U2, or U3 is in the basis. Setting optimization_level at 2 or 3 will use O1GD exclusively. This would allow for some performance and other testing to see how O1GD works by itself.

The final step in this PR would be to implement Matthew's idea for choosing between O1G and O1GD from #5531.

@enavarro51 enavarro51 changed the title [WIP] Add simplify of U3->U1/U2 in OneQubitEulerDecomposer Add simplify of U3->U1/U2 in OneQubitEulerDecomposer Jan 15, 2021
Copy link
Member

@kdk kdk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @enavarro51 , this looks good. One comment below. Also, can you add a release note?

qiskit/quantum_info/synthesis/one_qubit_decompose.py Outdated Show resolved Hide resolved
Copy link
Member

@kdk kdk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates @enavarro51 , this is looking good. Few comments below.

Copy link
Member

@kdk kdk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @enavarro51 , this is looking good. Two small comments below and then I think this is good to go.

@kdk kdk added the Changelog: New Feature Include in the "Added" section of the changelog label Feb 19, 2021
@kdk kdk added this to the 0.17 milestone Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: New Feature Include in the "Added" section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Transpilation fails with snapshot instruction Update OneQubitEulerDecomposer to simplify U3 to U2/U1
3 participants