-
Notifications
You must be signed in to change notification settings - Fork 20
✨ Added QASM3 support #518
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
✨ Added QASM3 support #518
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #518 +/- ##
=======================================
- Coverage 91.5% 90.6% -0.9%
=======================================
Files 36 36
Lines 1656 1697 +41
=======================================
+ Hits 1516 1539 +23
- Misses 140 158 +18
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: burgholzer <[email protected]>
…ecessary Signed-off-by: burgholzer <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks for adding this 🙏🏼 this help is much appreciated.
I just pushed two small fix ups; one for updating the lockfile and one for making the decomposition slighlty more specific. Technically, this is a bug in Qiskit that could be worth reporting. Or at least worth checking, if this is fixed in more recent versions.
The PR itself looks good to me as it is given the current (changing) state of the code base. So let's get this in 🚀
However, looking through the code triggered a couple of follow-up request. Some of these might not be fully related to this PR specifically, but they are more general observations. Maybe @nquetschlich or @simon1hofmann could turn these into issues to follow up on after this PR is completed.
- Based on offline discussion, dropping support for TKET seems reasonable and simplifies quite some of the code base. Also with regard to exporting. It opens up the door for directly supporting Qiskit 2.0 as well as Python 3.9.
- So, after dropping TKET and related dependencies, Python 3.9 support should be added back.
- Similarly, compatibility with Qiskit 2.0 should be tested and deprecation warnings should be resolved.
- We should generalize the output logic from purely OpenQASM (2 or 3) to more general output formats. Every function parameter in this PR that is called "qasm_format" should most likely be called "output_format" and should accept values from a string enum. Once a qiskit
QuantumCircuit
is the only immediate representation we are relying on, we can really streamline the output routines and move them to a dedicated module (no moreutils
🙃). That module should, for the beginning, definitely contain routines for exporting to QASM2, QASM3, and Qiskit's QPY, which should be easy enough to support out of the box. In the future, I would imagine this to be extended by plugins, e.g., fortket
,catalyst
,cuda-q
,mqt-core-ir
, etc. The whole point is to decouple the generation logic from the output generation logic. - Once TKET is removed, there is no need anymore to use a
qiskit_helpers
file. The code can be reorganized to simply rely on qiskit instead of calling out to the helpers. - Given how it is completely unrealistic to "generate all benchmarks" the respective methods can, in my opinion, be removed from the benchmark_generator. That removes another bunch of code.
- MQT Bench currently does not use PEP 735 dependency groups. Inspiration for how to add these may come from MQT QECC, which recently switched to a pure-python package and has the most modern setup in that regard (see Remove C++ part of package. cda-tum/mqt-qecc#390)
- MQT Bench still uses setuptools as a build backend. There are better and more modern alternatives that also break less often. The concrete proposal here would be to switch to hatchling as a build backend. This is also covered in Remove C++ part of package. cda-tum/mqt-qecc#390
- As part of the move to the new GitHub organization, we are updating the branding of the repositories and modernizing the documentation in that regard. A demo PR for this is here: 📝 Branding and config update core#896 as well as the MQT Core main branch in general.
- Over in MQT Core, we now also adopted a CHANGELOG and and UPGRADE_GUIDE document to more clearly communicate changes to people. I believe this would be really good to have here as well: ✨📝 Add changelog and upgrade guide infrastructure core#909
That should cover it for now. I'm pretty sure I missed a couple of aspects, but tackling the above is already a great step forward.
Signed-off-by: burgholzer <[email protected]>
I also just pushed one more commit to this PR that raises the miminum required Qiskit version. This seems to be the first version that fixed the errors observed in the previous CI run. Once CI is green, this should be good to go in. |
e55d456
into
munich-quantum-toolkit:main
Extracted from #429:
8. adds a qasm3 export function (resolves #389)
12. adds a algorithm level benchmark generation function for qiskit that only supports qasm3