Skip to content

Fix incorrect PPM-PPR match in CommuteCliffordPastPPM#1590

Merged
sengthai merged 7 commits intomainfrom
fix-ppr-to-ppm
Apr 1, 2025
Merged

Fix incorrect PPM-PPR match in CommuteCliffordPastPPM#1590
sengthai merged 7 commits intomainfrom
fix-ppr-to-ppm

Conversation

@sengthai
Copy link
Copy Markdown
Contributor

Context:
Fixed a bug in the verification logic of CommuteCliffordPastPPM and updated the docstring.

Previously, in cases like:

func.func @circuit(%q0: !quantum.bit, %q1: !quantum.bit) {
  %0:2 = qec.ppr ["Z", "X"](4) %q0, %q1 : !quantum.bit, !quantum.bit
  %1 = qec.ppr ["X"](-4) %0#1 : !quantum.bit
  %m1, %2:2 = qec.ppm ["Z", "Z"] %0#0, %1 : !quantum.bit, !quantum.bit
  return
}

The ppm was incorrectly matched with the first ppr, even though %0:2 dominates %1 and %1 dominates %2:2.

Description of the Change:

  • Updated verifyNextNonClifford and verifyPrevNonClifford functions to streamline user operation checks.
  • Removed redundant checks
  • Minor formatting adjustment in ppr_to_ppm function docstring

Benefits:

  • Corrects a false matching bug
  • Improve docstring

- Updated `verifyNextNonClifford` and `verifyPrevNonClifford` functions to streamline user operation checks.
- Removed redundant checks
- Minor formatting adjustment in `ppr_to_ppm` function docstring
@sengthai sengthai requested a review from dime10 March 28, 2025 14:20
@github-actions
Copy link
Copy Markdown
Contributor

Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.md on your branch with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

Copy link
Copy Markdown
Contributor

@dime10 dime10 left a comment

Choose a reason for hiding this comment

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

Thanks!

@sengthai sengthai merged commit 549240f into main Apr 1, 2025
40 checks passed
@sengthai sengthai deleted the fix-ppr-to-ppm branch April 1, 2025 13:25
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.

2 participants