Skip to content
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

support custom gates with phases #220

Open
dlyongemallo opened this issue May 4, 2024 · 1 comment
Open

support custom gates with phases #220

dlyongemallo opened this issue May 4, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@dlyongemallo
Copy link
Contributor

In particular, I'd like to use Qiskit's random_circuit function, but it generates custom gates with phase parameters. For example:

from pyzx.circuit import Circuit
from qiskit.circuit.random import random_circuit
from qiskit.qasm2 import dumps
...
qiskit_circ = random_circuit(qubits, depth)
qasm = dumps(qiskit_circ)
circ = Circuit.from_qasm(qasm)

This generates code such as:

OPENQASM 2.0;
include "qelib1.inc";
gate r(param0,param1) q0 {
    u3(param0,param1 - pi/2,pi/2 - 1.0*param1) q0;
}
qreg q[1];
r(pi/2,pi/4) q[0];
@dlyongemallo
Copy link
Contributor Author

The above raises a TypeError in this line.

@jvdwetering jvdwetering added the enhancement New feature or request label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants