Skip to main content

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

Project description

Qrisp is an open-source python framework for high-level programming of Quantum computers. By automating many steps one usually encounters when progrmaming 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.

Documentation

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

Installing

The easiest way to install Qrisp is via pip

pip install qrisp

Qrisp has been confirmed to work with Python version 3.8, 3.9 & 3.10.

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

pip install qrisp[iqm]

First Quantum Program with Qrisp

The very first program you usually write, when learning a new programming language, is printing 'hello world'. We want to do the same, but in a quantum way.

For this we can make use of the QuantumString type implemented in Qrisp. So we start by creating a new variable of the type QuantumString and assign the value 'hello world':

from qrisp import QuantumString

q_str = QuantumString()
q_str[:] = "hello world"

print(q_str)

With the print(q_str) command, we automatically simulate the circuit generated when assigning hello world to q_str. And es expected we get hello world with a probility of 1 as output:

{'hello world': 1.0}

Now, let's make things more interesting: What happens, if we apply a Hadamard gate to the first qubit of the 7th character in our string?

from qrisp import h, QuantumString

q_str = QuantumString()
q_str[:] = "hello world"
h(q_str[6][0])

print(q_str)

Go on, install Qrisp and try it yourself!

Of course, Qrisp offers much more than just handling strings with a quantum computer. More examples, like how to solve a quadratic equation with Grover's algorithm or how to solve the Travelling Salesman Problem on a quantum computer, can be found here.

Authors and Citation

Qrisp was mainly devised and implemented by Raphael Seidel, supported by Sebastian Bock, Nikolay Tcholtchev, René Zander, Niklas Steinmann and Matic Petric.

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

raphael.seidel@fokus.fraunhofer.de

sebastian.bock@fokus.fraunhofer.de

nikolay.tcholtchev@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.5.0.tar.gz (437.1 kB view details)

Uploaded Source

Built Distribution

qrisp-0.5.0-py3-none-any.whl (552.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qrisp-0.5.0.tar.gz
  • Upload date:
  • Size: 437.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for qrisp-0.5.0.tar.gz
Algorithm Hash digest
SHA256 b50f0d6776db7947bc44119d9a82f1405a2f60c5d19a0e22e6b07b757a27e149
MD5 ce0302c8125cb566784555835811e3c9
BLAKE2b-256 d8be0abe7bbd25217f1565a675a925eaa22f0ca46ab8a373d2ac8d8565c52627

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qrisp-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 552.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for qrisp-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3e744b6dedcb9213b897f0cc342e1286e71ff2021e6f6f6d2b42bce8669e1579
MD5 78194937a49439d70bbcb1e95e9baba3
BLAKE2b-256 0ca916a076071e6e4e9ef5da142e9a6d6083fa23de24650fc191a4c2f5854159

See more details on using hashes here.

Supported by

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