Open dlyongemallo opened 6 months ago
In particular, I'd like to use Qiskit's random_circuit function, but it generates custom gates with phase parameters. For example:
random_circuit
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];
The above raises a TypeError in this line.
TypeError
In particular, I'd like to use Qiskit's
random_circuit
function, but it generates custom gates with phase parameters. For example:This generates code such as: