zxcalc / pyzx

Python library for quantum circuit rewriting and optimisation using the ZX-calculus
Apache License 2.0
388 stars 116 forks source link

Fix color_change, fusion, and match_ids #244

Closed boldar99 closed 5 months ago

boldar99 commented 5 months ago

Fix the color_change, fusion, and match_ids_parallel methods that were broken with incident multi-edges.

Changes:

Related to zxcalc/zxlive#256

RazinShaikh commented 5 months ago

This only fixes colour change method in editor_actions.py but not the one in basicrules.py. I don't know why there are two implementations of colour change and why they are implemented differently. I tried to copy the implementation of editor_actions.py to basicrules.py and it seems to work.

RazinShaikh commented 5 months ago

I have pushed the color_change fix for basicrules.py.

RazinShaikh commented 5 months ago

I have now fixed spider fusion in rules.py. I don't think fusion or color_change is defined anywhere else. So this PR should be good to merge.

RazinShaikh commented 5 months ago

ah self loops are still broken

RazinShaikh commented 5 months ago

Fixed!

jvdwetering commented 5 months ago

After the merge conflict is solved, this can probably be merged.

RazinShaikh commented 5 months ago

I have resolved the conflict but I need to check if that broke anything

RazinShaikh commented 5 months ago

This can be merged now!