Skip to content

Add aggregate logical observable groups#239

Merged
masa10-f merged 1 commit into
masterfrom
agent/logical-observable-groups
Jul 21, 2026
Merged

Add aggregate logical observable groups#239
masa10-f merged 1 commit into
masterfrom
agent/logical-observable-groups

Conversation

@masa10-f

Copy link
Copy Markdown
Collaborator

Summary

  • add PauliFrame.logical_observable_groups() to expand every indexed logical-observable seed through the dependent-chain closure
  • update Stim export to consume the aggregate logical-observable API, matching the existing detector_groups() flow
  • preserve the existing raw seed storage and per-group API for backward compatibility
  • document the new public API in CHANGELOG.md

Why

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 .ptn files can now expose all closure-expanded logical observables with one call:

pattern.pauli_frame.logical_observable_groups()

Existing callers of logical_observables and logical_observables_group() remain compatible.

Validation

  • uv run ruff check graphqomb/pauli_frame.py graphqomb/stim_compiler.py tests/test_pauli_frame.py
  • uv 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

@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.38%. Comparing base (f18a5e6) to head (073364c).
⚠️ Report is 1 commits behind head on master.

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@masa10-f
masa10-f marked this pull request as ready for review July 21, 2026 12:16
@masa10-f
masa10-f merged commit 98a4318 into master Jul 21, 2026
24 checks passed
@masa10-f
masa10-f deleted the agent/logical-observable-groups branch July 21, 2026 12:17
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