Skip to content

Conversation

daxfohl
Copy link
Collaborator

@daxfohl daxfohl commented Sep 9, 2025

Instead of special blocks to handle paulis on linequbits in each of mul, rmul, imul, and commutes, this PR just converts any paulis to DensePauliString up-front. That allows removal of the special handling blocks, plus generalizes to multi-qubit paulis and eliminates out-of-bounds errors.

Fixes #7640

@daxfohl daxfohl requested review from a team and vtomole as code owners September 9, 2025 02:56
@daxfohl daxfohl requested a review from senecameeks September 9, 2025 02:56
@github-actions github-actions bot added the size: M 50< lines changed <250 label Sep 9, 2025
@daxfohl daxfohl changed the title Generalize DensePauliString.mul to handle multi-qubit ops Generalize DensePauliString.mul to handle multi-qubit Paulis Sep 9, 2025
Copy link

codecov bot commented Sep 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.37%. Comparing base (25d727f) to head (c080723).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7643      +/-   ##
==========================================
- Coverage   99.37%   99.37%   -0.01%     
==========================================
  Files        1078     1078              
  Lines       96166    96162       -4     
==========================================
- Hits        95563    95558       -5     
- Misses        603      604       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Collaborator

@pavoljuhas pavoljuhas left a comment

Choose a reason for hiding this comment

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

LGTM with a couple of minor suggestions.

Thank you for taking care of this!

@daxfohl daxfohl enabled auto-merge September 11, 2025 17:52
@daxfohl daxfohl added this pull request to the merge queue Sep 11, 2025
Merged via the queue into quantumlib:main with commit 692dbcf Sep 11, 2025
35 checks passed
@daxfohl daxfohl deleted the dense-pauli-mul branch September 11, 2025 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: M 50< lines changed <250

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DensePauliString.__mul__ crashes on index bounds and parity gates

2 participants