-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Circuit extraction says graph is not fully reduced even after applying full_reduce #161
Comments
Just to make things maybe easier to understand, the above
Using this
I think the intended meaning of "only normal and Hadamard edges" is "no vertices other than inputs and outputs" (since there are no other kinds of edges). The function (implicitly) assumes that the only neighbours of the outputs are inputs, and the above
So I'm guessing that at some point, your |
Thanks for the analysis! Turning all Hadamard nodes into Hadamard edges (which in the json simply means replacing |
|
Thanks for the confirmation! Then the workaround of replacing |
The function requires that the input is a ZX-diagram (i.e., no `H_BOX`es). See zxcalc#161 and zxcalc#200 for context. Note: This does not guard `clifford_simp` or other simplification subroutines, which will still silently fail if there are `H_BOX`es. Putting a check into each subroutine would be redundant and expensive.
The following example throws an error:
Output:
Since I explicitly called
full_reduce
, this error is unexpected for me. Is this a bug or am I misinterpreting things?Additionally note that the failed circuit extraction actually seems to change
g
: Callingzx.draw(g)
after this error draws a circuit where the hadamard node has a phase of 0.PyZX Version: commit e4fe332 (current master at the time of writing)
The text was updated successfully, but these errors were encountered: