Add Stim MPP stabilizer import#217
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: be48e39c71
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
|
|
||
| def _target_pauli(target: stim.GateTarget) -> str: | ||
| if target.is_x_target: |
There was a problem hiding this comment.
Handle inverted MPP targets instead of dropping signs
When a Stim MPP product uses an inverted target such as MPP !Z5 or X2*!Y3*Z5, Stim flips the recorded measurement result, but this parser treats the target exactly like an uninverted Pauli target and loses that sign/constant offset. For circuits that use these valid MPP forms, the extracted stabilizer and any imported detector/logical parity rows no longer match the Stim circuit; if signs are not representable here, this should at least reject target.is_inverted_result_target instead of silently importing incorrect data.
Useful? React with 👍 / 👎.
Summary
graphqomb.qec.stim_mpputilities for extractingStabilizerCodeinputs from StimMPPlayers.graphqomb[stim]dependency metadata and lockfile entries.CHANGELOG.md.Validation
env PYTHONPATH=/home/masa10/git-repos/utftbmqc/ls-pattern-compile:/home/masa10/git-repos/utftbmqc/graphqomb uv run --no-sync ruff checkenv PYTHONPATH=/home/masa10/git-repos/utftbmqc/ls-pattern-compile:/home/masa10/git-repos/utftbmqc/graphqomb uv run --no-sync pytest -qenv PYTHONPATH=/home/masa10/git-repos/utftbmqc/ls-pattern-compile:/home/masa10/git-repos/utftbmqc/graphqomb uv run --no-sync pyright graphqomb/qec/stim_mpp.py tests/test_stim_mpp.py