| Crates.io | qoqo-macros |
| lib.rs | qoqo-macros |
| version | 1.21.0 |
| created_at | 2021-06-30 12:34:23.18946+00 |
| updated_at | 2025-08-06 11:02:10.852239+00 |
| description | Macros for the qoqo crate |
| homepage | |
| repository | |
| max_upload_size | |
| id | 416820 |
| size | 100,974 |
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, qoqo_iqm).
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.
This repository contains two components:
qoqo: the python interface to roqoqo, described here.
roqoqo: the core rust library. Further details are provided in the individual README file here.
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 as described here.
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 programsThis 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},
}