Fairness-aware, explainable AutoML for quantum + classical machine learning — powered by Optuna & PennyLane.
Why QuOptuna?
Training a good quantum machine-learning model today means hand-writing circuits, guessing hyperparameters, and hoping the result is trustworthy. QuOptuna runs one automated search across 21 quantum and classical classifiers, prunes hopeless configurations early, audits every model for fairness, explains the winner with SHAP, and writes the research report for you — all from a point-and-click web wizard or a single CLI command.
The framework is peer-reviewed: it is published in the IEEE Systems, Man, and Cybernetics Magazine (2026) and two IEEE conference proceedings — see Publications.
| Plain Optuna | Classical AutoML | QuOptuna | |
|---|---|---|---|
| Quantum models (PennyLane/JAX) | manual wiring | ✗ | ✅ 16 built in |
| Quantum and classical in one search | manual | ✗ | ✅ |
| Fairness-aware search (constrained / multi-objective) | manual | rare | ✅ built in |
| SHAP explainability + AI-written reports | ✗ | partial | ✅ built in |
| Zero-install web UI | dashboard only | varies | ✅ uvx quoptuna |
✨ Features
- 21 models, one search — 16 quantum classifiers (Data Reuploading, Circuit-Centric, IQP & Projected Quantum Kernels, Quantum Kitchen Sinks, Quantum Metric Learner, Quantum Boltzmann Machines, Tree Tensor, Quanvolutional NN, WeiNet, separable & dressed variants) alongside classical baselines (SVC, LinearSVC, MLP, Perceptron, CNN), with automatic one-vs-rest multiclass support.
- Smart optimization — Optuna TPE / random / grid samplers with ASHA & Hyperband pruning, conditional per-model search spaces, and vectorized (JAX
vmap) circuit evaluation for fast trials. - Fairness in the loop — don't just measure bias, search under it: constrained mode (feasibility threshold on disparity) or multi-objective mode (accuracy-vs-fairness Pareto front), using equal-opportunity difference, demographic-parity difference, or disparate-impact metrics via fairlearn.
- Explainability built in — SHAP bar / beeswarm / violin / heatmap / waterfall plots, ROC & PR curves, confusion matrices for every trained model.
- AI-written reports — a two-agent analyst + reviewer pipeline turns your run into a readable research report (works with OpenAI, Anthropic, and Google Gemini keys).
- 6-step web wizard — Dataset → Features → Configure → Optimize → Analyze → Report. A Next.js UI served by a FastAPI backend on a single port, with live trial monitoring and restart-safe run persistence.
- REST API & headless CLI — automate everything (
/api/v1/...), or runquoptuna optimizein CI. A legacy Streamlit dashboard remains available viaquoptuna run --streamlit.
📦 Installation
Requires Python 3.11 or 3.12.
# Zero-install: run the full app straight from PyPI
uvx quoptuna
# Or install into your environment
pip install quoptuna # or: uv pip install quoptuna
🚀 Quick Start
Web UI — one command boots the bundled app (FastAPI + pre-built UI on one port, no Node.js needed) and opens your browser:
uvx quoptuna
| URL | What |
|---|---|
http://localhost:8000 |
Web UI (6-step wizard) |
http://localhost:8000/api/v1/... |
JSON API |
http://localhost:8000/api/docs |
Interactive API docs |
Headless CLI — optimize a UCI dataset without touching a browser:
quoptuna optimize --uci-id 267 --trials 25 --sampler tpe
Python API — drive the search from your own code:
from quoptuna import DataPreparation, Optimizer
data_prep = DataPreparation(
file_path="your_data.csv",
x_cols=["feature_1", "feature_2", "feature_3"],
y_col="target",
)
data_dict = data_prep.get_data(output_type="2")
optimizer = Optimizer(db_name="experiment", study_name="trial_1", data=data_dict)
study, best_trials = optimizer.optimize(n_trials=25)
print(f"Best F1 score: {best_trials[0].value:.4f}")
print(f"Best model: {best_trials[0].params['model_type']}")
📖 Documentation
Full documentation lives at quoptuna.org:
- Quickstart — first optimization in five minutes
- Samplers & pruning — TPE vs. random vs. grid, ASHA/Hyperband
- Fairness-aware search — constrained & multi-objective modes
- Tuning for speed & quality — vectorization, devices, validation splits
📄 Publications & Citation
QuOptuna is described in three peer-reviewed IEEE publications:
- E. Jose, A. C. Fong, C. S. Lai, B. Fong, L. L. Lai, "Quoptuna: Automated Optimization and Governance for Quantum Machine Learning," IEEE Systems, Man, and Cybernetics Magazine, vol. 12, no. 3, pp. 116–121, 2026. doi:10.1109/MSMC.2025.3613072
- E. Jose, A. C. Fong, "Quoptuna: An Open-Source Framework for Explainable Quantum Machine Learning," 2025 Interdisciplinary Conference on Electrics and Computer (INTCEC), pp. 1–5. doi:10.1109/INTCEC65580.2025.11256089
- E. Jose, A. C. Fong, "Design and Development of an Open-Source Toolkit for Quantum Machine Learning," 2025 IEEE Int. Conf. on Recent Advances in Systems Science and Engineering (RASSE), pp. 1–6. doi:10.1109/RASSE64831.2025.11315342
If you use QuOptuna in your research, please cite the magazine article (GitHub's Cite this repository button uses CITATION.cff):
@article{jose2026quoptuna,
author = {Jose, Edwin and Fong, Alvis C. and Lai, Chun Sing and Fong, Bernard and Lai, Loi Lei},
journal = {IEEE Systems, Man, and Cybernetics Magazine},
title = {Quoptuna: Automated Optimization and Governance for Quantum Machine Learning},
year = {2026},
volume = {12},
number = {3},
pages = {116--121},
doi = {10.1109/MSMC.2025.3613072}
}
🤝 Contributing
Contributions are welcome! See CONTRIBUTING.md for the dev setup and workflow, and the contributor docs for the long-form guide. Please follow our Code of Conduct.
git clone https://github.com/Qentora/quoptuna.git && cd quoptuna
uv sync # install dependencies
uv run pytest # run the test suite
📜 License
Apache License 2.0 — see LICENSE.
🙏 Acknowledgments
Built on the shoulders of Optuna, PennyLane, qml-benchmarks (Apache-2.0), fairlearn, SHAP, FastAPI, and Next.js. Project scaffolding from the Wolt Python Package Cookiecutter. Developed at Western Michigan University. Thanks to all contributors!
⭐ If QuOptuna helps your research, consider starring the repo — it helps others find it.
Metadata
Release files for quoptuna 1.0.1
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 |
|---|---|---|---|---|
| quoptuna-1.0.1.tar.gz | 4.2 MB | Without provenance | Details for quoptuna-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| quoptuna-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for quoptuna-1.0.1-py3-none-any.whl |
Total release size: 8.5 MB
Release files / quoptuna-1.0.1.tar.gz
| Download URL | quoptuna-1.0.1.tar.gz |
|---|---|
| Size | 4.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2421af41d371d56ddc31ae669711de50360246980da38fc4d96aad9576249222
|
|
BLAKE2b-256 checksum How to use checksums |
c9d3acc569093bb554000101a8428af5855c4b125e7c2063730847b37e9bc76b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / quoptuna-1.0.1-py3-none-any.whl
| Download URL | quoptuna-1.0.1-py3-none-any.whl |
|---|---|
| Size | 4.3 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
40edf3186382489ea5e6513f0d6a362d4011071872289c8b39019b66d780d063
|
|
BLAKE2b-256 checksum How to use checksums |
d33e10aa49b0c165c09f830407d6fffc2972f9b4dd436b4af4adf93e834410ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for quoptuna 1.0.1
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.