Skip to content

MR/MRX/MRY terminate operators with markers in Crumble or else produce an error (magenta mark)#1086

Open
frederikwilde wants to merge 2 commits into
quantumlib:mainfrom
frederikwilde:fix-demolition-measure-marker-handling
Open

MR/MRX/MRY terminate operators with markers in Crumble or else produce an error (magenta mark)#1086
frederikwilde wants to merge 2 commits into
quantumlib:mainfrom
frederikwilde:fix-demolition-measure-marker-handling

Conversation

@frederikwilde

Copy link
Copy Markdown

Disclaimer: The changes in this PR were written in part by Claude Code; my non-existent JS skills would have produced much lower-quality code. But I reviewed everything and this PR text is written by me. If this can't be merged for legal reasons, perhaps it can serve as a basis for a future patch.

The documentation states that the circuit M 0; R 0 should be equivalent to MR 0, but in Crumble there is a divergence of the two. An incoming Z operator passes through M and causes an error at R if not captured by a MARKZ (first row in upper figure). For MR the behavior deviates: the operator simply passes through (third row in upper figure).

Trying to capture the operator with a MARKZ will just create a new operator (second row in upper figure).

The fix is to first handle potential inbound operators upon measurement and then creating an error (magenta mark) at the reset if applicable.

Upstream:
Screenshot 2026-07-08 at 14 38 23

This PR (the behavior I'd expect):
Screenshot 2026-07-08 at 14 36 04

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.

1 participant