zxcalc / zxlive

A graphical tool for the ZX calculus
Apache License 2.0
50 stars 20 forks source link

Hopf in custom rewrite rule not stored/loaded. #356

Open Aerylia opened 2 weeks ago

Aerylia commented 2 weeks ago

I'm not sure if this is related to #304 but I tried to make my own hopf to introduce CNOTs since the CNOT introduction does not always respect the ordering of the controls vs the targets. But the double edge isn't stored in the rewrite rule.

This is the rewrite rule:

image

This is how the rule is loaded in the proof system:

image
jvdwetering commented 1 week ago

This probably has to do with the fact the save/load system doesn't currently properly support parallel edges. See also #308.

RazinShaikh commented 1 week ago

As a workaround, you can use the magic wand to cut two wires, applying the hopf rule.

Edit: Sorry, I just noticed that you are introducing two wires, not removing them. The magic wand suggestion won't be useful then.