pyzx icon indicating copy to clipboard operation
pyzx copied to clipboard

Add hopf rule and self-loop removal rules for multigraph

Open RazinShaikh opened this issue 1 year ago • 2 comments

This is automatic for simple graph but needs to be new rewrite rules for multigraphs

RazinShaikh avatar Jun 29 '24 13:06 RazinShaikh

Should the implementation also apply to these cases? image

My idea would be to implement two different functions, one to remove specific edges and another to remove all possible parallel edges between two vertices.

image Here, for example, on the top diagram, two edges are selected and removed while on the bottom one, every possible parallel edge is removed as the vertices are selected.

Does this sound good to you?

boldar99 avatar Jul 16 '24 18:07 boldar99

It should also take care of the hadamard edges case. I agree that we should have two functions like you mentioned.

RazinShaikh avatar Jul 16 '24 22:07 RazinShaikh

@jvdwetering added these rules in https://github.com/zxcalc/pyzx/commit/904a01c8d7b1bd850f5b494b938b0d337174f86c and https://github.com/zxcalc/pyzx/commit/819421d4ea8267c2edd121e7df269a2a1557759e

RazinShaikh avatar Oct 06 '25 21:10 RazinShaikh