Skip to main content

Quantum computing circuit toolkit. Python interface of roqoqo

Project description

qoqo logo

qoqo

Quantum Operation Quantum Operation
Yes we use reduplication

qoqo is a toolkit to represent quantum circuits by HQS Quantum Simulations.

This repository contains two components:

  • roqoqo: the core rust library
  • qoqo: the python interface to roqoqo

What roqoqo/qoqo is:

  • A toolkit to represent quantum operations and circuits
  • A thin runtime to run quantum measurements
  • A way to serialize quantum circuits and measurement information
  • A set of optional interfaces to devices, simulators and toolkits (e.g. qoqo_quest, qoqo_mock, qoqo_qasm)

What roqoqo/qoqo is not:

  • A decomposer translating circuits to a specific set of gates
  • A quantum circuit optimizer
  • A collection of quantum algorithms

roqoqo

Crates.io GitHub Workflow Status docs.rs Crates.io codecov

roqoqo provides:

  • A circuit struct to represent quantum programs
  • Single-Qubit, Two-Qubit and Multi-Qubit Operations that can be executed (decomposed) on any universal quantum computer
  • PRAGMA Operations that only apply to certain hardware, simulators or annotate circuits with additional information
  • Classical Registers and Measurement operations to use with a quantum program
  • Measurement structs for evaluating observable measurements based on projective measurements from quantum hardware or simulator readouts
  • A Backend trait defining a standard for interfacing from qoqo to other toolkits, hardware and simulators that can return measured values
  • Serialize and deserialize support for circuits and measurement information via the serde crate.

Installation

To use roqoqo in a Rust project simply add

roqoqo = {version="0.8"}

to the [dependencies] section of the project Cargo.toml.

qoqo

Documentation Status GitHub Workflow Status PyPI PyPI - Format Crates.io Crates.io

qoqo provides a full python interface to the underlying roqoqo library, including:

  • A circuit class to represent quantum programs
  • Single-Qubit, Two-Qubit and Multi-Qubit Operations that can be executed (decomposed) on any universal quantum computer
  • PRAGMA Operations that only apply to certain hardware, simulators or annotate circuits with additional information
  • Classical Register and Measurement operations to use with a quantum program
  • Measurement structs for evaluating observable measurements based on projective measurements from quantum hardware or simulator readouts
  • A QuantumProgram class combining circuits and measurement information in complete quantum programms with a simple interface
  • Serialization to json and deserialization from json for circuits and measurement information. Serialization support can easily be expanded to other targets with the help of the serde crate.

Installation

On Linux and macOS on x86 precompiled packages can be found on PyPi and installed via

pip install qoqo

For other platforms we recommend using the source distribution from PyPi to build a python package for qoqo locally via pip. The install requires the maturin tool (also available via pip) and a working rust toolchain. Specifically for macOS on Apple Silicon the following build command should be used:

RUSTFLAGS="-C link-arg=-undefined -C link-arg=dynamic_lookup" pip install qoqo

Alternatively one can check out the latest tagged version from github and use the maturin tool to build a python package for qoqo locally and install it via pip. Please note that the package should be built from the top level directory of the workspace selecting the qoqo package with the -m qoqo/Cargo.toml option. Specifically for macOS on Apple Silicon the following build command should be used.

RUSTFLAGS="-C link-arg=-undefined -C link-arg=dynamic_lookup" maturin build -m qoqo/Cargo.toml  --release
pip install target/wheels/$NAME_OF_WHEEL

When using qoqo in a rust project providing a python interface add

qoqo = {version="0.9", default-features=false}

to the [dependencies] section of the project Cargo.toml.

A source distribution now exists but requires a Rust install with a rust version > 1.47 and a maturin version { >= 0.12, <0.13 } in order to be built.

Examples

Since qoqo provides a full python interface to the underlying roqoqo library, there are examples for python users and for Rust users.

For an expanded collection of examples please see the jupyter notebooks in the extra repository qoqo_examples. The qoqo examples require the qoqo_quest and qoqo_mock interfaces.

Contributing

We welcome contributions to the project. If you want to contribute code, please have a look at CONTRIBUTE.md for our code contribution guidelines.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

qoqo-1.0.0_alpha.2.tar.gz (159.8 kB view details)

Uploaded Source

Built Distributions

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

qoqo-1.0.0_alpha.2-cp310-none-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.10Windows x86-64

qoqo-1.0.0_alpha.2-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.12+ x86-64

qoqo-1.0.0_alpha.2-cp310-cp310-macosx_10_7_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.10macOS 10.7+ x86-64

qoqo-1.0.0_alpha.2-cp39-none-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.9Windows x86-64

qoqo-1.0.0_alpha.2-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.12+ x86-64

qoqo-1.0.0_alpha.2-cp39-cp39-macosx_10_7_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.9macOS 10.7+ x86-64

qoqo-1.0.0_alpha.2-cp38-none-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.8Windows x86-64

qoqo-1.0.0_alpha.2-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.12+ x86-64

qoqo-1.0.0_alpha.2-cp38-cp38-macosx_10_7_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.8macOS 10.7+ x86-64

qoqo-1.0.0_alpha.2-cp37-none-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.7Windows x86-64

qoqo-1.0.0_alpha.2-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.12+ x86-64

qoqo-1.0.0_alpha.2-cp37-cp37m-macosx_10_7_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.7mmacOS 10.7+ x86-64

File details

Details for the file qoqo-1.0.0_alpha.2.tar.gz.

File metadata

  • Download URL: qoqo-1.0.0_alpha.2.tar.gz
  • Upload date:
  • Size: 159.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for qoqo-1.0.0_alpha.2.tar.gz
Algorithm Hash digest
SHA256 94778145897bafb7b22d65fb3fb4101d4b76566a7a1f9d0fe81748e90e4fe3ea
MD5 8c47893414a47d9d719d943e6f3c0dc6
BLAKE2b-256 ca15bf888ce21adfa2396d94aa0da28bb33b688b5a940d95d6793826dedaaaf6

See more details on using hashes here.

File details

Details for the file qoqo-1.0.0_alpha.2-cp310-none-win_amd64.whl.

File metadata

File hashes

Hashes for qoqo-1.0.0_alpha.2-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 a0260c581b7a6a469c3fad692eea610407dbda129a7a8770f1c5bb634a9d52cb
MD5 04ed6fcc84bef6e8d667d17da3a505fa
BLAKE2b-256 4958dfa4717e1ebab62638e8fa2b5a78bfbff867d9b2890b45bb6ceb254427c1

See more details on using hashes here.

File details

Details for the file qoqo-1.0.0_alpha.2-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for qoqo-1.0.0_alpha.2-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 6d6314d5943a546038c3fa03b29952ddbca41a3d8ae046b97a32c7fe0baacca0
MD5 c5bfc0e9df93ca4480d8de1dde734e02
BLAKE2b-256 a74c821bee4a9e40b3628ebc546a2741c2be0640c6f1c3f4671d55a0507c6990

See more details on using hashes here.

File details

Details for the file qoqo-1.0.0_alpha.2-cp310-cp310-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for qoqo-1.0.0_alpha.2-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 dbe3e681cef8f600f0fac4514955a718c3748d0f371f76b9ea92ab3109cbb327
MD5 b8d3f45317d6043bc38740385a21459c
BLAKE2b-256 27a07b6b3eaf1ca8eede52de6177a75642f8c17294f5753bcd28fd6e46f3d59c

See more details on using hashes here.

File details

Details for the file qoqo-1.0.0_alpha.2-cp39-none-win_amd64.whl.

File metadata

  • Download URL: qoqo-1.0.0_alpha.2-cp39-none-win_amd64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for qoqo-1.0.0_alpha.2-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 85c971b8b67958b14285193ceac9caa9a340d36cf8a0b698b3ee4fda97c00b50
MD5 327d9f52e9e99e9a139c101e6b66226a
BLAKE2b-256 220a511187a78f6250e4dea2fe77e75b3abfaeb54c019cb6968456f49a1ab9cb

