Skip to main content

qoqo

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

qoqo is a toolkit to represent quantum circuits by HQS Quantum Simulations. The name “qoqo” stands for “Quantum Operation Quantum Operation,” making use of reduplication.

For a detailed introduction see the user documentation and the qoqo examples repository. Additionally, the API documentation is available.

What qoqo is:

  • A toolkit to represent quantum programs including circuits and measurement information.
  • 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_qiskit, qoqo_for_braket).

What qoqo is not:

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

If you are looking for a comprehensive package that integrates all these features, we invite you to explore our HQStage software.

Installation

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

pip install qoqo

Installing from source (optional)

If no pre-built python wheel is available for your architecture, you can install qoqo from the source distribution using a rust toolchain (for example available via rustup) and maturin (also available via pip). After installing the rust toolchain and maturing run the same pip install command as above. In some cases on macOS it can be necessary to provide specific linker arguments as shown below:

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

Using in a rust project

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

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

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

Create your first circuit in qoqo

The following code snippet can be used to create your first circuit in qoqo. For an expanded collection of examples please see the jupyter notebooks in the qoqo_examples repository.

from qoqo import Circuit
from qoqo import operations as ops
from qoqo_quest import Backend

circuit = Circuit()
circuit += ops.DefinitionBit(name="classical_reg", length=2, is_output=True)
circuit += ops.PauliX(qubit=0)
circuit += ops.CNOT(0,1)
circuit += ops.PragmaDamping(qubit=0, gate_time=0.1, rate=0.1)
circuit += ops.PragmaDamping(qubit=1, gate_time=0.1, rate=0.1)
circuit += ops.MeasureQubit(qubit=0, readout="classical_reg", readout_index=0)
circuit += ops.MeasureQubit(qubit=1, readout="classical_reg", readout_index=1)
circuit += ops.PragmaSetNumberOfMeasurements(number_measurements=1000, readout="classical_reg")

backend = Backend(number_qubits=2)
bit_registers, float_registers, complex_registers = backend.run_circuit(circuit)

Features

qoqo provides the following functionalities and features:

  • A Circuit class to represent quantum circuits
  • A QuantumProgram class to represent quantum programs
  • Classes representing single-qubit, two-qubit, multi-qubit and measurement operations that can be executed (decomposed) on any universal quantum computer
  • Classes representing so-called PRAGMA operations that only apply to certain hardware, simulators or annotate circuits with additional information
  • Support for symbolic variables
  • Readout based on classical registers
  • Measurement classes for evaluating observable measurements based on raw readout date returned by quantum computer backends
  • 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.

Please refer to the API documentation for technical details on qoqo functions.

Support

This project has been partly supported by PlanQK and is partially supported by QSolid and PhoQuant.

Contribution

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

In order to facilitate the contribution of the addition of a new gate, please also have a look at add_new_gate.md to read a quick explanation of the main steps necessary.

Citation

If you use qoqo, please cite it by including the URL of this github repository, or using the provided BibTeX entry:

@misc{qoqo2021,
      title={qoqo - toolkit to represent quantum circuits},
      author={HQS Quantum Simulations GmbH},
      year={2021},
      url={https://github.com/HQSquantumsimulations/qoqo},
}

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.22.2.tar.gz (444.2 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.22.2-cp313-cp313-win_amd64.whl (4.4 MB view details)

Uploaded CPython 3.13Windows x86-64

qoqo-1.22.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

qoqo-1.22.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

qoqo-1.22.2-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (7.7 MB view details)

Uploaded CPython 3.13macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

qoqo-1.22.2-cp312-cp312-win_amd64.whl (4.4 MB view details)

Uploaded CPython 3.12Windows x86-64

qoqo-1.22.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

qoqo-1.22.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

qoqo-1.22.2-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (7.7 MB view details)

Uploaded CPython 3.12macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

qoqo-1.22.2-cp311-cp311-win_amd64.whl (4.5 MB view details)

Uploaded CPython 3.11Windows x86-64

qoqo-1.22.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

qoqo-1.22.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

qoqo-1.22.2-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (7.5 MB view details)

Uploaded CPython 3.11macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

qoqo-1.22.2-cp310-cp310-win_amd64.whl (4.5 MB view details)

Uploaded CPython 3.10Windows x86-64

qoqo-1.22.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

qoqo-1.22.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

qoqo-1.22.2-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (7.5 MB view details)

Uploaded CPython 3.10macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

Details for the file qoqo-1.22.2.tar.gz.

File metadata

  • Download URL: qoqo-1.22.2.tar.gz
  • Upload date:
  • Size: 444.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for qoqo-1.22.2.tar.gz
Algorithm Hash digest
SHA256 03bf21c6d2c8ec0326b5489a858a7b2fe71dc64e04963193e1ea4e3cb9bbc168
MD5 76c2f8e689b0bc6d35b79a6928da9b06
BLAKE2b-256 d898d37fce4d3156d052a72ca3ac81a0c913861452dfeb0d9cf884daa6197b08

See more details on using hashes here.

File details

Details for the file qoqo-1.22.2-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: qoqo-1.22.2-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 4.4 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for qoqo-1.22.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 5ff33d3bf20414cece9e8a31b2bde453755a155395e599322c3002128cf8e7b9
MD5 d3cc4637f35a7d6cca3f7b3effa36429
BLAKE2b-256 ea8a5b529c6129c008548cd024ad55a8b7fa8ef2cf754ef01ea642adfbfcfea5

See more details on using hashes here.

File details

Details for the file qoqo-1.22.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for qoqo-1.22.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 407e0e287805d2814b304b9e8161bf4a650d627d5c2af70bcbb66cab3e6682b3
MD5 8b0c743ada9242d53d41e2e759155687
BLAKE2b-256 f2f0487354aa2d3bbd99eb7bc4ae6ea154574d5df2ab1a01433c57cff385113a

See more details on using hashes here.

File details

Details for the file qoqo-1.22.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for qoqo-1.22.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 63fcaea5cdf5c43dc852093f7e4dbbd34341cb33cbf69038e7ab23934969be02
MD5 d6452012e8b9cc554ef873ec74fb049d
BLAKE2b-256 a5c982b8471b78c6feebac5018c9eec61fbfcd4de26b4e9775d801f5ee9d0a42

See more details on using hashes here.

File details

Details for the file qoqo-1.22.2-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for qoqo-1.22.2-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 b09970f35816d0452336e69f99eb4311f212ff7234b5ef0c1a688634bd7460e3
MD5 49af161463214ca1b4c61be4ef3945c6
BLAKE2b-256 2636aed4b8ebfbedd33c769692aee9a3ac49489a072632c2bded03712d03737e

See more details on using hashes here.

File details

Details for the file qoqo-1.22.2-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: qoqo-1.22.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 4.4 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for qoqo-1.22.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c66672366b3d008679f82cd6f9693f678cb5714fd02b408ec4c6724aeb295d27
MD5 7b9aa1b99a83c072b665f611b50120cb
BLAKE2b-256 c7a895a07c1cb65809db2a0a3cb9adaf8a76a7c74d08468c7324dfdb61f48144

See more details on using hashes here.

File details

Details for the file qoqo-1.22.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for qoqo-1.22.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b19b41feaec6822b86e17f2e468ccd6db616d7c70f8371fc7199c693cfafffc3
MD5 55f5e859ebf15840d6dfb4fb07812d2b
BLAKE2b-256 e9d13760bde7d9ec5145d8f7380a32b38c7cf0489d88212391b750f91213e6d2

See more details on using hashes here.

File details

Details for the file qoqo-1.22.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for qoqo-1.22.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5ddd7f4e61f0e90d2b3e6d81de5f04fba17bb26df1c2fb15c1b0e1899a145732
MD5 c832bdacbd5227ff8aa0a8ac4bb84624
BLAKE2b-256 645238ac27ebfd7796d5c285e426aba2599526d0010ee4a98dd2db24ac13cb0f

See more details on using hashes here.

File details

Details for the file qoqo-1.22.2-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for qoqo-1.22.2-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 d1d948ed4bfb8f3b2192d9e9cc5769ca4d2e7a8e4141c43f32441d3e1a00bbcb
MD5 ec8f0f091fcaa562c7752770a60a6414
BLAKE2b-256 58d190f1f9ac0eef8369807e901b8de75880d845b30b0fe2c15d7c871e4e948c

See more details on using hashes here.

File details

Details for the file qoqo-1.22.2-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: qoqo-1.22.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 4.5 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for qoqo-1.22.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 46c17b0c4c6e85e8dfbef654e664517d7a75cd1a37b5b2164684b557467bac71
MD5 5389cd26a261069a90d2cf820d4689e1
BLAKE2b-256 cf072991b132f331c021e527565b89a3e49ae27f6468b78dd22bd9132de46531

See more details on using hashes here.

File details

Details for the file qoqo-1.22.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for qoqo-1.22.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 332276f59f93740dbdccc2bb836501608f6318cd88a64df3eeada5587b84efa7
MD5 51c6c08dbcd50835a8512ca3a12cc169
BLAKE2b-256 c08c4f7a90783e90da30b672172aea11623877d04cc5fbc6b261c916c17e6b31

See more details on using hashes here.

File details

Details for the file qoqo-1.22.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for qoqo-1.22.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9c8fd029ee25d78c008865f469be66525c5940927cbb97466f68a83a45943a0f
MD5 51e3e1cfe6f335c62ddd3b7d59f3a6c9
BLAKE2b-256 ca073054e4a1d5d828478241a1d9ae743e3801143c948d09c73fbb15847415f1

See more details on using hashes here.

File details

Details for the file qoqo-1.22.2-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for qoqo-1.22.2-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 f46dfe9477c83cef2b1fedb137337a3c11ad86f4ff8bd3bad3936cc5aba7c356
MD5 d1da3b5bf1ab99ece7795933c172085a
BLAKE2b-256 ea957e0ba2fc9ac4a371a6a68d426d1308ddb0543807a282c1289e944bc05a24

See more details on using hashes here.

File details

Details for the file qoqo-1.22.2-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: qoqo-1.22.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 4.5 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for qoqo-1.22.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 4e550c34fc395a5ba571c7e12db8ed5f97bdf23763442d0b39cb442f15c0d9b8
MD5 dd4e7c4dd5c0d898cc598fca96776ad3
BLAKE2b-256 638e946730d0bec8d836e6ea7abe850c66447c9e76c09754be787e4bac33a076

See more details on using hashes here.

File details

Details for the file qoqo-1.22.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for qoqo-1.22.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8c254808cd7714ff7a543ede1bc40f504ed2bf6f44c2765d7b9cabdc9fb0d794
MD5 c46b96a8f2674f8f6261e7f9cf2e9b24
BLAKE2b-256 a7d87b28c1ae2bc9e98a66b8f025f3564f4530e79b971ec6f779cc81ca068f97

See more details on using hashes here.

File details

Details for the file qoqo-1.22.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for qoqo-1.22.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0cc9353b11b5024b2818f9bd564106e2c7c0f690f077feb04161ef97f6cedfd3
MD5 47dba31c0f94ab4246f438b117496a64
BLAKE2b-256 144be23b7e8c66f751cd25bb0aff9c97174dfd5472cd97adacf8fd46f4aa984f

See more details on using hashes here.

File details

Details for the file qoqo-1.22.2-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for qoqo-1.22.2-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 7c9c2e7047bc5489508b791f5e2b28f7e88f0872d1ed3b2be58ce3bd81acc6b3
MD5 1be0b29767635eb0f7c62b9899760968
BLAKE2b-256 b1d7f62fb29888085b078c75f29062251676bd3201a1baca148f117d543b6cf4

See more details on using hashes here.

Release history Release notifications | RSS feed

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