-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 gate defintions in QASM parser #3560
Comments
Hi @BillGatesNephew, thanks for opening, this is great! The feature sounds good to me, this will be a good medium sized project. I think this is just at the size for an RFC. Do you mind sketching out a design in an RFC, mainly: How are you planning to map a custom gate to Cirq? How about recursively defined gates, are you going to keep the structure somehow? How will that play with Cirq protocols like Feel free to prototype while you are writing the RFC, and share it on your fork, happy to give feedback! Also, a side-note: the current implementation direction might change in the coming months and be replaced by a qiskit/cirq mapping if we find that that's smaller / cheaper to maintain, there are two reasons:
Having said that - it might be that the parser is actually cheaper to maintain than the mapping, we'll have to evaluate that down the line after the packaging extraction is done. |
@balopat Yeah I wouldn't mind working on an RFC for it after I think a little more about it and consider the points you mentioned. Thanks. |
This seems to have gone stale. @balopat do you have any updates on the qiskit dependency? |
We made progress with extracting our first module, but no progress was made on the qiskit side of things. I still think it's a good idea to revisit the implementation if someone's up for it. In the meantime if someone wants to implement the custom gate definitions in QASM parser, now we have the |
Does this still need an RFC ? I would like to give a shot at this. |
Yes, AFAIK nobody is working on it right now. Before diving too deep you might want to get some agreement from the maintainers regarding whether to use decomposition or subcircuits here. IIUC QASM custom gates are unitary only (https://qiskit.github.io/openqasm/language/gates.html#hierarchically-defined-unitary-gates), so I'd lean toward a decomposition based approach, where as subcircuits map more closely to QASM subroutines (https://qiskit.github.io/openqasm/language/subroutines.html). But that's just me. @tanujkhattar / @95-martin-orion / @MichaelBroughton do you have any top-level opinions on that? (Also, is bringing in the full qiskit dependency still something anyone is considering in the near term)? |
My take on this:
Note: while |
|
Extra qubits shouldn't be required for this. A
As long as the |
cirq cync note: This is accepted but low priority and will be done with community support. |
Currently the QASM parser can't handle
gate name(params) qargs;
control statements, so the request is to add these features into it.I was already planning to work on this myself and put up a PR for it, but I wasn't sure if it needed a RFC or not.
The text was updated successfully, but these errors were encountered: