Closed mtreinish closed 7 months ago
Thanks for the report. The current main branch of openqasm3_parser parses your example above without panic and without reporting syntax or semantic errors.
I'll release a version. I don't think I changed the API, but I have not been testing carefully with the qiskit importer.
If I run qiskit.qasm3.load_experimental(filename)
with the current main branch of the parser, importing fails with
QASM3ImporterError: "can't handle non-built-in gate: 'rccx'"
Importing gate definitions has not yet been implemented in the importer.
I also had to add a couple of enum
variants to a default match arm, because the importer lists all variants individually. I have been adding variants as I add support for parts of the langauge.
I should probably close #82 as it is rather irrelevant at the moment.
I just made this release https://github.com/Qiskit/openqasm3_parser/releases/tag/0.2.0
This produces the behavior in the previous comment. Namely, there is no longer a panic. But a QASM3ImporterError
error is raised because the example code is not supported by the importer.
Here is a branch of qiskit that changes the dependency to openqasm3_parser 0.2.0. The parent commit is the 1.0rc1 commit. https://github.com/jlapeyre/qiskit-terra/tree/update-for-openqasm3
Adding a dbg!
shows that the panic is indeed when analyzing u1(-pi/4) _gate_q_2;
. And the problem is the unary minus.
This is a dup of #81, which was fixed in #92 .
In attempting to load the qasm using the Qiskit importer I received an internal panic in
oq3_semantic
that it was runningunwrap()
on aNone
value:It looks like here: https://github.com/Qiskit/openqasm3_parser/blob/3e9a05b79f19c756a7dec9e20ca2943060d23dd8/crates/oq3_semantics/src/syntax_to_semantics.rs#L253 the
lhs
of theBinExpr
isNone
. My assumption this is coming from the custom gate definitions in the qasm. If so and this is just a duplicate of #82 we can close this as such, it just wasn't the most obvious error message so I wasn't 100% and opened an issue.The qasm file
The qasm was just generated with: