Skip to content

Conversation

mtreinish
Copy link
Member

@mtreinish mtreinish commented Mar 1, 2021

Summary

This commit adds a new basis ZSXX to the 1q euler decomposer. This basis
is identical to the ZSX basis except it does an additional
simplification pass so that instead of having 2 sx gates in the
synthesized output a single X gate is used instead.

Details and comments

Fixes #5722

This PR depends on #5928 (and will be on hold until that merges)

@mtreinish mtreinish added the on hold Can not fix yet label Mar 1, 2021
@mtreinish mtreinish requested review from chriseclectic and a team as code owners March 1, 2021 21:18
@mtreinish mtreinish added this to the 0.17 milestone Mar 1, 2021
@mtreinish mtreinish force-pushed the zsxx-basis branch 2 times, most recently from 818d970 to 155bf21 Compare March 5, 2021 18:46
@mtreinish mtreinish removed the on hold Can not fix yet label Mar 5, 2021
@mtreinish
Copy link
Member Author

We might want to wait on this one until #5827 is ready. That PR has some fixes for the ZSX basis which would also apply here.

This commit adds a new basis ZSXX to the 1q euler decomposer. This basis
is identical to the ZSX basis except it does an additional
simplification pass so that instead of having 2 sx gates in the
synthesized output a single X gate is used instead.

Fixes Qiskit#5722
mtreinish added a commit to levbishop/qiskit-terra that referenced this pull request Mar 16, 2021
This commit merges the zsxx-basis branch from Qiskit#5937 into this branch.
From that PR:

This commit adds a new basis ZSXX to the 1q euler decomposer. This basis
is identical to the ZSX basis except it does an additional
simplification pass so that instead of having 2 sx gates in the
synthesized output a single X gate is used instead.

Fixes Qiskit#5722
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.

Can you add ZSXX to the bases for the randomized synthesis tests?

@mtreinish mtreinish modified the milestones: 0.17, 0.18 Mar 30, 2021
@mtreinish
Copy link
Member Author

This has been superseded by: #5827 which included this commit so closing this now.

@mtreinish mtreinish closed this Apr 16, 2021
mtreinish added a commit to mtreinish/qiskit-core that referenced this pull request Jun 17, 2025
In the TwoQubitBasisDecomposer there was a special code path to do pulse
optimal decomposition. This code path could occasionally result in a 0
degree angle rz gate being emitted. This would mean the sequence of SX -
RZ(0) - SX would be generated which is just an X gate. This commit
updates the decomposition to just use an X gate in these cases if
they're encountered. This is essentially the same optimization that was
done in Qiskit#5937/Qiskit#5827 for the single qubit euler decomposer but this
applies it to the pulse optimal 2q decomposition.
github-merge-queue bot pushed a commit that referenced this pull request Aug 7, 2025
* Adjust pulse optimal cx two qubit decomposer to avoid RZ(0)

In the TwoQubitBasisDecomposer there was a special code path to do pulse
optimal decomposition. This code path could occasionally result in a 0
degree angle rz gate being emitted. This would mean the sequence of SX -
RZ(0) - SX would be generated which is just an X gate. This commit
updates the decomposition to just use an X gate in these cases if
they're encountered. This is essentially the same optimization that was
done in #5937/#5827 for the single qubit euler decomposer but this
applies it to the pulse optimal 2q decomposition.

* Add tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Y-gate gets transposed to 2x SX verses one X
3 participants