-
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
System and Environment Information
- Arch Linux
- feature branch, but should be the same on
main - C++, GCC 15.2.1
- LLVM 21.1.0
Bug Description
- The current implementation cannot handle "normal" non-static parameters with a
arith.constant. This should become easy to fix after the Dialect Rewrite since the constants will be accessible via the interface if I remember correctly. For now, I used a helper function (see here) to add the parameters here. This will lead to a crash because the parameters are access without any check since it is to be expected for e.g. a rotation gate to have exactly one parameter. - The current implementation cannot handle operations without a target like
GPhaseOp. This can be solved by a check here and here - The name of the qubit registers (at least in OpenQASM 2) which is read here will result in a syntax error in OpenQASM because it will be something like
%1 = "mqtopt.allocQubitRegister"() <{size_attr = 2 : i64}> : () -> !mqtopt.QubitRegister allocQubitis not supported yet and requires the code to be re-written usingallocQubitRegister(not necessarily a bug)
Especially regarding the first issue, I think it makes sense to wait for the dialect rewrite which will require
Steps to Reproduce
While trying to use the ToQuantumComputationPattern to dump MLIR code as OpenQASM, I noticed some minor bugs in the current implementation. For this, I modified the round-trip pass to dump the MLIR code as OpenQASM code to verify it more easily.
While #46 already addresses some usability issues, I wanted to add actual bugs that need to be fixed in order to use it for its intended purpose outside of the "round-trip" test cases.