-
Notifications
You must be signed in to change notification settings - Fork 7
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
Node of type "SubroutineDefinition" is not supported #8
Comments
(I answered this a few hours ago. But did not hit the green button, or it's in the wrong place, or.... I'll repeat it here.) Please do open issues like this. I helps to understand the level of demand for features.
This is the openqasm reference parser. Its main purpose is to document the language and aid development. It is meant to ingest anything that is correct OQ3. (And because it doesn't do much semantic analysis, it also accepts some incorrect programs) It happens to be the most convenient thing to use for importing into Qiskit until a more robust solution is ready. But Qiskit can't represent all of OQ3. So the importer does not make use of everything that the parser gives it. I don't know of plans to implement the feature you mention above. But on the face of it, it seems like a reasonable feature to add to the importer. |
@jakelishman what do you think? Does it make sense to support this? If so, in this version of the importer? |
I think I originally made the decision to reject this because the Terra exporter's handling of subroutine outputs was really pretty questionable (if I remember correctly). The problems we'd face are that OQ3 subroutines have general parameter lists that have qubit arguments and arbitrary typed classical arguments all mixed together. Terra doesn't have much of a natural representation of those, especially functions with classical parameters, so I didn't want to add support for something that would be really half-baked at best. That said, if we really did want to, it's not impossible to have some baseline of support for The reason we do want to support programs written with physical qubits is because we want to reach feature parity with what |
Env
{'qiskit-terra': '0.23.1', 'qiskit-aer': '0.11.2', 'qiskit-ignis': None, 'qiskit-ibmq-provider': '0.20.0', 'qiskit': '0.41.0', 'qiskit-nature': None, 'qiskit-finance': None, 'qiskit-optimization': None, 'qiskit-machine-learning': None}
Code
I understand that some things are not yet supported by the Importer (See Qiskit/qiskit#9609) but is this a case of that? It seems like
openqasm
python lib does provide support for SubroutineDefinition (Link).It is totally possible that this is planned for the future, in which case, feel free to ignore this issue. 😊
The text was updated successfully, but these errors were encountered: