Skip to content
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

✨ QIR support for MQT #429

Open
4 tasks
burgholzer opened this issue Sep 19, 2023 · 0 comments
Open
4 tasks

✨ QIR support for MQT #429

burgholzer opened this issue Sep 19, 2023 · 0 comments
Labels
c++ Anything related to C++ code Core Anything related to the Core library and IR dependencies Pull requests that update a dependency file feature New feature or request help wanted Extra attention is needed
Milestone

Comments

@burgholzer
Copy link
Member

burgholzer commented Sep 19, 2023

What's the problem this feature will solve?

This is a tracking issue for adding QIR support within the MQT.
The following contains a summary of some discussions that took place at QCE23.

Describe the solution you'd like

One of the key take aways is that it is fine to keep our own circuit representation, i.e., we are not expected to base all of our developments on an LLVM Parse-Tree and throw away the QuantumComputation class.
In principle, we need to be able to parse QIR into QuantumComputation objects and create QIR from a QuantumComputation description.

The ad-hoc, straight-forward solution would be to rely on the PyQIR Python library that facilitates easy parsing and writing of QIR.
As for translating our circuit structure to QIR, https://github.com/microsoft/qiskit-qir could serve as an inspiration.
Pros:

  • easy to adopt
  • similar interface to the existing Qiskit support within the MQT
  • no heavy dependency (QIR support would just be an extra of the Python package)
    Cons:
  • Python (slow, not HPC compatible)
  • Does not really make sense long-term to parse to Python via a Python Package that is build on top of a rust package that wraps LLVM (which is purely C++)

A potential alternative would be to use the qirlib Rust library that builds the foundation for PyQIR and interface with that.
Pros:

  • Close-to-native Performance
  • Would bring Rust into the MQT Ecosystem
    Cons:
  • Requires us to adopt Rust in the MQT ecosystem (Compiler, CI, etc.)
  • Requires us to interface with a Rust library from C++ that itself binds to the underlying LLVM C++ code

As a consequence of the above, it was actually recommended to directly build upon LLVM, which is natively written in C++.
Pros:

  • Native solution
  • Most performance
  • Truly in-house solution
    Cons:
  • Code duplication between the qirlib and our in-house solution
  • Requires the adoption of parts of the LLVM code base into our toolkit
  • Steep entry barrier and learning curve

As for the last part, I was told that the part of LLVM that’s actually needed for QIR support should be rather small compared to the complete LLVM Suite.

From these discussion, I would rule out the second option from above as it sits straight in between the least effort/quickest solution and the most effort/long-term solution.
I would prefer the long-term solution to be implemented right away, although it might be a tough nut to crack.

A couple of references for starting out with this:

Tasks

@burgholzer burgholzer added help wanted Extra attention is needed dependencies Pull requests that update a dependency file feature New feature or request Core Anything related to the Core library and IR c++ Anything related to C++ code labels Sep 19, 2023
@burgholzer burgholzer added this to the QIR Support milestone Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Anything related to C++ code Core Anything related to the Core library and IR dependencies Pull requests that update a dependency file feature New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant