-
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
Fix global phase in OneQubitEulerDecomposer using PSX and ZSX basis and in Diagonal gate #5474
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mtreinish
added
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
labels
Dec 7, 2020
kdk
reviewed
Dec 10, 2020
Will this resolve #5453 ? |
georgios-ts
changed the title
Fix global phase in OneQubitEulerDecomposer using PSX and ZSX basis
Fix global phase in OneQubitEulerDecomposer using PSX and ZSX basis and in Diagonal gate
Dec 14, 2020
It might be good to add test conditions for angle arguments which use shorter decompositions. |
ewinston
approved these changes
Jan 18, 2021
mergify bot
pushed a commit
that referenced
this pull request
Jan 19, 2021
…nd in Diagonal gate (#5474) * fix global phase in OneQubitEulerDecomposer using PSX and ZSX basis * minor fixes * update tests * update randomized test * set global_phase=True * track global phase in diagonal gate * fix dimension * add test for special cases of zsx psx decomposition. * linting Co-authored-by: ewinston <[email protected]> Co-authored-by: Kevin Krsulich <[email protected]> (cherry picked from commit e98d456)
mergify bot
added a commit
that referenced
this pull request
Jan 19, 2021
…nd in Diagonal gate (#5474) (#5652) * fix global phase in OneQubitEulerDecomposer using PSX and ZSX basis * minor fixes * update tests * update randomized test * set global_phase=True * track global phase in diagonal gate * fix dimension * add test for special cases of zsx psx decomposition. * linting Co-authored-by: ewinston <[email protected]> Co-authored-by: Kevin Krsulich <[email protected]> (cherry picked from commit e98d456) Co-authored-by: georgios-ts <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
PSX
andZSX
basis use the same parameters asU1X
basis. This means that there is api / 4
global phase discrepancy every time we use anSX
gate instead of anRx(pi/2)
gate andphi / 2
every time we use aRz(phi)
instead of aP(phi)
.Not resolved in #5248
Tracks also global phase in
diagonal
gate and resolves #5453.Details and comments
Fixes also the global phase when simplifications can be made since:
Phase(phi).SX.Phase(pi).SX.Phase(lam)
=exp(i pi / 2).Phase(phi + lam + pi)
Phase(phi).SX.Phase(-pi).SX.Phase(lam)
=exp(i pi / 2).Phase(phi + lam - pi)
and
Phase(phi).SX.Phase(pi / 2).SX.Phase(lam)
=Phase(phi + pi / 2).SX.Phase(lam + pi / 2)
Phase(phi).SX.Phase(-pi / 2).SX.Phase(lam)
=exp(i pi / 2).Phase(phi - pi / 2).SX.Phase(lam - pi / 2)
and
Phase(phi).SX.Phase(3pi / 2).SX.Phase(lam)
=exp(i pi / 2).Phase(phi + 3pi / 2).SX.Phase(lam + 3pi / 2)
Phase(phi).SX.Phase(-3pi / 2).SX.Phase(lam)
=Phase(phi - 3pi / 2).SX.Phase(lam - 3pi / 2)