Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/SUPPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

# Support

If you are stuck with a problem using MQT Predictor or have questions, please get
in touch at our [Issues] or [Discussions]. We'd love to help.
If you are stuck with a problem using MQT Predictor or have questions, please
get in touch at our [Issues] or [Discussions]. We'd love to help.

You can save time by following this procedure when reporting a problem:

Expand Down
12 changes: 11 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,19 @@ repos:
rev: v3.9.4
hooks:
- id: prettier
types_or: [yaml, markdown, html, css, scss, javascript, json, json5]
types_or: [yaml, html, css, scss, javascript, json, json5]
priority: 5

## Format Markdown files with rumdl
- repo: https://github.com/rvben/rumdl-pre-commit
rev: v0.2.28
hooks:
- id: rumdl
args: [--fix]
priority: 5
- id: rumdl-fmt
priority: 6

## Format and lint Python files with ruff
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.20
Expand Down
20 changes: 20 additions & 0 deletions .rumdl.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[per-file-ignores]
# The PR template is not a Markdown document in that sense
"**/pull_request_template.md" = ["MD013", "MD041"]
# The docs files may include HTML and do not need to start with a top-level heading
"docs/**" = ["MD033", "MD041"]
# The README may include HTML and does not need to start with a top-level heading
"README.md" = ["MD033", "MD041"]

[per-file-flavor]
"docs/**" = "myst"

[MD013]
line-length = 80
code-blocks = false
headings = false
reflow = true
reflow-mode = "normalize"

[MD060]
enabled = true
39 changes: 25 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,27 @@
All notable changes to this project will be documented in this file.

The format is based on a mixture of [Keep a Changelog] and [Common Changelog].
This project adheres to [Semantic Versioning], with the exception that minor releases may include breaking changes.
This project adheres to [Semantic Versioning], with the exception that minor
releases may include breaking changes.

## [Unreleased]

### Added

