-
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
pyzx unable to optimize when circuit contains rx or sx gate #215
Comments
phase is expecting a Fraction, not a float. Try Fraction(3,4) instead. |
The problem reproduces even with It does seem like the (The comment must be out-of-date, though, because the logic supports the |
Thanks for the clarification. OPENQASM 2.0;
include "qelib1.inc";
qreg q[3];
h q[0];
h q[1];
h q[2];
cx q[0],q[2];
rz(pi*1.79986) q[2];
cx q[0],q[2];
cx q[0],q[1];
cx q[1],q[2];
rz(pi*-3.59973) q[2];
cx q[1],q[2];
cx q[0],q[1];
rx(pi*0.545344) q[2];
rz(pi*-5.39959) q[1];
rx(pi*0.545344) q[0];
rx(pi*0.545344) q[1]; And the pyzx code is listed as follows. import pyzx as zx
c_zx = zx.Circuit.from_qasm_file("qaoa.qasm")
zx.optimize.full_optimize(c_zx.to_basic_gates()) which returns an error:
As a result, I utilize circuit.gate to check the phase of the XPhase gates for g in c_zx.gates:
if g.name == "XPhase":
print(type(g.phase)) And the output is
|
Using the most recent version of pyzx (0.8.0), with the following code
and it returns with an error
" Unknown gate XPhase(0,phase=0.75). Maybe simplify the gates with circuit.to_basic_gates()? "
The text was updated successfully, but these errors were encountered: