60 releases (23 stable)

1.10.0 Feb 12, 2024
1.8.0 Dec 8, 2023
1.8.0-alpha.2 Nov 28, 2023
1.6.0-alpha.1 Jul 20, 2023
0.5.1 Jul 29, 2021

#43 in Science

Download history 706/week @ 2023-10-31 367/week @ 2023-11-07 184/week @ 2023-11-14 299/week @ 2023-11-21 460/week @ 2023-11-28 518/week @ 2023-12-05 792/week @ 2023-12-12 227/week @ 2023-12-19 158/week @ 2023-12-26 312/week @ 2024-01-02 760/week @ 2024-01-09 509/week @ 2024-01-16 1078/week @ 2024-01-23 564/week @ 2024-01-30 654/week @ 2024-02-06 676/week @ 2024-02-13

3,066 downloads per month
Used in 7 crates

Apache-2.0

1MB
17K SLoC

qoqo

Quantum Operation Quantum Operation
Yes we use reduplication

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

For a detailed introduction see the user documentation and the qoqo examples repository

What roqoqo/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_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

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

qoqo provides the Python interface to the underlying roqoqo library, including:

  • 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.

This project is partly supported by PlanQK.

Installation

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

pip install qoqo

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 macOS
pip install qoqo

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.

Dependencies

~10–19MB
~271K SLoC