pyzx
pyzx copied to clipboard
Add more ZXW rewrite rules
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.
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.