Skip to content

Add optional PyZX integration via graphqomb.zx_util#171

Merged
masa10-f merged 18 commits intomasterfrom
pyzx-interface
Mar 19, 2026
Merged

Add optional PyZX integration via graphqomb.zx_util#171
masa10-f merged 18 commits intomasterfrom
pyzx-interface

Conversation

@masa10-f
Copy link
Collaborator

@masa10-f masa10-f commented Mar 18, 2026

Summary

  • Adds graphqomb.zx_util module with from_pyzx() to convert strict graph-like PyZX diagrams into GraphState.
  • Adds boundary rewriting and metadata import helpers to preserve graph structure, measurement bases, and coordinates
  • Adds optional phase-gadget recognition for lone-Z gadget patterns via recognize_pg=True
  • Adds optional graphqomb[pyzx] package extra and updates README with installation instructions
  • Splits PyZX-marked tests into a dedicated GitHub Actions CI job and installs the optional dependency in coverage runs
  • Adds Sphinx API reference pages for graphqomb.zx_util

Test plan

  • Run pytest -m "not pyzx" to ensure existing tests pass without PyZX installed
  • Run pytest -m pyzx after installing graphqomb[pyzx] to verify PyZX integration tests
  • Verify CI passes for both pytest and pyzx-integration jobs
  • Check Sphinx docs build without errors: cd docs && make html

Related Issues

Closes #111
This PR eliminates the need to implement ZX rewrite rules directly, since they are not closed within MBQC.

🤖 Generated with Claude Code

@masa10-f masa10-f self-assigned this Mar 18, 2026
@masa10-f masa10-f added the enhancement New feature or request label Mar 18, 2026
@codecov
Copy link

codecov bot commented Mar 18, 2026

Codecov Report

❌ Patch coverage is 74.34783% with 59 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.58%. Comparing base (95ece6a) to head (b061a9f).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #171      +/-   ##
==========================================
+ Coverage   84.11%   84.58%   +0.47%     
==========================================
  Files          22       24       +2     
  Lines        2606     3199     +593     
  Branches      476      549      +73     
==========================================
+ Hits         2192     2706     +514     
- Misses        309      361      +52     
- Partials      105      132      +27     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e337a0f36a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@masa10-f
Copy link
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Chef's kiss.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@masa10-f masa10-f requested a review from d1ssk March 19, 2026 01:23
@masa10-f
Copy link
Collaborator Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9c45aa7204

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@d1ssk d1ssk self-requested a review March 19, 2026 07:19
@masa10-f masa10-f merged commit ae48c93 into master Mar 19, 2026
24 checks passed
@masa10-f masa10-f deleted the pyzx-interface branch March 19, 2026 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Graph State Initialization with PyZX

2 participants