- ✨ Added CompilationTracer that collects detailed compilation information and exports it to a JSON file ([#714]) ([**@linus-hologram**])
- ✨ Added CompilationTracer that collects detailed compilation information and
exports it to a JSON file ([#714]) ([**@linus-hologram**])

### Changed

- ✨ Add RL truncation ([#697]) ([**@flowerthrower**])
- ♻️ Refactor RL passes into SDK-level action modules ([#680]) ([**@flowerthrower**])
- ♻️ Refactor RL passes into SDK-level action modules ([#680])
([**@flowerthrower**])
- 🎨 Improve the RL state machine logic ([#677]) ([**@flowerthrower**])
- 🐛 Support BQSKit conversion of IQM's native `r` gate ([#679]) ([**@flowerthrower**])
- 🐛 Support BQSKit conversion of IQM's native `r` gate ([#679])
([**@flowerthrower**])
- 🔧 Replace `mypy` with `ty` ([#572]) ([**@denialhaag**])
- 🐛 Fix instruction duration unit in estimated success probability calculation ([#445]) ([**@Shaobo-Zhou**])
- 🐛 Fix instruction duration unit in estimated success probability calculation
([#445]) ([**@Shaobo-Zhou**])
- ✨ Remove support for custom names of trained models ([#489]) ([**@bachase**])
- 🔥 Drop support for x86 macOS systems ([#421]) ([**@denialhaag**])

Expand All @@ -30,21 +35,29 @@ _If you are upgrading: please see [`UPGRADING.md`](UPGRADING.md#230)._

### Added

- 📝 Add docstrings for raised errors for all methods ([#405]) ([**@nquetschlich**])
- ✨ Add Estimated Hellinger Distance as a further Figure of Merit ([#360]) ([**@flowerthrower**])
- 📝 Add docstrings for raised errors for all methods ([#405])
([**@nquetschlich**])
- ✨ Add Estimated Hellinger Distance as a further Figure of Merit ([#360])
([**@flowerthrower**])

### Changed

- 🎨 Adjust the ESP reward calculation to become Qiskit v2 compatible ([#406]) ([**@nquetschlich**])
- 🎨 Adjust the ESP reward calculation to become Qiskit v2 compatible ([#406])
([**@nquetschlich**])
- ✨ Improve the ML part and its usability ([#403]) ([**@nquetschlich**])
- 📝 Migrate the documentation from .rst to .md files ([#403]) ([**@nquetschlich**])
- ✨ Improve RL action handling by using dataclasses ([#401]) ([**@nquetschlich**])
- ✨ Support MQT Bench v2 and use Qiskit's Target to represent quantum devices ([#393]) ([**@nquetschlich**])
- 📝 Migrate the documentation from .rst to .md files ([#403])
([**@nquetschlich**])
- ✨ Improve RL action handling by using dataclasses ([#401])
([**@nquetschlich**])
- ✨ Support MQT Bench v2 and use Qiskit's Target to represent quantum devices
([#393]) ([**@nquetschlich**])
- 🚚 Move to MQT organization ([#385]) ([**@flowerthrower**])

## [2.2.0] - 2025-02-02

_📚 Refer to the [GitHub Release Notes](https://github.com/munich-quantum-toolkit/predictor/releases) for previous changelogs._
_📚 Refer to the [GitHub Release
Notes](https://github.com/munich-quantum-toolkit/predictor/releases) for
previous changelogs._

<!-- Version links -->

Expand Down Expand Up @@ -73,7 +86,6 @@ _📚 Refer to the [GitHub Release Notes](https://github.com/munich-quantum-tool

<!-- Contributor -->

[**@burgholzer**]: https://github.com/burgholzer
[**@nquetschlich**]: https://github.com/nquetschlich
[**@flowerthrower**]: https://github.com/flowerthrower
[**@denialhaag**]: https://github.com/denialhaag
Expand All @@ -86,4 +98,3 @@ _📚 Refer to the [GitHub Release Notes](https://github.com/munich-quantum-tool
[Keep a Changelog]: https://keepachangelog.com/en/1.1.0/
[Common Changelog]: https://common-changelog.org
[Semantic Versioning]: https://semver.org/spec/v2.0.0.html
[GitHub Release Notes]: https://github.com/munich-quantum-toolkit/predictor/releases
96 changes: 68 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@

# MQT Predictor - Automatic Device Selection with Device-Specific Circuit Compilation for Quantum Computing

MQT Predictor is a framework that allows one to automatically select a suitable quantum device for a particular application and provides an optimized compiler for the selected device.
It is part of the [_Munich Quantum Toolkit (MQT)_](https://mqt.readthedocs.io).
MQT Predictor is a framework that allows one to automatically select a suitable
quantum device for a particular application and provides an optimized compiler
for the selected device. It is part of the
[_Munich Quantum Toolkit (MQT)_](https://mqt.readthedocs.io).

<p align="center">
<a href="https://mqt.readthedocs.io/projects/predictor">
Expand All @@ -28,29 +30,52 @@ It is part of the [_Munich Quantum Toolkit (MQT)_](https://mqt.readthedocs.io).

## Key Features

MQT Predictor supports end-users in navigating the vast landscape of choices by allowing them to mix-and-match compiler passes from various tools to create optimized compilers that transcend the individual tools.
Evaluations on more than 500 quantum circuits and seven devices have shown that—compared to Qiskit's and TKET's most optimized compilation flows—the MQT Predictor yields circuits with an expected fidelity that is on par with the best possible result that could be achieved by trying out all combinations of devices and compilers and even achieves a similar performance when considering the critical depth as an alternative figure of merit.
MQT Predictor supports end-users in navigating the vast landscape of choices by
allowing them to mix-and-match compiler passes from various tools to create
optimized compilers that transcend the individual tools. Evaluations on more
than 500 quantum circuits and seven devices have shown that—compared to Qiskit's
and TKET's most optimized compilation flows—the MQT Predictor yields circuits
with an expected fidelity that is on par with the best possible result that
could be achieved by trying out all combinations of devices and compilers and
even achieves a similar performance when considering the critical depth as an
alternative figure of merit.

Therefore, MQT Predictor tackles this problem from two angles:

1. It provides a method (based on Reinforcement Learning) that produces device-specific quantum circuit compilers by combining compilation passes from various compiler tools and learning optimized sequences of those passes with respect to a customizable figure of merit.
This mix-and-match of compiler passes from various tools allows one to eliminate vendor locks and to create optimized compilers that transcend the individual tools.
1. It provides a method (based on Reinforcement Learning) that produces
device-specific quantum circuit compilers by combining compilation passes
from various compiler tools and learning optimized sequences of those passes
with respect to a customizable figure of merit. This mix-and-match of
compiler passes from various tools allows one to eliminate vendor locks and
to create optimized compilers that transcend the individual tools.

2. It provides a prediction method (based on Supervised Machine Learning) that, without performing any compilation, automatically predicts the most suitable device for a given application.
This completely eliminates the manual and laborious task of determining a suitable target device and guides end-users through the vast landscape of choices without the need for quantum computing expertise.
2. It provides a prediction method (based on Supervised Machine Learning) that,
without performing any compilation, automatically predicts the most suitable
device for a given application. This completely eliminates the manual and
laborious task of determining a suitable target device and guides end-users
through the vast landscape of choices without the need for quantum computing
expertise.

<p align="center">
<picture>
<img src="docs/_static/problem.png" width="100%">
</picture>
</p>

If you have any questions, feel free to create a [discussion](https://github.com/munich-quantum-toolkit/predictor/discussions) or an [issue](https://github.com/munich-quantum-toolkit/predictor/issues) on [GitHub](https://github.com/munich-quantum-toolkit/predictor).
If you have any questions, feel free to create a
[discussion](https://github.com/munich-quantum-toolkit/predictor/discussions) or
an [issue](https://github.com/munich-quantum-toolkit/predictor/issues) on
[GitHub](https://github.com/munich-quantum-toolkit/predictor).

## Contributors and Supporters

The _[Munich Quantum Toolkit (MQT)](https://mqt.readthedocs.io)_ is developed by the [Chair for Design Automation](https://www.cda.cit.tum.de/) at the [Technical University of Munich](https://www.tum.de/) and supported by [MQSC](https://mq.sc).
Among others, it is part of the [Munich Quantum Software Stack (MQSS)](https://www.munich-quantum-valley.de/research/research-areas/mqss) ecosystem, which is being developed as part of the [Munich Quantum Valley (MQV)](https://www.munich-quantum-valley.de) initiative.
The _[Munich Quantum Toolkit (MQT)](https://mqt.readthedocs.io)_ is developed by
the [Chair for Design Automation](https://www.cda.cit.tum.de/) at the
[Technical University of Munich](https://www.tum.de/) and supported by
[MQSC](https://mq.sc). Among others, it is part of the
[Munich Quantum Software Stack (MQSS)](https://www.munich-quantum-valley.de/research/research-areas/mqss)
ecosystem, which is being developed as part of the
[Munich Quantum Valley (MQV)](https://www.munich-quantum-valley.de) initiative.

<p align="center">
<picture>
Expand All @@ -67,17 +92,21 @@ Thank you to all the contributors who have helped make MQT Predictor a reality!
</a>
</p>

The MQT will remain free, open-source, and permissively licensed—now and in the future.
We are firmly committed to keeping it open and actively maintained for the quantum computing community.
The MQT will remain free, open-source, and permissively licensed—now and in the
future. We are firmly committed to keeping it open and actively maintained for
the quantum computing community.

To support this endeavor, please consider:

- Starring and sharing our repositories: https://github.com/munich-quantum-toolkit
- Contributing code, documentation, tests, or examples via issues and pull requests
- Starring and sharing our repositories:
<https://github.com/munich-quantum-toolkit>
- Contributing code, documentation, tests, or examples via issues and pull
requests
- Citing the MQT in your publications (see [Cite This](#cite-this))
- Citing our research in your publications (see [References](https://mqt.readthedocs.io/projects/predictor/en/latest/references.html))
- Citing our research in your publications (see
[References](https://mqt.readthedocs.io/projects/predictor/en/latest/references.html))
- Using the MQT in research and teaching, and sharing feedback and use cases
- Sponsoring us on GitHub: https://github.com/sponsors/munich-quantum-toolkit
- Sponsoring us on GitHub: <https://github.com/sponsors/munich-quantum-toolkit>

<p align="center">
<a href="https://github.com/sponsors/munich-quantum-toolkit">
Expand All @@ -87,10 +116,11 @@ To support this endeavor, please consider:

## Getting Started

`mqt.predictor` is available via [PyPI](https://pypi.org/project/mqt.predictor/).
`mqt.predictor` is available via
[PyPI](https://pypi.org/project/mqt.predictor/).

```console
(.venv) $ pip install mqt.predictor
uv pip install mqt.predictor
```

The following code gives an example on the usage:
Expand All @@ -116,25 +146,30 @@ print(qc_compiled.draw())
```

> [!NOTE]
> To execute the code, respective machine learning models must be trained before.
> Up until mqt.predictor v2.0.0, pre-trained models were provided.
> However, this is not feasible anymore due to the increasing number of devices and figures of merits.
> Instead, we now provide a detailed documentation on how to train and setup the MQT Predictor framework.
> To execute the code, respective machine learning models must be trained
> before. Up until mqt.predictor v2.0.0, pre-trained models were provided.
> However, this is not feasible anymore due to the increasing number of devices
> and figures of merits. Instead, we now provide a detailed documentation on how
> to train and setup the MQT Predictor framework.

**Detailed documentation and examples are available at [ReadTheDocs](https://mqt.readthedocs.io/projects/predictor).**
**Detailed documentation and examples are available at
[ReadTheDocs](https://mqt.readthedocs.io/projects/predictor).**

## System Requirements

MQT Predictor can be installed on all major operating systems with all supported Python versions.
Building (and running) is continuously tested under Linux, macOS, and Windows using the [latest available system versions for GitHub Actions](https://github.com/actions/runner-images).
MQT Predictor can be installed on all major operating systems with all supported
Python versions. Building (and running) is continuously tested under Linux,
macOS, and Windows using the
[latest available system versions for GitHub Actions](https://github.com/actions/runner-images).

## Cite This

Please cite the work that best fits your use case.

### MQT Predictor (the tool)

When citing the software itself or results produced with it, cite the MQT Predictor paper:
When citing the software itself or results produced with it, cite the MQT
Predictor paper:

```bibtex
@article{quetschlich2025mqtpredictor,
Expand Down Expand Up @@ -170,7 +205,12 @@ When discussing the overall MQT project or its ecosystem, cite the MQT Handbook:

## Acknowledgements

The Munich Quantum Toolkit has been supported by the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation program (grant agreement No. 101001318), the Bavarian State Ministry for Science and Arts through the Distinguished Professorship Program, as well as the Munich Quantum Valley, which is supported by the Bavarian state government with funds from the Hightech Agenda Bayern Plus.
The Munich Quantum Toolkit has been supported by the European Research Council
(ERC) under the European Union's Horizon 2020 research and innovation program
(grant agreement No. 101001318), the Bavarian State Ministry for Science and
Arts through the Distinguished Professorship Program, as well as the Munich
Quantum Valley, which is supported by the Bavarian state government with funds
from the Hightech Agenda Bayern Plus.

<p align="center">
<picture>
Expand Down
34 changes: 21 additions & 13 deletions UPGRADING.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,38 @@
# Upgrade Guide

This document describes breaking changes and how to upgrade. For a complete list of changes including minor and patch releases, please refer to the [changelog](CHANGELOG.md).
This document describes breaking changes and how to upgrade. For a complete list
of changes including minor and patch releases, please refer to the
[changelog](CHANGELOG.md).

## [Unreleased]

### End of support for x86 macOS systems

Starting with this release, MQT Predictor no longer supports x86 macOS systems.
This step is necessary to ensure compatibility with PyTorch.
x86 macOS systems are no longer tested in our CI.
This step is necessary to ensure compatibility with PyTorch. x86 macOS systems
are no longer tested in our CI.

## [2.3.0] - 2025-07-29
## [2.3.0]

In this release, we have migrated to using Qiskit's `Target` class to represent quantum devices.
This change allows for better compatibility with the latest MQT Bench version and improves the overall usability of the library.
Beyond that, we also support Qiskit v2 now.
In this release, we have migrated to using Qiskit's `Target` class to represent
quantum devices. This change allows for better compatibility with the latest MQT
Bench version and improves the overall usability of the library. Beyond that, we
also support Qiskit v2 now.

Furthermore, both the ML and RL parts of MQT Predictor have been refactored to enhance their functionality and usability:
The ML setup has been simplified and streamlined, making it easier to use and integrate into your workflows.
The RL action handling has been updated to utilize dataclasses, which improves the structure and clarity of the code, making it easier to understand and maintain.
Furthermore, both the ML and RL parts of MQT Predictor have been refactored to
enhance their functionality and usability: The ML setup has been simplified and
streamlined, making it easier to use and integrate into your workflows. The RL
action handling has been updated to utilize dataclasses, which improves the
structure and clarity of the code, making it easier to understand and maintain.

### General

MQT Predictor has moved to the [munich-quantum-toolkit](https://github.com/munich-quantum-toolkit) GitHub organization under https://github.com/munich-quantum-toolkit/predictor.
While most links should be automatically redirected, please update any links in your code to point to the new location.
All links in the documentation have been updated accordingly.
MQT Predictor has moved to the
[munich-quantum-toolkit](https://github.com/munich-quantum-toolkit) GitHub
organization under <https://github.com/munich-quantum-toolkit/predictor>. While
most links should be automatically redirected, please update any links in your
code to point to the new location. All links in the documentation have been
updated accordingly.

<!-- Version links -->

Expand Down
Loading
Loading