Skip to content

Support negated targets in stim collapsing gates#3455

Merged
joao-boechat merged 5 commits into
mainfrom
joaoboechat/support-negated-targets
Jul 17, 2026
Merged

Support negated targets in stim collapsing gates#3455
joao-boechat merged 5 commits into
mainfrom
joaoboechat/support-negated-targets

Conversation

@joao-boechat

@joao-boechat joao-boechat commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

This PR implements support for the following operations:

M !0, MX !0, MY !0,
MR !0, MRX !0, MRY !0,
MZZ !0 1, MXX !0 1, MYY !0 1,

where M, MZ; MR, MRZ are interchangeable,
and on pair measurements we can negate either target, or both, but the negation will invert the result by the XOR of both negations. For example:

MZZ !0 1 = MZZ 0 !1
MZZ !0 !1 = MZZ 0 1

In terms of the implementation, all that had to be done was adding an X gate before and after the emitted M operations (all collapsing gates are eventually decomposed to a single M in a qubit). For measurement reset operations, we only add the X gate before the measurement (as we don't care about post-measurement state).

@joao-boechat joao-boechat changed the title Support negated targets in stim Support negated targets in stim collapsing gates Jul 13, 2026
@joao-boechat
joao-boechat marked this pull request as ready for review July 13, 2026 20:39
@fedimser
fedimser self-requested a review July 16, 2026 22:09
Comment thread source/compiler/stim_compiler/src/qir.rs Outdated
@joao-boechat
joao-boechat enabled auto-merge July 17, 2026 20:55
@joao-boechat
joao-boechat added this pull request to the merge queue Jul 17, 2026
Merged via the queue into main with commit 8a65071 Jul 17, 2026
13 checks passed
@joao-boechat
joao-boechat deleted the joaoboechat/support-negated-targets branch July 17, 2026 21:27
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.

3 participants