14 releases (5 breaking)

Uses new Rust 2021

new 0.9.0 Nov 24, 2021
0.8.0 Oct 29, 2021
0.5.1 Jul 29, 2021

#329 in Science

Download history 3/week @ 2021-08-09 68/week @ 2021-08-16 2/week @ 2021-08-23 16/week @ 2021-08-30 18/week @ 2021-09-06 49/week @ 2021-09-13 3/week @ 2021-09-20 24/week @ 2021-09-27 6/week @ 2021-10-04 17/week @ 2021-10-11 2/week @ 2021-10-18 379/week @ 2021-10-25 62/week @ 2021-11-01 155/week @ 2021-11-08 76/week @ 2021-11-15 226/week @ 2021-11-22

269 downloads per month
Used in 3 crates (via qoqo)

Apache-2.0

31KB
520 lines

qoqo logo

qoqo

Quantum Operation Quantum Operation
Yes we use reduplication

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

This repository contains two components:

  • roqoqo: the core rust library
  • qoqo: the python interface to roqoqo

What roqoqo/qoqo is:

  • A toolkit to represent quantum operations and circuits
  • 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_pyqest, 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

roqoqo

Crates.io GitHub Workflow Status docs.rs Crates.io codecov

roqoqo provides:

  • A circuit struct to represent quantum programs
  • Single-Qubit, Two-Qubit and Multi-Qubit Operations that can be executed (decomposed) on any universal quantum computer
  • PRAGMA Operations that only apply to certain hardware, simulators or annotate circuits with additional information
  • Classical Registers and Measurement operations to use with a quantum program
  • Measurement structs for evaluating observable measurements based on projective measurements from quantum hardware or simulator readouts
  • A Backend trait defining a standard for interfacing from qoqo to other toolkits, hardware and simulators that can return measured values
  • Serialize and deserialize support for circuits and measurement information via the serde crate.

This software is still in the beta stage. Functions and documentation are not yet complete and breaking changes can occur.

Installation

To use roqoqo in a Rust project simply add

roqoqo = {version="0.8"}

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

qoqo

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

qoqo provides a full python interface to the underlying roqoqo library, including:

  • A circuit class to represent quantum programs
  • Single-Qubit, Two-Qubit and Multi-Qubit Operations that can be executed (decomposed) on any universal quantum computer
  • PRAGMA Operations that only apply to certain hardware, simulators or annotate circuits with additional information
  • Classical Register and Measurement operations to use with a quantum program
  • Measurement structs for evaluating observable measurements based on projective measurements from quantum hardware or simulator readouts
  • A DoUnitary class combining circuits and measurement information in complete quantum programms with a simple interface
  • 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.

Installation

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

pip install qoqo

For other platforms we recommend checking out the latest tagged version from github and using the maturin tool to build a python package for qoqo locally and install it via pip. Please note that the package should be built from the top level directory of the workspace selecting the qoqo package with the -m qoqo/Cargo.toml option. Specifically for macOS on Apple Silicon the following build command should be used.

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

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

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

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

Examples

For an expanded collection of Examples see the jupyter notebooks in qoqo/examples. The examples require the qoqo_pyquest and qoqo_mock interfaces.

Contributing

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

Dependencies

~290–710KB
~18K SLoC

(za