Skip to content

Fix local_pauli twirling with Clifford and non-Clifford fractional entanglers in the same box - #410

Merged
Joshua Skanes-Norman (joshuasn) merged 1 commit into
mainfrom
rzz-mixed-clifford-unbound
Sep 10, 2026
Merged

Joshua Skanes-Norman (joshuasn) merged 1 commit into
mainfrom
rzz-mixed-clifford-unbound

Conversation

@joshuasn

Copy link
Copy Markdown
Collaborator

Summary

When using local_pauli on a box with a Clifford and non-Clifford angle, e.g.,

with c.box([Twirl(group="local_pauli")]):
    c.rzz(np.pi / 2, 0, 1)
    c.rzz(np.pi / 3, 2, 3)

with c.box([Twirl(group="local_pauli")]):
    c.rzz(np.pi / 2, 0, 1)
    c.rzz(Parameter("a"), 2, 3)

the emits sample from the Pauli group when the angle is Clifford but the corresponding propagate ends up using PropagateLocalPauli, which guards against Paulis not in its commutant. This caused the SamplexRuntimeError.

This PR updates the logic to dispatch to the correct propagator.

@ihincks Ian Hincks (ihincks) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This change does look to fix the error at hand.

There is a bigger question about whether local_pauli should twirl with the full pauli group at the special rzz angles 0 and pi/2, but that's out of scope for now: we need to fix the broken path.

@joshuasn
Joshua Skanes-Norman (joshuasn) merged commit 90ccab6 into main Sep 10, 2026
8 checks passed
@joshuasn
Joshua Skanes-Norman (joshuasn) deleted the rzz-mixed-clifford-unbound branch September 10, 2026 17:01
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