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 github stars 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.9 to 3.11, 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 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.j  0.+0.5j 0.-0.5j 0.+0.j  0.-0.j  0.+0.5j 0.-0.5j 0.+0.j ]
#  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

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.5.0.tar.gz (1.4 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.5.0-py3-none-any.whl (248.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mpqp-0.5.0.tar.gz
Algorithm Hash digest
SHA256 1ec65c54f435064133b2d568bc932090d59199d2b4265f9408250ce9b99a9d6e
MD5 1e234b893f5863012067b709693e3044
BLAKE2b-256 9bf9cfac54f45f2833bdb6c5e38a1cf45a95b281e28dd5a60c40b864ef35b0be

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for mpqp-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9ecc17fce98b932757d1cc930ac5285f4c1d6d256f1d9af510c9f725c3e5d769
MD5 2471e6954c95defceb8def9326041239
BLAKE2b-256 f8d8f3c0c5a50dc560f45970531a290d41252791c88d30b6b6c5cb48c649cf19

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