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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.10Windows x86-64

qoqo-1.22.1-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.1-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.1-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.1.tar.gz.

File metadata

  • Download URL: qoqo-1.22.1.tar.gz
  • Upload date:
  • Size: 455.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.1.tar.gz
Algorithm Hash digest
SHA256 b4c89f16e4f7e9e877e243e1037b5843c02968ec896ddf630f81beb64eeef62b
MD5 7810e7a96b7413d36a636f27040e048b
BLAKE2b-256 f247ef7e86373b96a32b73b7e67310bfc7a146f06c0e3a9369d992278b3c1bbe

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qoqo-1.22.1-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.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 3fb2d5503fb7d4ac5675b13fc5d59e3ce8655d166d22c6bca56909c8e7db60ad
MD5 95aeaeda277174d3643c08f43d0bc738
BLAKE2b-256 41052f55e564bb60654f625b79f4d0383b95fb24f7d7c775f337293f2771fac9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qoqo-1.22.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 61dfada9ef1ca97338ad5e1c44e9928e031ab1c2bbbc26c37913de4f7ccf27e0
MD5 76586bf314a346a87428a65f7208427e
BLAKE2b-256 73a9bab6911b6c09cd675288f91e730b6a0f3751ebedddb421b9aea732522ff4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qoqo-1.22.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 32bbcf236a68bb72f33d23221c9d2aa2df6dc10d5f6e4b003601bf23ba0f199f
MD5 ab1f9b0d70026da42d2ec00d89a7bb11
BLAKE2b-256 d48f176180dd060377177534847196b7ad0d13a89f51cea8f96250ccf73c336f

See more details on using hashes here.

File details

Details for the file qoqo-1.22.1-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.1-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 9bc21314da2d1a87468b750106857c5734a85590a3cc649a2975a99997d61510
MD5 0a9cf673e9004210c0efc44201766b30
BLAKE2b-256 f8ddf60873518449fda5536d2bf2a4f84c2ff8033d1ec283fec85c1638320962

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qoqo-1.22.1-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.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5b0d586bcbad5fd6c0ec3b182fc037f7e40bc6e52d5f9afd819ca4ff90ea0098
MD5 24631cbedf3067d1dc75b5a7ce3a4393
BLAKE2b-256 f86fa96ba77874eab22fee6314d0b31453449080e8b7fd49e98ce6134c62aa47

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qoqo-1.22.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 61eedd420c84d99c7f6d9077f3cdd91db06556597da8d99c30fcd469d5eb3388
MD5 9272af2bf9155ae489e7418832ab3145
BLAKE2b-256 cbf8da8b750d003ed2912ceec90846bf9ccb1143263747bfcb02da01103a25cb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qoqo-1.22.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 638abe9ed7551f3cceae80399e3819c5ae878da6f1c24293dc98f96fdf8eef0d
MD5 77cf5a0f9f10d5c124e300b628fac1ba
BLAKE2b-256 3763281e075d5ef0d828e5b6e050790f43bf8533c4b52ddef184e408f3aa897c

See more details on using hashes here.

File details

Details for the file qoqo-1.22.1-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.1-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 ce8524740fa5b1a2ba533968c7dcd626537924831b9c2326891dca8040b6ce72
MD5 fef0d0df5b0ecd509093fe41b846e219
BLAKE2b-256 0e0f667020eed92b741ec02aba82127a5872af1c0a4d9023792bb2cde4d8f7eb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qoqo-1.22.1-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.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 5a7740c1db3cae6e3d2e3adddd2660cd3d11c23ca3ba49ef28dd3b7b4d160b12
MD5 a337b9e21141491e43f0ce075d364acb
BLAKE2b-256 dcf8a9c4460bce5e2e3b27942c39744db3680eb9be3214df537f6db247c42f45

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qoqo-1.22.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4f0ec935c6d278fafe44e0d3ea020740b12786ae9a44c854114215330e048f4e
MD5 c22f0f2f967b52c2b11509938b2092cb
BLAKE2b-256 e6c74baf8824bde63974e36b3d882a2e4ea5ae03de29b4240f4d147f993a02b2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qoqo-1.22.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8096af317786a6fe70e455b9cd4f334d52b5f054ae6ab78e7a30a91eaef4e026
MD5 c609930281db896852cf9034e378d476
BLAKE2b-256 43f5bf25c7a5ed3eab9e80a981b2c1d5dc239584f473e6b9d637c6a5690e09c6

See more details on using hashes here.

File details

Details for the file qoqo-1.22.1-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.1-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 6a53ee428e490de31b0851594ac430182a82e61777581e337ca435b1fa39d5e0
MD5 2237ab7fae2011fe7e8b288831181f78
BLAKE2b-256 7e36686e103e7877b3b636470374490269dcdc5ffdc2bea62c8befa5a6a79aad

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qoqo-1.22.1-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.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 4153e6a48f7147ada23ba983e4ccc7457e84fd5a6696e796d9205f82ace7cbab
MD5 59e8512f9a289d5dc0205c198194d6cf
BLAKE2b-256 2213bc3c32f871c7a34be0300027cca7c11f9826e9a1cd6ff1b9926c03474cfd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qoqo-1.22.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 36dd1e13a9568e871ed61ef423fbdaf8ac4f79c666d9ad2313755f59e039d5bf
MD5 63d46286f2f0d71bda33008ed62ab70b
BLAKE2b-256 fece3c5f7ac0b3a1e6fd0fd766ea71a2036d496ddc6506e2f11eacf8018d4eac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qoqo-1.22.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 27fcbe34512fc940fb8cf6716cf14340d29c96cecacf6fb669ae2e54b2dac455
MD5 b9634be2f0c618532ebf51223509c190
BLAKE2b-256 cec7e1e4cc1a9847c4c3b7399ff197ee62470789b5e7e955861a569a669cea3e

See more details on using hashes here.

File details

Details for the file qoqo-1.22.1-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.1-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 ab75473d3f3d1f4babf21f7b6a85ab0b8c2a50f61931ac1058ca58136e19fccf
MD5 6be4d0a08298392d1692ee9e96dfc072
BLAKE2b-256 3fedd2b204c62cd382f92f71065afc4ccaf294b4ac79d4c8435ce3df8c3dd1b9

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