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},
}

Metadata

Release files for qoqo 1.22.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qoqo 1.22.2
File Size Uploaded
qoqo-1.22.2.tar.gz 444.2 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for qoqo 1.22.2
File
qoqo-1.22.2-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
qoqo-1.22.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details
qoqo-1.22.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ ARM64 Details
qoqo-1.22.2-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl CPython 3.13 CPython 3.13 macOS 10.12+ universal2 (ARM64, x86-64), macOS 11.0+ ARM64, macOS 10.12+ x86-64 Details
qoqo-1.22.2-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
qoqo-1.22.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
qoqo-1.22.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ ARM64 Details
qoqo-1.22.2-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl CPython 3.12 CPython 3.12 macOS 10.12+ universal2 (ARM64, x86-64), macOS 11.0+ ARM64, macOS 10.12+ x86-64 Details
qoqo-1.22.2-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
qoqo-1.22.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
qoqo-1.22.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ ARM64 Details
qoqo-1.22.2-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl CPython 3.11 CPython 3.11 macOS 10.12+ universal2 (ARM64, x86-64), macOS 11.0+ ARM64, macOS 10.12+ x86-64 Details
qoqo-1.22.2-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
qoqo-1.22.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
qoqo-1.22.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ ARM64 Details
qoqo-1.22.2-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64, macOS 10.12+ x86-64, macOS 10.12+ universal2 (ARM64, x86-64) Details

Total release size: 79.7 MB

Release files / qoqo-1.22.2.tar.gz

Download URL qoqo-1.22.2.tar.gz
Size 444.2 kB
Tags Source
SHA-256 checksum
How to use checksums
03bf21c6d2c8ec0326b5489a858a7b2fe71dc64e04963193e1ea4e3cb9bbc168
BLAKE2b-256 checksum
How to use checksums
d898d37fce4d3156d052a72ca3ac81a0c913861452dfeb0d9cf884daa6197b08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.14

Release files / qoqo-1.22.2-cp313-cp313-win_amd64.whl

Download URL qoqo-1.22.2-cp313-cp313-win_amd64.whl
Size 4.4 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
5ff33d3bf20414cece9e8a31b2bde453755a155395e599322c3002128cf8e7b9
BLAKE2b-256 checksum
How to use checksums
ea8a5b529c6129c008548cd024ad55a8b7fa8ef2cf754ef01ea642adfbfcfea5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.14

Release files / qoqo-1.22.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL qoqo-1.22.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 4.1 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
407e0e287805d2814b304b9e8161bf4a650d627d5c2af70bcbb66cab3e6682b3
BLAKE2b-256 checksum
How to use checksums
f2f0487354aa2d3bbd99eb7bc4ae6ea154574d5df2ab1a01433c57cff385113a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.14

Release files / qoqo-1.22.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL qoqo-1.22.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 3.8 MB
Tags CPython 3.13 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
63fcaea5cdf5c43dc852093f7e4dbbd34341cb33cbf69038e7ab23934969be02
BLAKE2b-256 checksum
How to use checksums
a5c982b8471b78c6feebac5018c9eec61fbfcd4de26b4e9775d801f5ee9d0a42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.14

Release files / qoqo-1.22.2-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL qoqo-1.22.2-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 7.7 MB
Tags CPython 3.13 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
b09970f35816d0452336e69f99eb4311f212ff7234b5ef0c1a688634bd7460e3
BLAKE2b-256 checksum
How to use checksums
2636aed4b8ebfbedd33c769692aee9a3ac49489a072632c2bded03712d03737e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.14

Release files / qoqo-1.22.2-cp312-cp312-win_amd64.whl

Download URL qoqo-1.22.2-cp312-cp312-win_amd64.whl
Size 4.4 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
c66672366b3d008679f82cd6f9693f678cb5714fd02b408ec4c6724aeb295d27
BLAKE2b-256 checksum
How to use checksums
c7a895a07c1cb65809db2a0a3cb9adaf8a76a7c74d08468c7324dfdb61f48144
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.14

Release files / qoqo-1.22.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL qoqo-1.22.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 4.1 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
b19b41feaec6822b86e17f2e468ccd6db616d7c70f8371fc7199c693cfafffc3
BLAKE2b-256 checksum
How to use checksums
e9d13760bde7d9ec5145d8f7380a32b38c7cf0489d88212391b750f91213e6d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.14

