pyzx icon indicating copy to clipboard operation
pyzx copied to clipboard

Add more ZXW rewrite rules

Open RazinShaikh opened this issue 1 year ago • 1 comments

PyZX only has the W fusion rule for now. PyZX should support some of the common rewrite rules of the ZXW calculus. Here are the few rules I have in mind:

  • [ ] ZW bialgebra
  • [ ] WW bialgebra (I prefer the W projector version instead of the fermionic swap version because fermionic swap doesn't generalize to qudits)
  • [ ] Trialgebra
  • [ ] Pcy - any Z copies through W

It would be nice to support these rules in both forward and backward directions because for rules like trialgebra, we often want to switch from W (or X) to X (or W), apply an X (or W) rewrite, and then switch back using the opposite direction of trialgebra.

RazinShaikh avatar Aug 21 '23 23:08 RazinShaikh

It would probably be best to add these into their own file (something like wrules.py), just like how the H-box rules are in their own file.

jvdwetering avatar Aug 22 '23 09:08 jvdwetering