Skip to main content

Qrisp - A high level language for gate-based quantum computing

Project description


License PyPI - Version Discord Pytest Downloads CodeFactor

Paper Forks Open Issues Stars Contributors

About

Qrisp is a high-level quantum programming framework that allows for intuitive development of quantum algorithms. It provides a rich set of tools and abstractions to make quantum computing more accessible to developers and researchers. By automating many steps one usually encounters when programming a quantum computer, introducing quantum types, and many more features Qrisp makes quantum programming more user-friendly yet stays performant when it comes to compiling programs to the circuit level.

Features

  • Intuitive quantum program design
  • High-level quantum programming
  • Efficient quantum algorithm implementation
  • Extensive documentation and examples

Installation

You can install Qrisp using pip:

pip install qrisp

Qrisp has been confirmed to work with Python version 3.11 & 3.12.

Qrisp is compatible with any QASM-capable quantum backend! In particular, it offers convenient interfaces for using IBM, IQM and AQT quantum computers, and any quantum backend provider is invited to reach out for a tight integration!

If you want to work with IQM quantum computers as a backend, you need to install additional dependencies using

pip install qrisp[iqm]

Documentation

The full documentation, alongside with many tutorials and examples, is available under Qrisp Documentation.

Shor's Algorithm with Qrisp

Shor's algorithm is among the most famous quantum algorithm since it provides a provably exponential speed-up for a practically relevant problem: Facotrizing integers. This is an important application because much of modern cryptography is based on RSA, which heavily relies on integer factorization being insurmountable.

Despite this importance, the amount of software that is actually able to compile the algorithm to the circuit level is extremely limited. This is because a key operation within the algorithm (modular in-place multiplication) is difficult to implement and has strong requirements for the underlying compiler. These problems highlight how the Qrisp programming-model delivers significant advantages to quantum programmers because the quantum part of the algorithm can be expressend within a few lines of code:

from qrisp import QuantumFloat, QuantumModulus, h, QFT, control

def find_order(a, N):
    qg = QuantumModulus(N)
    qg[:] = 1
    qpe_res = QuantumFloat(2*qg.size + 1, exponent = -(2*qg.size + 1))
    h(qpe_res)
    for i in range(len(qpe_res)):
        with control(qpe_res[i]):
            qg *= a
            a = (a*a)%N
    QFT(qpe_res, inv = True)
    return qpe_res.get_measurement()

To find out how this can be used to break encryption be sure to check the tutorial.

Qrisp offers much more than just factoring! More examples, like simulating molecules at the quantum level or how to solve the Travelling Salesman Problem, can be found here.

Authors and Citation

Qrisp is the work of many people.

If you have comments, questions or love letters, feel free to reach out to us:

raphael.seidel [at] meetiqm.com

sebastian.bock [at] fokus.fraunhofer.de

nikolay.tcholtchev [at] fokus.fraunhofer.de

rene.zander [at] fokus.fraunhofer.de

matic.petric [at] fokus.fraunhofer.de

If you want to cite Qrisp in your work, please use:

@misc{seidel2024qrisp,
      title={Qrisp: A Framework for Compilable High-Level Programming of Gate-Based Quantum Computers}, 
      author={Raphael Seidel and Sebastian Bock and René Zander and Matic Petrič and Niklas Steinmann and Nikolay Tcholtchev and Manfred Hauswirth},
      year={2024},
      eprint={2406.14792},
      archivePrefix={arXiv},
      primaryClass={quant-ph},
      url={https://arxiv.org/abs/2406.14792}, 
}

License

Eclipse Public License 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qrisp-0.8.2.tar.gz (716.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qrisp-0.8.2-py3-none-any.whl (968.9 kB view details)

Uploaded Python 3

File details

Details for the file qrisp-0.8.2.tar.gz.

File metadata

  • Download URL: qrisp-0.8.2.tar.gz
  • Upload date:
  • Size: 716.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.10

File hashes

Hashes for qrisp-0.8.2.tar.gz
Algorithm Hash digest
SHA256 c12a5e6cde4ba1a6bf8ade9ac13bce701eced4a5c98b7c9ce1b2be3406026af8
MD5 aff14407a360706b978628968f9e6f24
BLAKE2b-256 3ec4719c4ebcf7e22f9012a218def250c2c857413cc962b3befe9c7aa07eaec0

See more details on using hashes here.

File details

Details for the file qrisp-0.8.2-py3-none-any.whl.

File metadata

  • Download URL: qrisp-0.8.2-py3-none-any.whl
  • Upload date:
  • Size: 968.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.10

File hashes

Hashes for qrisp-0.8.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d66c9e7586a641a071b7e481e06d71749980aafa7734603d4d86055c7246dad5
MD5 35d6a6dd148f67af87682b3388669113
BLAKE2b-256 8eea81cd2bf0d7128237542f34cdba2cac404dcbc26ec07840e878577b147233

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page