Add MXX, MYY, MZZ instructions#96
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
|
Contributor
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for Stim’s two-qubit Pauli parity measurement instructions (MXX, MYY, MZZ) in Tsim by translating them into equivalent MPP measurements during parsing, and extends the parser to tolerate II_ERROR.
Changes:
- Extend
parse_stim_circuitto recognizeMXX/MYY/MZZand delegate each target-pair tompp(...), including inverted-target parity handling. - Ignore
II_ERROR(andI_ERROR) instructions during parsing. - Add unit/integration tests and update the overview demo notebook to mention and illustrate the new measurement instructions.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/tsim/core/parse.py |
Adds parsing support for MXX/MYY/MZZ (via MPP) and ignores II_ERROR. |
test/unit/core/test_parse.py |
Adds parser-level record-length tests for MXX/MYY/MZZ. |
test/integration/test_sampler_circuits.py |
Adds sampler integration tests validating deterministic outcomes for Bell/state parity cases, inversion, and multiple pairs. |
docs/demos/overview.ipynb |
Updates measurement documentation/examples to include MXX/MYY/MZZ and tweaks an MPP example. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR also adds support for
II_ERROR.Closes #76
Test plan
🤖 Generated with Claude Code