Skip to content

Add support for fault equivalent rewrites#427

Open
lunarr-eclipse wants to merge 23 commits into
zxcalc:masterfrom
96-LB:show_feq_rewrites
Open

Add support for fault equivalent rewrites#427
lunarr-eclipse wants to merge 23 commits into
zxcalc:masterfrom
96-LB:show_feq_rewrites

Conversation

@lunarr-eclipse

Copy link
Copy Markdown

This PR adds support for fault equivalent rewrites, alongside additional documentation and bugfixes.

Changes:

  • Implemented fault-equivalent (FE) rewrite mode with toggle button and fault-weight input. This can be accessed in the proof panel.
  • Added existing FE rewrites from PyZX to ZXLive
  • Added new rewrites to PyZX, which are also supported in ZXLive with this PR: 2FE unfuse-n and fuse-4/5/n
  • Bug fixes: vertex dragging, copy 0/π spider rule, typing
  • New documentation for shortcuts and FE rewrites

Co-authored with @loisdelamar

@jvdwetering

Copy link
Copy Markdown
Collaborator

Looks great! Could you take a look at the mypy errors? I think not all of them have to do with the new functionality, but some of them probably do.

@RazinShaikh

Copy link
Copy Markdown
Collaborator

@lunarr-eclipse @loisdelamar Can you please fix the merge conflicts and the failing checks? It would be good to merge this before it diverges too much from the main branch.

@96-LB

96-LB commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator

Hi @RazinShaikh, since this PR is on my fork and seems to be going stale, I took some time to fix the merge conflicts so that it can be properly tested. I also ran pytest, mypy, and ruff locally. There's still a mypy error, but master is also failing so it seems unrelated to this PR.

I didn't work on this feature at all during the project, but if you need help reviewing I can take a look at the code and/or make any updates as needed.

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.

5 participants