Skip to main content

No project description provided

Project description

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

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

Uploaded CPython 3.13Windows x86-64

qoqo-1.22.0-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.0-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.0-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.0-cp312-cp312-win_amd64.whl (4.4 MB view details)

Uploaded CPython 3.12Windows x86-64

qoqo-1.22.0-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.0-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.0-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.0-cp311-cp311-win_amd64.whl (4.5 MB view details)

Uploaded CPython 3.11Windows x86-64

qoqo-1.22.0-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.0-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.0-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.0-cp310-cp310-win_amd64.whl (4.5 MB view details)

Uploaded CPython 3.10Windows x86-64

qoqo-1.22.0-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.0-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.0-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.0.tar.gz.

File metadata

  • Download URL: qoqo-1.22.0.tar.gz
  • Upload date:
  • Size: 454.9 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.0.tar.gz
Algorithm Hash digest
SHA256 52ed9560490d8adf574e32e5d39856b2e4a516110e7013c6f449c876c59d1ede
MD5 e1a650840b590a851e9e077d88e7ca13
BLAKE2b-256 7c4864b96b3375af75896b20e0482fcd2e02bb9f6fb05b624f1e175321504e3e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qoqo-1.22.0-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.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 f6c7d4ed9b6fe50d5aaecdc8a896e48be1dbed960e8e990174fd454f9125ee31
MD5 2cb80ba2ddb4510a40c76c94e820a5e3
BLAKE2b-256 2212e27fd317dd1d877169143a766fb225c9684fe605b8295c28566b5bb9ada5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qoqo-1.22.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 706242e1ba6a82173368da0a922e7be8ac9e54dd86b340115bdc8b83a257acba
MD5 9e3a222310f6ebc3882cb28d843c9bab
BLAKE2b-256 0c5040cb37b6e9f4cd8c3df37e0a5fc330f725a8a537905d71d813dbeefcd01f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qoqo-1.22.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 33c57f7ee482c3d2ddba9062e9bb17de0e8f5fc859ff527df10e27a33da303c3
MD5 b363eb8ecf9c7496a21693991d88bc88
BLAKE2b-256 885c319b25eee71efa3ac2df0b376238d51017e044cce923b7adc03fff2b3706

See more details on using hashes here.

File details

Details for the file qoqo-1.22.0-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.0-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 f0f500701924b423c84d14cd6c2e12e602457db3980a02c95d18e79d4db91978
MD5 1cb42bd0e813ae9cd05d1d48e4727e93
BLAKE2b-256 222fbd405d938c3fccb40d645fe38208372ca3c86c780ddd0cad4b83d144e39b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qoqo-1.22.0-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.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6e54e50cd7f1b8edd685e779b6632c8e2c835fd595f04069d3384d2a24b59d77
MD5 cc1cad9883e528984ba1cf557210eb7f
BLAKE2b-256 350331be7a29a54fb2e5768202ab0fb289e55629ebd22f6c1920f535d1b76f12

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qoqo-1.22.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bcd497d4dff714fe4bf369adda6b898f042933b1b2f1b65525fb84a01f3f4183
MD5 b25ac990b2e50b96bb5d170fc7a9ad41
BLAKE2b-256 5f01d7561af1e93c9db480bc0adcf7c1307e26ac2f08dc299a8e5191290b2b1b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qoqo-1.22.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 60898505f316026bc6de9c5aa4e031876b1c15cc616f7b7d20c2ca91363782d0
MD5 fb94608c9e6498a438b0432c3cea6622
BLAKE2b-256 4b965e687a41b06d7c7d51f42dc33e618129b404fe949eddba00458c9e3143a0

See more details on using hashes here.

File details

Details for the file qoqo-1.22.0-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.0-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 271312629556c5121e3f549fac98ca9d283861834281f4025228e025935305d9
MD5 4e9ee5c5f505281ddd8a066656cdb21a
BLAKE2b-256 8ff9c819b314568d717a875d944948e540294153efef88b162d556f7142f3a43

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qoqo-1.22.0-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.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 1e624ff39a467a662be30504476904ce948211d90afc4138e1188605d3d5fc5a
MD5 eb7bf7f5dc146af459883b49c60a0b85
BLAKE2b-256 1985c35d308266b651fdafa6f34229fe719f9d0f0588d555cde55c6dc5aca69c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qoqo-1.22.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d4fb8608177e82c77644115c161a8247de8e80ea62a5863d1a3f5f94c6f43120
MD5 3e68910c1eda399b0f474746a6f9e529
BLAKE2b-256 ade9e3b9a4265e7d95778a0df552d1f0298ab748739b43fea46c744f4978d54b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qoqo-1.22.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 abd417736a19f791bd6d88ef601b5f08bdf5eeb854ab04b4f9ceb795136b1218
MD5 5caa52b55da3eb03f3950a8a7820b267
BLAKE2b-256 bbfbfe891aff4c9cfb8b9fcaf10dd8d09bd1a6086323881af6c42e5d0e14b9f4

See more details on using hashes here.

File details

Details for the file qoqo-1.22.0-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.0-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 500e2ea1d6f78e135d33622a6699bd90b880078591f1a3a4e765895727983c9a
MD5 30aa28996efaa09179e6162acc049c9c
BLAKE2b-256 8fe3c75bdb9a5c559016d26c6fcbc8ebdd098134fbf27158497a528f9dffbca4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qoqo-1.22.0-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.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 f66c5b4946aa058bf83ceed9a42af072d56423a7f9329163654ca4676ce3f689
MD5 90a0d1024b3d2684c7aa5c6d2f6f69f0
BLAKE2b-256 1dd06f1f20019971abbba7b3d23aa44ccd4e4128070ef81eed8bfd2389729a83

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qoqo-1.22.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9fcdc2b0643c2b9bd1feb919519f01d0590f9c827961ac54db0b19bc3f14ea52
MD5 47dc8b8057edfad1430adf610552d09d
BLAKE2b-256 91571480f225dfd5691c24c73c9292dc2e39d12a90536bdd6186a1b7ee576825

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qoqo-1.22.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4d46d8c20f84e0b2dd1ae1a4e7809c12d5ce9310b526d25d064673a527eb4a2f
MD5 f6ce4b213c8a97609ac62b345499e74e
BLAKE2b-256 365667843ae7bdcd331929730e53ac7a6ab656918c0727b9d88f27566cbff906

See more details on using hashes here.

File details

Details for the file qoqo-1.22.0-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.0-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 340ebaca504d50c6e7190cd9de2675887fc1fae186c198dd338a1dca43e9ee2f
MD5 07bc1fd63907f49d33ff26f1d1c25ead
BLAKE2b-256 8f39d67c1e80687e9482fc583cafd08660612920cf9a742e088cf3a828384c26

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