pyzx
pyzx copied to clipboard
add_edge with auto_simplify is incorrect in Multigraph
It incorrectly changes scalars, and it sometimes can't add self-loops.
For a reference, the new tests in #258 don't work if auto_simplify is enabled.
I noticed this line throws exceptions. Check https://github.com/zxcalc/zxlive/issues/256#issuecomment-2251311410.
https://github.com/zxcalc/pyzx/blob/7248d5b3e77ad18c10bcafa9856b49c595762ab6/pyzx/graph/multigraph.py#L252
That should now be fixed.
#331 partially solves this, but the multiedge scalar test still fails when autosimplify is active