Distributed quantum circuit cutting for HPC, with PyCOMPSs.
Documentation • Notebooks • Releases • Slack
Qdislib runs quantum circuits by cutting them into smaller subcircuits, running those independently, and reconstructing the result of the original circuit. It runs serially on a laptop or in parallel on HPC with PyCOMPSs, on simulators, GPUs and QPUs.
Use it to run a circuit too wide for your device or simulator, when a few cuts split it. Each cut multiplies the shots a given precision needs, so the number of cuts is what limits it.
What it does
- Three kinds of cut, in any mix (
circuit_cutting): measure-and-prepare gate cuts that follow the gate's angle, Hadamard gate cuts with no mid-circuit measurement, and wire cuts. - Expectation values and distributions. Pauli strings and Hamiltonians; output distributions, marginals with
qubits=, andFactoredDistributionover more than 24 qubits. - Finding cuts (
find_cut): for a size, by cost over all kinds of cut (mixed=True), or for a device's connectivity (coupling_map).cutting_overheadgives the cost of a cut before running it. - Shots and error bars.
error=,total_shots=,num_samples=andshots_for. - Any SDK. Circuits from Qiskit, Qibo, CUDA-Q, PennyLane and QiliSDK, run on any of them.
qd.BaseBackendadds your own in one method. - PyCOMPSs. Every fragment circuit is a task, including GPU tasks. Without PyCOMPSs it runs serially, with the same results.
- QPUs. IBM, IQM and BSC devices, and
qd.packto run many subcircuits in one job. - A cache of fragment results, across observables and runs.
Installation
Python 3.10 or later, and at least one quantum SDK, installed as an extra. With pip or uv, which installs the same package and is typically much faster:
pip install "qdislib[qiskit]" # or [qibo], [cudaq], [pennylane], [qilisdk]
uv pip install "qdislib[qiskit]" # in an environment
uv add "qdislib[qiskit]" # in a uv project
uv run --with "qdislib[qiskit]" app.py # one-off
A bare pip install qdislib has no SDK, so it can import Qdislib but cannot run a circuit. [all] is about 3.3 GB, mostly NVIDIA libraries for CUDA-Q, so most people do not want it.
To run in parallel, install PyCOMPSs 3.3 or later, which pip does not do for you. Without it Qdislib runs serially. See QUICKSTART.md for more, including a note on Linux arm64 and Windows.
A first cut
from qiskit import QuantumCircuit
import Qdislib as qd
circuit = QuantumCircuit(5)
for qubit, angle in enumerate([0.8, 0.5, 0.6, 0.4, 0.3]):
circuit.ry(angle, qubit)
for qubit in range(4):
circuit.cz(qubit, qubit + 1)
cut = qd.find_cut(circuit, max_qubits=3, wire_cut=False, seed=0)
print(cut) # ['CZ_7']
print(qd.cutting_overhead(circuit, cut))
# {'subcircuits': 12, 'configurations': 6, 'fragments': 2, 'gamma': 3.0}
value = qd.gate_cutting(circuit, cut, shots=8192, seed=1, error=True)
print(value) # 0.441427 ± 0.0082
print(qd.analytical_solution(circuit, "ZZZZZ")) # 0.4440, exact
To run the subcircuits yourself, on your own devices or with your own tools, split the call in three:
subcircuits = qd.gate_cutting_subcircuits(circuit, cut, "ZZZZZ") # 1. cut
values = [qd.expectation_value(s, shots=8192) for s in subcircuits] # 2. run: this loop is yours
print(subcircuits.reconstruct(values)) # 3. recombine
Run the same script with runcompss --pythonpath=$(pwd) my_app.py to run its circuits in parallel.
The notebooks go through all of it with results and figures, and open in Colab or Binder. To look around with nothing to install, try it in your browser.
Availability
These supercomputers have PyCOMPSs and Qdislib installed. For help configuring your own cluster, write to support-compss@bsc.es.
- MareNostrum 5, Barcelona Supercomputing Center (BSC): see the HPC guide
Citing Qdislib
If you use Qdislib in a scientific publication, we would appreciate citations to the following papers. Please cite the original paper (ACM, SC '25 Workshops) first:
M. Tejedor, B. Casas, J. Conejero, A. Cervera-Lierta and R. M. Badia, "Orchestrating Quantum-HPC Workflows with Distributed Quantum Circuit Cutting," in Proceedings of the SC '25 Workshops of the International Conference for High Performance Computing, Networking, Storage and Analysis, ACM, 2025, pp. 1898–1906. https://doi.org/10.1145/3731599.3767547
M. Tejedor, J. Conejero and R. M. Badia, "A Semantic Quantum Circuit Cache for Scalable and Distributed Quantum-Classical Workflows," arXiv:2604.26788, 2026. https://arxiv.org/abs/2604.26788
Bibtex:
@inproceedings{Qdislib,
title = {{Orchestrating Quantum-HPC Workflows with Distributed Quantum Circuit Cutting}},
author = {Mar Tejedor and Berta Casas and Javier Conejero and Alba Cervera-Lierta and Rosa M. Badia},
booktitle = {Proceedings of the SC '25 Workshops of the International Conference for High Performance Computing, Networking, Storage and Analysis},
publisher = {ACM},
pages = {1898--1906},
year = {2025},
doi = {10.1145/3731599.3767547},
}
@article{QdislibCache,
title = {{A Semantic Quantum Circuit Cache for Scalable and Distributed Quantum-Classical Workflows}},
author = {Mar Tejedor and Javier Conejero and Rosa M. Badia},
journal = {arXiv preprint arXiv:2604.26788},
year = {2026},
}
URLs
- Documentation
- Changelog
- Developed by the Workflows and Distributed Computing group of the Barcelona Supercomputing Center
Acknowledgements
The project acknowledges funding from the Spanish Ministry for Digital Transformation and of Civil Service of the Spanish Government through the QUANTUM ENIA project call - Quantum Spain, EU through the Recovery, Transformation and Resilience Plan – NextGenerationEU within the framework of the Digital Spain 2026. It acknowledges funding from Grant RYC2022-037769-I funded by MICIU/AEI/10.13039/501100011033 and by “ESF+”. It also acknowledges funding from projects CEX2021-001148-S, and PID2023-147979NB-C21 from the MCIN/AEI and MICIU/AEI /10.13039/501100011033 and by FEDER, UE, by the Departament de Recerca i Universitats de la Generalitat de Catalunya, research group MPiEDist (2021 SGR 00412).
License
Apache License Version 2.0, see LICENSE
Metadata
Release files for Qdislib 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| qdislib-2.0.0.tar.gz | 424.9 kB | Without provenance | Details for qdislib-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| qdislib-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for qdislib-2.0.0-py3-none-any.whl |
Total release size: 771.5 kB
Release files / qdislib-2.0.0.tar.gz
| Download URL | qdislib-2.0.0.tar.gz |
|---|---|
| Size | 424.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
79391c18e998eab64c5444ce0f04dc05c8b82cf40fa86fdfb46245bf1bdc3505
|
|
BLAKE2b-256 checksum How to use checksums |
5c69d8e1bb1e20b34219e1d9b1784971255a5955dbccfc4f4998fc42548815f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Release files / qdislib-2.0.0-py3-none-any.whl
| Download URL | qdislib-2.0.0-py3-none-any.whl |
|---|---|
| Size | 346.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
932dc73b98d6ec58d96aaf17cec9a87e6a0c3ea0c8138b6e691218824e648f95
|
|
BLAKE2b-256 checksum How to use checksums |
acaf13615aed86390b2ecd1e3210c8a725626c0ab83b6c30e9993f1186d427c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Security for Qdislib 2.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.