Release files / qoqo-1.22.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL qoqo-1.22.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 3.8 MB
Tags CPython 3.12 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
5ddd7f4e61f0e90d2b3e6d81de5f04fba17bb26df1c2fb15c1b0e1899a145732
BLAKE2b-256 checksum
How to use checksums
645238ac27ebfd7796d5c285e426aba2599526d0010ee4a98dd2db24ac13cb0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.14

Release files / qoqo-1.22.2-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL qoqo-1.22.2-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 7.7 MB
Tags CPython 3.12 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
d1d948ed4bfb8f3b2192d9e9cc5769ca4d2e7a8e4141c43f32441d3e1a00bbcb
BLAKE2b-256 checksum
How to use checksums
58d190f1f9ac0eef8369807e901b8de75880d845b30b0fe2c15d7c871e4e948c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.14

Release files / qoqo-1.22.2-cp311-cp311-win_amd64.whl

Download URL qoqo-1.22.2-cp311-cp311-win_amd64.whl
Size 4.5 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
46c17b0c4c6e85e8dfbef654e664517d7a75cd1a37b5b2164684b557467bac71
BLAKE2b-256 checksum
How to use checksums
cf072991b132f331c021e527565b89a3e49ae27f6468b78dd22bd9132de46531
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.14

Release files / qoqo-1.22.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL qoqo-1.22.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 4.1 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
332276f59f93740dbdccc2bb836501608f6318cd88a64df3eeada5587b84efa7
BLAKE2b-256 checksum
How to use checksums
c08c4f7a90783e90da30b672172aea11623877d04cc5fbc6b261c916c17e6b31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.14

Release files / qoqo-1.22.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL qoqo-1.22.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 3.8 MB
Tags CPython 3.11 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
9c8fd029ee25d78c008865f469be66525c5940927cbb97466f68a83a45943a0f
BLAKE2b-256 checksum
How to use checksums
ca073054e4a1d5d828478241a1d9ae743e3801143c948d09c73fbb15847415f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.14

Release files / qoqo-1.22.2-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL qoqo-1.22.2-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 7.5 MB
Tags CPython 3.11 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f46dfe9477c83cef2b1fedb137337a3c11ad86f4ff8bd3bad3936cc5aba7c356
BLAKE2b-256 checksum
How to use checksums
ea957e0ba2fc9ac4a371a6a68d426d1308ddb0543807a282c1289e944bc05a24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.14

Release files / qoqo-1.22.2-cp310-cp310-win_amd64.whl

Download URL qoqo-1.22.2-cp310-cp310-win_amd64.whl
Size 4.5 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
4e550c34fc395a5ba571c7e12db8ed5f97bdf23763442d0b39cb442f15c0d9b8
BLAKE2b-256 checksum
How to use checksums
638e946730d0bec8d836e6ea7abe850c66447c9e76c09754be787e4bac33a076
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.14

Release files / qoqo-1.22.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL qoqo-1.22.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 4.1 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
8c254808cd7714ff7a543ede1bc40f504ed2bf6f44c2765d7b9cabdc9fb0d794
BLAKE2b-256 checksum
How to use checksums
a7d87b28c1ae2bc9e98a66b8f025f3564f4530e79b971ec6f779cc81ca068f97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.14

Release files / qoqo-1.22.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL qoqo-1.22.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 3.8 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
0cc9353b11b5024b2818f9bd564106e2c7c0f690f077feb04161ef97f6cedfd3
BLAKE2b-256 checksum
How to use checksums
144be23b7e8c66f751cd25bb0aff9c97174dfd5472cd97adacf8fd46f4aa984f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.14

Release files / qoqo-1.22.2-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL qoqo-1.22.2-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 7.5 MB
Tags CPython 3.10 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
7c9c2e7047bc5489508b791f5e2b28f7e88f0872d1ed3b2be58ce3bd81acc6b3
BLAKE2b-256 checksum
How to use checksums
b1d7f62fb29888085b078c75f29062251676bd3201a1baca148f117d543b6cf4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

1.22.2 This release

17 release files

1.9.2

37 release files

1.9.1

38 release files

1.7.1

36 release files

1.7.0

34 release files

1.6.2

34 release files

1.6.1

34 release files

1.6.0

34 release files

1.5.1

34 release files

1.5.0

34 release files

1.4.0

32 release files

1.2.5

30 release files

1.1.0

13 release files

1.0.0

13 release files

0.9.0

15 release files

0.8.2

12 release files

0.8.0

12 release files

0.7.0

4 release files

0.6.3

4 release files

0.6.2

10 release files

0.6.1

9 release files

0.6.0

9 release files

0.5.1

9 release files

0.5.0

9 release files

0.4.4

9 release files

0.4.0

9 release files

0.3.0

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page