| Crates.io | qoqo |
| lib.rs | qoqo |
| version | 1.21.0 |
| created_at | 2021-06-30 12:34:54.660681+00 |
| updated_at | 2025-08-06 11:04:22.641952+00 |
| description | Quantum computing circuit toolkit. Python interface of roqoqo |
| homepage | https://github.com/HQSquantumsimulations/qoqo |
| repository | https://github.com/HQSquantumsimulations/qoqo |
| max_upload_size | |
| id | 416822 |
| size | 3,354,634 |
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:
What qoqo is not:
If you are looking for a comprehensive package that integrates all these features, we invite you to explore our HQStage software.
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 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
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.
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)
qoqo provides the following functionalities and features:
Circuit class to represent quantum circuitsQuantumProgram class to represent quantum programsPlease refer to the API documentation for technical details on qoqo functions.
This project has been partly supported by PlanQK and is partially supported by QSolid and PhoQuant.
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.
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},
}