Skip to content

remove Measurement.to_graph_ground and unused ground parameter - #433

Merged
jvdwetering merged 1 commit into
zxcalc:masterfrom
dlyongemallo:remove_to_graph_ground
Apr 11, 2026
Merged

remove Measurement.to_graph_ground and unused ground parameter#433
jvdwetering merged 1 commit into
zxcalc:masterfrom
dlyongemallo:remove_to_graph_ground

Conversation

@dlyongemallo

@dlyongemallo dlyongemallo commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Description

Remove the representation of measurement as a node with a ground symbol, as this causes confusion and conflicts with the representation of ground using symbolic boolean values.

This is a breaking change.

Related issue

Follow-up to #402 (comment).

Checklist

  • I have added/updated tests (for bugfixes, please include a regression test, for new features, include new tests either to an existing test file or a new file).
  • For new features: I have updated the documentation.
  • All the functions I added have a docstring parsable by sphinx (for a good example see pyzx.extract.extract_circuit).
  • I have added an entry to CHANGELOG.md describing my change.

Copilot AI review requested due to automatic review settings April 3, 2026 08:44
@dlyongemallo
dlyongemallo marked this pull request as draft April 3, 2026 08:44

Copilot AI left a comment

Copy link
Copy Markdown

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 removes the “ground-symbol” graph representation for measurements and standardizes measurement graph conversion to always use the symbolic-boolean (symbolic phase) representation, to avoid confusion/conflicts with ground vertices.

Changes:

  • Removed Measurement.to_graph_ground and the ground parameter path from Measurement.to_graph.
  • Deleted tests that specifically asserted the removed ground-mode measurement behavior.
  • Added a changelog entry documenting the removal.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
pyzx/circuit/gates.py Deletes Measurement.to_graph_ground and makes Measurement.to_graph always emit the symbolic-boolean representation.
tests/test_qasm.py Removes tests that depended on the now-removed ground-mode measurement behavior.
CHANGELOG.md Notes the removal of Measurement.to_graph_ground in the Unreleased section.

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

Comment thread pyzx/circuit/gates.py Outdated
Comment thread CHANGELOG.md
@dlyongemallo
dlyongemallo force-pushed the remove_to_graph_ground branch from 382f4ce to 4d03fb1 Compare April 4, 2026 04:47
@dlyongemallo
dlyongemallo marked this pull request as ready for review April 7, 2026 13:35
@jvdwetering
jvdwetering merged commit 687d1dd into zxcalc:master Apr 11, 2026
4 checks passed
@dlyongemallo
dlyongemallo deleted the remove_to_graph_ground branch April 11, 2026 10:33
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.

3 participants