Merged
Conversation
…faelha/doubled_diagram_visualization
Contributor
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
Contributor
|
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the PyZX diagram rendering path to support “doubled diagram” notation (bold vertices/edges) so Circuit.diagram("pyzx") produces semantically correct ZX-style visualizations for circuits with classical post-processing (detectors/observables).
Changes:
- Add an optional
track_classical_wiresmode to the stim→ZX parsing pipeline and thread it into the"pyzx"diagram path. - Introduce “bold” edge/vertex type enums and use them for many graph-construction edges/vertices when classical-wire tracking is enabled.
- Switch
pyzx-paramresolution to a Git branch that (presumably) implements doubled-diagram rendering support.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
uv.lock |
Switches pyzx-param from a PyPI release to a Git-sourced dependency (branch/commit) to pick up doubled-diagram support. |
pyproject.toml |
Adds a uv source override for pyzx-param to pull from a Git branch. |
src/tsim/core/parse.py |
Adds track_classical_wires parameter and passes it into GraphRepresentation. |
src/tsim/core/instructions.py |
Adds bold enums and routes various edge/vertex constructions through b.edge_type / b.vertex_type when tracking classical wires. |
src/tsim/circuit.py |
Enables classical-wire tracking for diagram(type="pyzx") and adds boundary outputs for det/obs nodes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ub.com/QuEraComputing/tsim into rafaelha/doubled_diagram_visualization
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.
Closes #60
This PR purely changes visualization, but not the underlying pyzx backend. For actual ZX simplification and stabilizer rank decomposition, a doubled diagram is always constructed manually, e.g., by explicitly adding to vertices with conjugate phase per quantum spider.
Uses doubled diagram notations, so that the method
Circuit.diagram("pyzx")actually returns correct ZX diagramsThe notation is defined as follows: