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

Extend commutative cancellation for SX/Sdg/Tdg #13058

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Cryoris
Copy link
Contributor

@Cryoris Cryoris commented Aug 30, 2024

Summary

The CommmutativeCancellation pass didn't consider cancellations of Sdg/Tdg/SX/SXdg gates. This PR does a minor fix to add them.

Details and comments

There are other open points we might want to discuss:

  • basic Z-sequences are not cancelled if no Z rotation is present in the circuit: E.g. Z-Z is not cancelled if there is no RZ/U1/P specified in the basis set or target
  • on the other hand: X-sequences are squashed into an RX gate, even if there is no RX gate specified in the basis or target

Both these cases could be solved by e.g. always assuming an RX/RZ rotation gate to absorb the cancellations, but if finally the angles don't sum up to 0, we disregard the accumulation.

@Cryoris Cryoris added the Changelog: Bugfix Include in the "Fixed" section of the changelog label Aug 30, 2024
@Cryoris Cryoris requested a review from a team as a code owner August 30, 2024 10:17
@qiskit-bot
Copy link
Collaborator

One or more of the following people are relevant to this code:

  • @Qiskit/terra-core

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants