-
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
zx.qasm does not recognize gates imported from qelib1.inc #48
Comments
Okay, I can add a controlled-Hadamard gate to PyZX. Are there any other gates from the standard QASM library that are missing? |
Controlled Hadamard is the only one I tried. I am new to both ZX and QASM. PyZX does not read qelib1.inc to get the definitions? |
Hi @jvdwetering , it looks like the
It would be very helpful to our project. |
So, for the CRZ gate there is a bit of a difficulty in which phase convention to adopt. The qiskit library (https://qiskit.org/documentation/stubs/qiskit.circuit.library.CRZGate.html) apparently sees an RZ(alpha) gate as diag(e^{-i alpha/2},e^{i alpha/2}). This leads to a different controlled phase gate than I would expect (namely, a matrix with 2 diagonal elements not equal to 1, instead of just 1 element not equal to 1). For instance, a CRZ(pi) gate does not match the CZ gate. |
In case anyone comes across this issue later, support for all the gates mentioned above have all been added as of PR #156. |
qelib1.inc defines the controlled Hadamard gate
ch
, butzx.qasm
does not recognizech
even when qelib1.inc is importedThe text was updated successfully, but these errors were encountered: