Skip to main content

Facilitate quantum algorithm development and execution, regardless of the hardware, with MPQP

Project description

license badge test status badge doc status badge pipy deployment status badge release badge github stars badge python versions badge

[alt:mpqp logo]

The MPQP library

MPQP stands for Multi-Platform Quantum Programming. It is a python library we at Colibri felt the need for but couldn't find a solution. We are working on quantum algorithms, but until now, there was no good solution to study quantum algorithms across devices, compares the devices, etc...

MPQP is thus the solution we bring to the community to tackle this problem.

[alt:mpqp examples]

On this page, you will find:

  1. how to install the library;
  2. how to start using it;
  3. and the current active contributors.

Install

For now, we support python versions 3.10 to 3.13, and every major OS (Windows, Linux and MacOS). We are dependant on the SDKs we support to enable various python versions and OS support, for instance, MPQP was validated on Ubuntu LTS 20.04, while Ubuntu 18.04 is not supported because myQLM does not support it.

The preferred installation method is with the pipy repo. In order to use this installation method, simply run

pip install mpqp

You can also clone this repo and install from source, for instance if you need to modify something. In that case, we advise you to have a look at our contribution guide.

Usage

To get started with MPQP, you can create a quantum circuit with a few gates, and run it against the backend of your choice:

from mpqp.core import QCircuit
from mpqp.gates import *
from mpqp.execution import run, IBMDevice
circ = QCircuit([H(0), H(1), Rx(0,0), CNOT(1,2), Y(2)])
print(circ)
#      ┌───┐┌───────┐
# q_0: ┤ H ├┤ Rx(0) ├─────
#      ├───┤└───────┘
# q_1: ┤ H ├────■─────────
#      └───┘  ┌─┴─┐  ┌───┐
# q_2: ───────┤ X ├──┤ Y ├
#             └───┘  └───┘
print(run(circ, IBMDevice.AER_SIMULATOR_STATEVECTOR))
# Result: IBMDevice, AER_SIMULATOR_STATEVECTOR
#   State vector: [0, 0.5j, -0.5j, 0, 0, 0.5j, -0.5j, 0]
#   Probabilities: [0, 0.25, 0.25, 0, 0, 0.25, 0.25, 0]
#   Number of qubits: 3

More details are available in our documentation.

Contributors


Henri de Boutray

Hamza Jaffali

Muhammad Attallah

JulienCalisto

Mathieu Gras

Thomas Benzino

Ahmed Bejaoui

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

mpqp-0.6.0.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

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

mpqp-0.6.0-py3-none-any.whl (260.3 kB view details)

Uploaded Python 3

File details

Details for the file mpqp-0.6.0.tar.gz.

File metadata

  • Download URL: mpqp-0.6.0.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for mpqp-0.6.0.tar.gz
Algorithm Hash digest
SHA256 f6e37a3ad188d82b6c6a3ac085272eea88e1c4f77f6b12ea1f80eae39843968f
MD5 23b573e1174971d5c5ed896bb3100e42
BLAKE2b-256 bb0e44825c56e5b1a2958f492003a8a9036f8b391ba3cb512225dcf43015078b

See more details on using hashes here.

File details

Details for the file mpqp-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: mpqp-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 260.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for mpqp-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b2bd8dabb5628f9abdf24e3978469e10beb1d6706b4af487fb677c6ce3ecad01
MD5 2e3687b7f525628b4b51f838312c1893
BLAKE2b-256 27d0ba0dd387cad7e546cc98e0284ba7818cbdcf693d9021ed3f620abb37c305

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