According to the OPENQASM 2.0 documentation, it's possible to define custom unitary gates using the format:
gate name(params) qargs
{
body
}
where the optional parameter list params
is a comma-separated list of variable parameter names, and the argument list qargs
is a comma-separated list of qubit arguments.
In my specific case, I'm trying to implement a single-qubit controlled unitary which will act on two qubits. So is there a way to define a custom controlled unitary gate in OPENQASM 2.0? It should work on the new IBM Quantum Experience Beta.