QuantumUQ
Uncertainty Quantification for Quantum Machine Learning on PennyLane and Qiskit.
Documentation: https://quantumuq.readthedocs.io/en/latest/
Installation
pip install quantumuq
# With optional Qiskit Aer support:
pip install "quantumuq[aer]"
Quick examples
PennyLane:
from quantumuq import wrap_qnode, ShotBootstrap
import pennylane as qml
import numpy as np
dev = qml.device("default.qubit", wires=2, shots=1000)
@qml.qnode(dev)
def circuit(x, params):
qml.AngleEmbedding(x, wires=[0, 1])
qml.StronglyEntanglingLayers(params, wires=[0, 1])
return qml.probs(wires=[0, 1])
params = 0.1 * np.random.default_rng(0).standard_normal((1, 2, 3))
predictor = wrap_qnode(circuit, task="classification", n_classes=2, params=params)
uq = ShotBootstrap(n_samples=16, shots=1000, seed=0)
uq_model = predictor.with_uq(uq)
dist = uq_model.predict_dist(np.random.randn(4, 2))
print(dist.mean.shape, dist.std.shape)
Qiskit:
from quantumuq import wrap_qiskit_sampler, ShotBootstrap
from qiskit.primitives import Sampler
from qiskit.circuit import QuantumCircuit
import numpy as np
qc = QuantumCircuit(1)
qc.ry(0.0, 0)
qc.measure_all()
def feature_map(X: np.ndarray):
return [[float(x[0])] for x in np.atleast_2d(X)]
sampler = Sampler()
predictor = wrap_qiskit_sampler(
sampler,
circuit=qc,
task="classification",
n_classes=2,
feature_map=feature_map,
)
uq = ShotBootstrap(n_samples=8, shots=1000, seed=0)
uq_model = predictor.with_uq(uq)
dist = uq_model.predict_dist(np.random.randn(4, 1))
print(dist.mean.shape, dist.std.shape)
Methods & metrics
- Uncertainty methods:
ShotBootstrap,DeepEnsemble,NoiseProfile - Metrics (classification):
nll,brier,ece,predictive_entropy - Metrics (regression):
rmse,gaussian_nll - Persistence:
UQModel.save()/UQModel.load()checkpoint a fitted model's trained parameters and method config for both PennyLane and Qiskit predictors (seeexamples/notebooks/06_uqmodel_persistence.ipynb)
Roadmap (v0.2 ideas)
- Richer model adapters (more flexible outputs, calibration hooks)
- Additional metrics and visualization utilities
- Optional integrations with experiment tracking tools
License
MIT License. See LICENSE for details.
Citation
If you use QuantumUQ in academic work, please cite:
@article{Catak_2026,
title={QuantumUQ: A Library for Uncertainty Quantification in Quantum Machine Learning},
url={http://dx.doi.org/10.36227/techrxiv.177205048.88644983/v1},
DOI={10.36227/techrxiv.177205048.88644983/v1},
publisher={Institute of Electrical and Electronics Engineers (IEEE)},
author={Catak, Ferhat Ozgur},
year={2026},
month=feb
}
Metadata
Release files for quantumuq 0.2.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 | |
|---|---|---|---|
| quantumuq-0.2.0.tar.gz | 613.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| quantumuq-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.3 MB
Release files / quantumuq-0.2.0.tar.gz
| Download URL | quantumuq-0.2.0.tar.gz |
|---|---|
| Size | 613.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d5fa5ba6065e75a265552fe0f38f8e58539661ed31ff35ccf7b2ace3c3f3ea45
|
|
BLAKE2b-256 checksum How to use checksums |
acc66659940b49d82f94da3abc33400ce3fa7ef56c9d8854218ba8c6c56de105
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 28, 2026.
Transparency logRelease files / quantumuq-0.2.0-py3-none-any.whl
| Download URL | quantumuq-0.2.0-py3-none-any.whl |
|---|---|
| Size | 654.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fc72ce4b13c552a989447ea5382323e4e155c728c981f187dec20af00d3f68ac
|
|
BLAKE2b-256 checksum How to use checksums |
2099db64cf68d9375e68dc70ff1394cf5ca64ffc7e23944b753f5a85dad2c788
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 28, 2026.
Transparency log