Add aggregate logical observable groups#239
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #239 +/- ##
=======================================
Coverage 86.38% 86.38%
=======================================
Files 31 31
Lines 5111 5112 +1
Branches 908 908
=======================================
+ Hits 4415 4416 +1
Misses 491 491
Partials 205 205 🚀 New features to boost your workflow:
|
masa10-f
marked this pull request as ready for review
July 21, 2026 12:16
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
PauliFrame.logical_observable_groups()to expand every indexed logical-observable seed through the dependent-chain closuredetector_groups()flowCHANGELOG.mdWhy
Detector groups already have an aggregate closure-expanded accessor, while logical observables required callers to iterate over raw seeds and invoke the per-group method themselves. This API asymmetry made logical observables appear to behave differently even though both use the same closure algorithm.
Impact
Patterns and
.ptnfiles can now expose all closure-expanded logical observables with one call:Existing callers of
logical_observablesandlogical_observables_group()remain compatible.Validation
uv run ruff check graphqomb/pauli_frame.py graphqomb/stim_compiler.py tests/test_pauli_frame.pyuv run --extra stim pytest -q -s tests/test_pauli_frame.py tests/test_stim_compiler.py tests/test_ptn_format.py(92 passed)git diff --check