mqt.predictor


Namemqt.predictor JSON
Version 2.1.1 PyPI version JSON
download
home_pageNone
SummaryMQT Predictor - A MQT tool for Determining Good Quantum Circuit Compilation Options
upload_time2024-10-23 08:17:08
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseMIT License Copyright (c) 2022 Nils Quetschlich, Lukas Burgholzer, and Robert Wille Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords mqt quantum computing compilation machine learning prediction
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![PyPI](https://img.shields.io/pypi/v/mqt.predictor?logo=pypi&style=flat-square)](https://pypi.org/project/mqt.predictor/)
![OS](https://img.shields.io/badge/os-linux%20%7C%20macos%20%7C%20windows-blue?style=flat-square)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://opensource.org/licenses/MIT)
[![CI](https://img.shields.io/github/actions/workflow/status/cda-tum/mqt-predictor/ci.yml?branch=main&style=flat-square&logo=github&label=ci)](https://github.com/cda-tum/mqt-predictor/actions/workflows/ci.yml)
[![CD](https://img.shields.io/github/actions/workflow/status/cda-tum/mqt-predictor/cd.yml?style=flat-square&logo=github&label=cd)](https://github.com/cda-tum/mqt-predictor/actions/workflows/cd.yml)
[![Documentation](https://img.shields.io/readthedocs/mqt-predictor?logo=readthedocs&style=flat-square)](https://mqt.readthedocs.io/projects/predictor)
[![codecov](https://img.shields.io/codecov/c/github/cda-tum/mqt-predictor?style=flat-square&logo=codecov)](https://codecov.io/gh/cda-tum/mqt-predictor)

<p align="center">
  <a href="https://mqt.readthedocs.io">
   <picture>
     <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/cda-tum/mqt/main/docs/_static/mqt_light.png" width="60%">
     <img src="https://raw.githubusercontent.com/cda-tum/mqt/main/docs/_static/mqt_dark.png" width="60%">
   </picture>
  </a>
</p>

# 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 not only supports end-users in navigating the vast landscape of choices, it also allows 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.

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>

For more details, please refer to:

<p align="center">
  <a href="https://mqt.readthedocs.io/projects/predictor">
  <img width=30% src="https://img.shields.io/badge/documentation-blue?style=for-the-badge&logo=read%20the%20docs" alt="Documentation" />
  </a>
</p>

MQT Predictor is part of the [Munich Quantum Toolkit (MQT)](https://mqt.readthedocs.io/) developed by the [Chair for Design Automation](https://www.cda.cit.tum.de/) at the [Technical University of Munich](https://www.tum.de/).

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

## Getting Started

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

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

The following code gives an example on the usage:

```python3
from mqt.predictor import qcompile
from mqt.bench import get_benchmark

# get a benchmark circuit on algorithmic level representing the GHZ state with 5 qubits from [MQT Bench](https://github.com/cda-tum/mqt-bench)
qc_uncompiled = get_benchmark(benchmark_name="ghz", level="alg", circuit_size=5)

# compile it using the MQT Predictor
qc_compiled, compilation_information, quantum_device = qcompile(qc_uncompiled)

# print the selected device and the compilation information
print(quantum_device, compilation_information)

# draw the compiled circuit
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.\*\*

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

## References

In case you are using MQT Predictor in your work, we would be thankful if you referred to it by citing the following publication:

```bibtex
@ARTICLE{quetschlich2024mqtpredictor,
    AUTHOR      = {N. Quetschlich and L. Burgholzer and R. Wille},
    TITLE       = {{MQT Predictor: Automatic Device Selection with Device-Specific Circuit Compilation for Quantum Computing}},
    YEAR        = {2024},
    JOURNAL     = {ACM Transactions on Quantum Computing (TQC)},
    DOI         = {10.1145/3673241},
    EPRINT      = {2310.06889},
    EPRINTTYPE  = {arxiv},
}
```

## Acknowledgements

This project received funding from the European Research Council (ERC) under the European Union's Horizon 2020 research
and innovation program (grant agreement No. 101001318), was part of the Munich Quantum Valley, which is supported by the
Bavarian state government with funds from the Hightech Agenda Bayern Plus, and has been supported by the BMWK on the
basis of a decision by the German Bundestag through project QuaST, as well as by the BMK, BMDW, the State of Upper
Austria in the frame of the COMET program, and the QuantumReady project within Quantum Austria (managed by the FFG).

<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/cda-tum/mqt/main/docs/_static/tum_dark.svg" width="28%">
<img src="https://raw.githubusercontent.com/cda-tum/mqt/main/docs/_static/tum_light.svg" width="28%" alt="TUM Logo">
</picture>
<picture>
<img src="https://raw.githubusercontent.com/cda-tum/mqt/main/docs/_static/logo-bavaria.svg" width="16%" alt="Coat of Arms of Bavaria">
</picture>
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/cda-tum/mqt/main/docs/_static/erc_dark.svg" width="24%">
<img src="https://raw.githubusercontent.com/cda-tum/mqt/main/docs/_static/erc_light.svg" width="24%" alt="ERC Logo">
</picture>
<picture>
<img src="https://raw.githubusercontent.com/cda-tum/mqt/main/docs/_static/logo-mqv.svg" width="28%" alt="MQV Logo">
</picture>
</p>

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "mqt.predictor",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "MQT, quantum computing, compilation, machine learning, prediction",
    "author": null,
    "author_email": "Nils Quetschlich <nils.quetschlich@tum.de>, Lukas Burgholzer <lukas.burgholzer@tum.de>",
    "download_url": "https://files.pythonhosted.org/packages/08/1a/6f76117cfa087ff62d1ca021e9c91aa7830283a5dd13eed1a60a30e2f2f8/mqt_predictor-2.1.1.tar.gz",
    "platform": null,
    "description": "[![PyPI](https://img.shields.io/pypi/v/mqt.predictor?logo=pypi&style=flat-square)](https://pypi.org/project/mqt.predictor/)\n![OS](https://img.shields.io/badge/os-linux%20%7C%20macos%20%7C%20windows-blue?style=flat-square)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://opensource.org/licenses/MIT)\n[![CI](https://img.shields.io/github/actions/workflow/status/cda-tum/mqt-predictor/ci.yml?branch=main&style=flat-square&logo=github&label=ci)](https://github.com/cda-tum/mqt-predictor/actions/workflows/ci.yml)\n[![CD](https://img.shields.io/github/actions/workflow/status/cda-tum/mqt-predictor/cd.yml?style=flat-square&logo=github&label=cd)](https://github.com/cda-tum/mqt-predictor/actions/workflows/cd.yml)\n[![Documentation](https://img.shields.io/readthedocs/mqt-predictor?logo=readthedocs&style=flat-square)](https://mqt.readthedocs.io/projects/predictor)\n[![codecov](https://img.shields.io/codecov/c/github/cda-tum/mqt-predictor?style=flat-square&logo=codecov)](https://codecov.io/gh/cda-tum/mqt-predictor)\n\n<p align=\"center\">\n  <a href=\"https://mqt.readthedocs.io\">\n   <picture>\n     <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/cda-tum/mqt/main/docs/_static/mqt_light.png\" width=\"60%\">\n     <img src=\"https://raw.githubusercontent.com/cda-tum/mqt/main/docs/_static/mqt_dark.png\" width=\"60%\">\n   </picture>\n  </a>\n</p>\n\n# MQT Predictor: Automatic Device Selection with Device-Specific Circuit Compilation for Quantum Computing\n\nMQT 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.\nIt not only supports end-users in navigating the vast landscape of choices, it also allows to mix-and-match compiler passes from various tools to create optimized compilers that transcend the individual tools.\nEvaluations on more than 500 quantum circuits and seven devices have shown that\u2014compared to Qiskit's and TKET's most optimized compilation flows\u2014the 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.\n\nTherefore, MQT Predictor tackles this problem from two angles:\n\n1. 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.\n\n2. 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.\n\n<p align=\"center\">\n<picture>\n  <img src=\"docs/_static/problem.png\" width=\"100%\">\n</picture>\n</p>\n\nFor more details, please refer to:\n\n<p align=\"center\">\n  <a href=\"https://mqt.readthedocs.io/projects/predictor\">\n  <img width=30% src=\"https://img.shields.io/badge/documentation-blue?style=for-the-badge&logo=read%20the%20docs\" alt=\"Documentation\" />\n  </a>\n</p>\n\nMQT Predictor is part of the [Munich Quantum Toolkit (MQT)](https://mqt.readthedocs.io/) developed by the [Chair for Design Automation](https://www.cda.cit.tum.de/) at the [Technical University of Munich](https://www.tum.de/).\n\nIf you have any questions, feel free to create a [discussion](https://github.com/cda-tum/mqt-predictor/discussions) or an [issue](https://github.com/cda-tum/mqt-predictor/issues) on [GitHub](https://github.com/cda-tum/mqt-predictor).\n\n## Getting Started\n\n`mqt-predictor` is available via [PyPI](https://pypi.org/project/mqt.predictor/).\n\n```console\n(venv) $ pip install mqt.predictor\n```\n\nThe following code gives an example on the usage:\n\n```python3\nfrom mqt.predictor import qcompile\nfrom mqt.bench import get_benchmark\n\n# get a benchmark circuit on algorithmic level representing the GHZ state with 5 qubits from [MQT Bench](https://github.com/cda-tum/mqt-bench)\nqc_uncompiled = get_benchmark(benchmark_name=\"ghz\", level=\"alg\", circuit_size=5)\n\n# compile it using the MQT Predictor\nqc_compiled, compilation_information, quantum_device = qcompile(qc_uncompiled)\n\n# print the selected device and the compilation information\nprint(quantum_device, compilation_information)\n\n# draw the compiled circuit\nprint(qc_compiled.draw())\n```\n\n> [!NOTE]\n> To execute the code, respective machine learning models must be trained before.\n> Up until mqt.predictor v2.0.0, pre-trained models were provided. However, this is not feasible anymore due to the\n> increasing number of devices and figures of merits. Instead, we now provide a detailed documentation on how to train\n> and setup the MQT Predictor framework.\\*\\*\n\n**Further documentation and examples are available at [ReadTheDocs](https://mqt.readthedocs.io/projects/predictor).**\n\n## References\n\nIn case you are using MQT Predictor in your work, we would be thankful if you referred to it by citing the following publication:\n\n```bibtex\n@ARTICLE{quetschlich2024mqtpredictor,\n    AUTHOR      = {N. Quetschlich and L. Burgholzer and R. Wille},\n    TITLE       = {{MQT Predictor: Automatic Device Selection with Device-Specific Circuit Compilation for Quantum Computing}},\n    YEAR        = {2024},\n    JOURNAL     = {ACM Transactions on Quantum Computing (TQC)},\n    DOI         = {10.1145/3673241},\n    EPRINT      = {2310.06889},\n    EPRINTTYPE  = {arxiv},\n}\n```\n\n## Acknowledgements\n\nThis project received funding from the European Research Council (ERC) under the European Union's Horizon 2020 research\nand innovation program (grant agreement No. 101001318), was part of the Munich Quantum Valley, which is supported by the\nBavarian state government with funds from the Hightech Agenda Bayern Plus, and has been supported by the BMWK on the\nbasis of a decision by the German Bundestag through project QuaST, as well as by the BMK, BMDW, the State of Upper\nAustria in the frame of the COMET program, and the QuantumReady project within Quantum Austria (managed by the FFG).\n\n<p align=\"center\">\n<picture>\n<source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/cda-tum/mqt/main/docs/_static/tum_dark.svg\" width=\"28%\">\n<img src=\"https://raw.githubusercontent.com/cda-tum/mqt/main/docs/_static/tum_light.svg\" width=\"28%\" alt=\"TUM Logo\">\n</picture>\n<picture>\n<img src=\"https://raw.githubusercontent.com/cda-tum/mqt/main/docs/_static/logo-bavaria.svg\" width=\"16%\" alt=\"Coat of Arms of Bavaria\">\n</picture>\n<picture>\n<source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/cda-tum/mqt/main/docs/_static/erc_dark.svg\" width=\"24%\">\n<img src=\"https://raw.githubusercontent.com/cda-tum/mqt/main/docs/_static/erc_light.svg\" width=\"24%\" alt=\"ERC Logo\">\n</picture>\n<picture>\n<img src=\"https://raw.githubusercontent.com/cda-tum/mqt/main/docs/_static/logo-mqv.svg\" width=\"28%\" alt=\"MQV Logo\">\n</picture>\n</p>\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2022 Nils Quetschlich, Lukas Burgholzer, and Robert Wille  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "MQT Predictor - A MQT tool for Determining Good Quantum Circuit Compilation Options",
    "version": "2.1.1",
    "project_urls": {
        "Discussions": "https://github.com/cda-tum/mqt-predictor/discussions",
        "Homepage": "https://github.com/cda-tum/mqt-predictor",
        "Issues": "https://github.com/cda-tum/mqt-predictor/issues",
        "Research": "https://www.cda.cit.tum.de/research/quantum/"
    },
    "split_keywords": [
        "mqt",
        " quantum computing",
        " compilation",
        " machine learning",
        " prediction"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e007612d3f88fb35d9ffa03fd8e60c2e7e095c6558a3d494a9b16ed98c3c8518",
                "md5": "a574f6b22ebe26aa978082c624ad9595",
                "sha256": "2544d7a332da7d71d505e22847de8010e805d553b9486f92ceb54bef057a3430"
            },
            "downloads": -1,
            "filename": "mqt.predictor-2.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a574f6b22ebe26aa978082c624ad9595",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 1885287,
            "upload_time": "2024-10-23T08:17:06",
            "upload_time_iso_8601": "2024-10-23T08:17:06.722493Z",
            "url": "https://files.pythonhosted.org/packages/e0/07/612d3f88fb35d9ffa03fd8e60c2e7e095c6558a3d494a9b16ed98c3c8518/mqt.predictor-2.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "081a6f76117cfa087ff62d1ca021e9c91aa7830283a5dd13eed1a60a30e2f2f8",
                "md5": "283b9331eb1f8a31ca64df1670d7366c",
                "sha256": "7ae2fb4e424355c404f9e78d5ae41ec74221b6f4f3479ef12b455d8be5169398"
            },
            "downloads": -1,
            "filename": "mqt_predictor-2.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "283b9331eb1f8a31ca64df1670d7366c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 3193560,
            "upload_time": "2024-10-23T08:17:08",
            "upload_time_iso_8601": "2024-10-23T08:17:08.905889Z",
            "url": "https://files.pythonhosted.org/packages/08/1a/6f76117cfa087ff62d1ca021e9c91aa7830283a5dd13eed1a60a30e2f2f8/mqt_predictor-2.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-23 08:17:08",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cda-tum",
    "github_project": "mqt-predictor",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "mqt.predictor"
}
        
Elapsed time: 0.31919s