See more details on using hashes here.

File details

Details for the file qoqo-1.0.0_alpha.2-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for qoqo-1.0.0_alpha.2-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 bf130f8ae25b7bffa3ef54b7551e3f50e81dbb188ad349343f0f331e71a68928
MD5 9503bdbdf20f2d91ba323ba842005495
BLAKE2b-256 aa38cf2e5ab67ccff1747d95d4fa7649f5673cf1bed9965bc0be19815eb89ac4

See more details on using hashes here.

File details

Details for the file qoqo-1.0.0_alpha.2-cp39-cp39-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for qoqo-1.0.0_alpha.2-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 4943baf6fc99254e477a09a94410652c0dead4e0c521775b4661b4320cdda6fc
MD5 e4c26bcd9e8b2a899a7146d7f6323fd1
BLAKE2b-256 57bee5c5d496435bb41ba0fb3319d6bc404c7d0cde000fab03644f3a6d4ccb97

See more details on using hashes here.

File details

Details for the file qoqo-1.0.0_alpha.2-cp38-none-win_amd64.whl.

File metadata

  • Download URL: qoqo-1.0.0_alpha.2-cp38-none-win_amd64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for qoqo-1.0.0_alpha.2-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 950a8798a28cb52f86611f3f74821848bbd2dd7708960bb1290ce183e162fdcc
MD5 74385e88fb0a6265c15eca5df0c1b653
BLAKE2b-256 6fcb2414b6b0bd330e565249bedbb6631da8a1b2acf3f27c9db7f7b1af8e14a1

See more details on using hashes here.

File details

Details for the file qoqo-1.0.0_alpha.2-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for qoqo-1.0.0_alpha.2-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 2f5de3c473767e84f5dd953914d153f73cc8203e38f3c0151966db2233445fa4
MD5 f94946be6950d5210e9373e984d6436c
BLAKE2b-256 c71a9875ef1bfd52fd474a806822d5c87a2e3a8b26065e9a0a7f0c70f91358d0

See more details on using hashes here.

File details

Details for the file qoqo-1.0.0_alpha.2-cp38-cp38-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for qoqo-1.0.0_alpha.2-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 a89a0a355f2c81bfe82f0df0bd6ac341a72350323f17fdb3ba797fc4570a7f81
MD5 46cdda03aeea58d7a35a41111a9e8e72
BLAKE2b-256 3f4f3e41a6f53c7d5b20c6d090cfcdf75c563ec19037acd86376750956119cb4

See more details on using hashes here.

File details

Details for the file qoqo-1.0.0_alpha.2-cp37-none-win_amd64.whl.

File metadata

  • Download URL: qoqo-1.0.0_alpha.2-cp37-none-win_amd64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.7, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for qoqo-1.0.0_alpha.2-cp37-none-win_amd64.whl
Algorithm Hash digest
SHA256 0c91f1c48f1609036d212802f40a01338f491b052db06a5e372d5bc5cb672842
MD5 e074174f8bb927e09e70d01916dd7ab4
BLAKE2b-256 d13078831f859b9e4a9f5deb8d417eded62c8f31ebbad5c75bb27aea99c94f70

See more details on using hashes here.

File details

Details for the file qoqo-1.0.0_alpha.2-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for qoqo-1.0.0_alpha.2-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 80ca5c591d8c1c9d7b29d822e21311e2acc0528021cd8f58db9b1e5497766c9e
MD5 02af460e76a444b8c3c61bc0e31a9489
BLAKE2b-256 8914cbd8dd97957277424e68ca7c44e9197843b68cfdf6c3831a429543f8d994

See more details on using hashes here.

File details

Details for the file qoqo-1.0.0_alpha.2-cp37-cp37m-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for qoqo-1.0.0_alpha.2-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 9bfcd1088277bf9a4cec15e467527070811f30857b7615817265fc76d7c91733
MD5 590775da86a2601355b3cef248181013
BLAKE2b-256 dea6340ca5218050b0162b70c73a8077249af2fde2004033f62fc3576ae312c2

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