openqasm / qe-compiler

An MLIR based compiler dynamic circuit compiler for real-time control systems supporting OpenQASM 3
Other
46 stars 15 forks source link

Add qiskit-aer simulator target #156

Closed ibm-wakizaka closed 7 months ago

ibm-wakizaka commented 1 year ago

Summary

Add a simulator target for simulator using Aer runtime API.

Details

Add a pass that convert QUIR and OQ3 dialects to LLVM's standard dialect that calls Aer functions. Currently all features in OpenQASM3 are not supported. The supported features is listed below:

Please see sample files in targets/simulators/aer/test/Conversion.

Requirements

We need a dynamic library libaer.so to run a generated object file.

How to use

$ qss-compiler program.qasm --target aer-simulator --emit=mlir -o program.mlir --config your.cfg --num-shots=1 --aer-simulator-conversion

Remark

Currently, the option --emit=qem generates a zip file which contains manifest.json and an object file but it cannot be executed itself. The feature to output a binary file will be a big task so I will create another PR to support it.

ibm-wakizaka commented 1 year ago

Certainly! The main differences are listed below:

ibm-wakizaka commented 9 months ago

@mhillenbrand Thank you for your comments! I changed code by your suggestions.

CLAassistant commented 8 months ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

hhorii commented 7 months ago

I will create a PR from my repository based on this PR.