Skip to content

Codex/pr180 symmetry design - #193

Merged
david-pl merged 14 commits into
split/1-translation-symmetryfrom
codex/pr180-symmetry-design
Sep 1, 2026
Merged

Codex/pr180 symmetry design#193
david-pl merged 14 commits into
split/1-translation-symmetryfrom
codex/pr180-symmetry-design

Conversation

@david-pl

Copy link
Copy Markdown
Collaborator

This implements the split suggested in #180 (comment) and fixes some issues that surfaced during the split or from copilot findings.

Should be merged before #181

cc @AlexSchuckert

@github-actions

github-actionsBot commented Jul 23, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-09-01 14:33 UTC

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the ppvm-pauli-sum translation-symmetry implementation into a dedicated symmetry/ module split (group / merge / momentum / tests), while also tightening validation logic for momentum-sector handling and applying a handful of small cleanup tweaks in examples/benches/tests across the workspace.

Changes:

  • Split ppvm_pauli_sum::symmetry into focused submodules (group, merge, momentum) and update the public re-exports.
  • Add/expand symmetry test coverage, including a new public API “imports remain available” regression test.
  • Minor micro-optimizations / clarity tweaks in examples, benches, and existing tests (e.g., hash_one, to_vec(), iterator usage).

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
FileDescription
crates/ppvm-tableau/src/data.rsSimplifies test assertions/collection for coefficient vectors.
crates/ppvm-tableau/examples/profile_measure_all.rsAvoids indexed mutation by iterating per_qubit_runs mutably with enumerate().
crates/ppvm-tableau/examples/profile_measure_all_flame.rsSmall doc-comment formatting tweak.
crates/ppvm-tableau-sum/examples/truncation-scaling.rsMinor readability + Clippy suppression for a multi-arg helper.
crates/ppvm-tableau-sum/examples/msd-noisy-compare.rsAdds Clippy suppression for a multi-arg helper.
crates/ppvm-pauli-sum/tests/symmetry_api.rsNew regression test ensuring symmetry APIs remain publicly importable/usable.
crates/ppvm-pauli-sum/src/symmetry/mod.rsNew symmetry module root with docs + public re-exports.
crates/ppvm-pauli-sum/src/symmetry/group.rsImplements TranslationGroup and orbit/canonicalization traversal infrastructure.
crates/ppvm-pauli-sum/src/symmetry/merge.rsImplements real-coefficient canonicalization and PauliSum symmetry merge.
crates/ppvm-pauli-sum/src/symmetry/momentum.rsImplements momentum characters, complex projection canonicalization, and sector validation errors.
crates/ppvm-pauli-sum/src/symmetry/tests.rsNew comprehensive test suite for group/orbit/momentum/merge behavior.
crates/ppvm-pauli-sum/src/symmetry.rsRemoves the prior monolithic symmetry implementation (replaced by the split module).
crates/ppvm-pauli-sum/examples/hash_quality.rsUses BuildHasher::hash_one for simpler hash extraction in the analysis example.
crates/ppvm-pauli-sum/benches/truncation-weight.rsAvoids cloning Word where it is Copy.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +321 to +325
} => write!(
f,
"input not in target momentum sector: orbit rep {rep} expected c={expected:?}, \
but orbit member {offending_pauli} (shift {shift:?}) has c={actual:?}"
),
@david-pl
david-pl merged commit f1481b2 into split/1-translation-symmetrySep 1, 2026
15 checks passed
@david-pl
david-pl deleted the codex/pr180-symmetry-design branch September 1, 2026 14:33
david-pl added a commit that referenced this pull request Sep 1, 2026
Keep main's #214 clippy fixes (arg structs, type annotations) over the
Co-authored-by: Cursor <cursoragent@cursor.com>
#193 #[allow] workarounds on the five overlapping tableau files.
david-pl added a commit that referenced this pull request Sep 2, 2026
## Summary
- Same kind of cleanup as #193 did for #180: split the 1300-line
`ppvm-lindblad` `lib.rs` / `LindbladSpec` impl into `word`, `algebra`,
`spec`, `basis`, `step`, and `tests`, keeping the public
`ppvm_lindblad::*` API.
- Collapses the timed/untimed `pc_step` copy, demotes `ppvm-pauli-sum`
to a dev-dependency, drops unused `approx`, strips 182-forward
`orbit_rep` doc links, and forwards `admit_basis` / `tau_add` on the
Python string `pc_step`.
- **Base is #181 (`split/2-ctpp-core`) on purpose.** #193 replaces #180
and is not an ancestor of #181; retargeting this at #193 now would mix
the whole CTPP crate into the diff. After #193 merges and #181 is
rebased onto it, this PR rebases with #181.
## Test plan
- [x] `cargo test -p ppvm-lindblad` (6 passed)
- [x] `cargo clippy -p ppvm-lindblad --all-targets -- -D warnings`
- [x] `cargo check -p ppvm-python-native`
- [ ] Rebase onto #181 after #181 is retargeted onto #193
Made with [Cursor](https://cursor.com)
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for freeto 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.

2 participants

@david-pl