Open y-richie-y opened 2 months ago
Hhmm, that is an interesting edge case. What might be happening is that in the second case none of the rewrite rules in full_reduce
match, and hence the method in the Graph
that gets rid of scalar nodes also does not get called. This could be fixed by having a final round of removing scalar spiders at the end of full_reduce
These examples are ran on the version of pyzx on pip:
In this example the right thing happens and we get
(1 + 1j)
but in this example
full_reduce
does not reduce the diagram fully and the scalar is still 1:This could be intended behaviour, but what is the "correct" way to reduce a pyzx diagram to a scalar?