Conversation
…termined by the measurement plane
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new “qompiler” module and Pauli frame tracking to compile graph-state circuits into MBQC patterns, refactors command objects, and updates documentation/configuration.
- Add
qompiler.pyandpauli_frame.pyto initialize and track Pauli frames during pattern compilation. - Extend
Patternto carry aPauliFrameand updateqompile*routines accordingly. - Remove classical-bit control fields from
M,X, andZcommands and update their__str__representations; update docs, examples, and project config.
Reviewed Changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_pattern.py | Removed existing pattern tests—new tests needed for Pattern.pauli_frame and qompiler |
| pyproject.toml | Added an “D” entry under examples; verify correctness |
| graphix_zx/qompiler.py | New qompiler implementation; compiles graph states into Pattern |
| graphix_zx/pauli_frame.py | New PauliFrame class to track byproduct corrections |
| graphix_zx/pattern.py | Extended Pattern dataclass to include pauli_frame |
| graphix_zx/command.py | Removed s_cbit/t_cbit fields from commands; updated __str__ |
| graphix_zx/focus_flow.py | Reversed topo_order in place |
| examples/pattern_generation.py | New example showing qompile_from_flow usage |
| docs/source/*.rst | Added/removed references for qompiler and pauli_frame modules |
| docs/requirements.txt | Added matplotlib |
Comments suppressed due to low confidence (5)
graphix_zx/command.py:69
- Removing
s_cbit/t_cbitfrom M, X, and Z commands is a breaking API change; consider updating the changelog and bumping the major version to signal this change to downstream users.
"""
graphix_zx/qompiler.py:196
- This comment mentions removing local Clifford commands, but no such logic is present. Please either implement the removal or update/delete the comment to accurately reflect the current behavior.
# NOTE: currently, we remove local Clifford commands
pyproject.toml:76
- [nitpick] The entry "D" under examples/*.py looks incomplete or missing a file extension. Verify that this matches an actual example file or remove it to avoid confusion.
"D",
graphix_zx/focus_flow.py:107
- [nitpick] This in-place
list.reverse()differs from thereversed()calls used in other modules. Consider unifying the approach for clarity and consistency across the codebase.
topo_order.reverse() # children first
|
Putting fault tolerance aside for now and focusing only on MBQC, I believe the branching between |
|
As shown in the example, when the gflow is passed directly as an argument to |
|
|
@d1ssk Could you quickly review again? If there's no problem, please approve this PR. |
|
Looks good! |
Before submitting, please check the following:
pytest)ruffmypyandpyrightmake htmlin./docs/- you may need to install dependency for sphinx docs, seedocs/requirements.txt.)Then, please fill in below:
Context (if applicable):
Description of the change:
Implemented
Chnaged
M,X, andZcommands. Now, it is completely managed in Pauli frame.Related issue: