quoptuna is a proposed open-source project that combines quantum computing with Optuna's hyperparameter optimization framework.
Project description
QuOptuna
QuOptuna
Bridging quantum computing and hyperparameter optimization for next-generation machine learning
📚 Table of Contents
- About
- Key Features
- Installation
- Quick Start
- Documentation
- Development
- Contributing
- License
- Acknowledgments
🌟 About
QuOptuna seamlessly integrates quantum computing capabilities with the powerful Optuna hyperparameter optimization framework. By leveraging quantum algorithms, QuOptuna enables researchers and practitioners to explore optimization landscapes more efficiently, pushing the boundaries of what's possible in machine learning and computational research.
Whether you're working with quantum machine learning models or classical algorithms, QuOptuna provides the tools you need to find optimal hyperparameters faster and more effectively.
✨ Key Features
- 🔬 Quantum-Enhanced Optimization: Specialized hyperparameter tuning algorithms designed specifically for quantum machine learning workflows
- 🎯 Hybrid Model Support: Seamlessly optimize both quantum and classical models
- Quantum Models: Circuit-Centric Classifier, Data Reuploading Classifier, Quantum Kitchen Sinks, and more
- Classical Models: SVC, MLP Classifier, Perceptron, and other scikit-learn compatible models
- 📊 Interactive Dashboard: Real-time visualization of optimization progress through an intuitive Streamlit interface
- 🔍 Explainable AI: Built-in interpretability tools to understand model decisions and optimization trajectories
- 🔌 Extensible Architecture: Plugin-friendly design for easy integration with custom models and optimization strategies
📦 Installation
QuOptuna requires Python 3.11 or 3.12. Install using your preferred package manager:
Using UV (Recommended)
uv pip install quoptuna
Using pip
pip install quoptuna
Development Installation
For contributors and developers:
git clone https://github.com/Qentora/quoptuna.git
cd quoptuna
uv pip install -e ".[dev]"
🚀 Quick Start
Get up and running in minutes with this simple example:
import quoptuna as qo
# Define your objective function
def objective(trial):
"""
Example: Minimize a simple quadratic function
"""
x = trial.suggest_float('x', -10, 10)
return x ** 2
# Create and run optimization study
study = qo.create_study(direction='minimize')
study.optimize(objective, n_trials=100)
# Display results
print(f"Best value: {study.best_value}")
print(f"Best parameters: {study.best_params}")
🖥️ Launch the Application
QuOptuna bundles a pre-built web UI inside the Python package, so a single command boots the whole app — no Node.js, no repository checkout, just Python:
# Run straight from PyPI without installing anything permanently
uvx quoptuna
# ...or, in a project/venv that already has quoptuna installed
uv run quoptuna run
This starts one FastAPI/uvicorn process that serves both the JSON API and the bundled UI on a single port (defaulting to :8000, auto-incrementing if busy), greets you with a gradient ASCII banner, and opens your browser automatically.
| URL | What |
|---|---|
http://localhost:8000 |
Web UI |
http://localhost:8000/api/v1/... |
JSON API |
http://localhost:8000/api/docs |
Interactive API docs |
Common options:
# Pick an explicit port and skip auto-opening the browser
uv run quoptuna run --port 8001 --no-browser
# Launch the legacy Streamlit dashboard instead of the full stack
uv run quoptuna run --streamlit
Running uv run quoptuna (or uvx quoptuna) with no subcommand is equivalent to uv run quoptuna run.
Dev vs packaged. The command above is the packaged mode (one process, one port, served from the wheel). For frontend development with hot reload, use the dev mode — two processes — via
make run_cli(Next.js dev server on:3000+ FastAPI on:8000). See the docs for details.
📖 Documentation
Comprehensive documentation, tutorials, and API references are available at:
https://Qentora.github.io/quoptuna
Topics covered include:
- Detailed installation guides
- Quantum algorithm integration
- Advanced optimization techniques
- Custom sampler implementation
- API reference
🛠️ Development
We welcome contributions from the community! Here's how to set up your development environment:
Prerequisites
- Python 3.11 or 3.12
- UV package manager (recommended) or pip
- Node.js 18+ — only for frontend development; the published package ships a pre-built UI, so running QuOptuna does not require Node
- Git
Setup Development Environment
# Clone the repository
git clone https://github.com/Qentora/quoptuna.git
cd quoptuna
# Install development dependencies
uv pip install -e ".[dev]"
Running Tests
# Run all tests
uv run pytest
# Run with coverage report
uv run pytest --cov=quoptuna
# Generate HTML coverage report
uv run pytest --cov=quoptuna --cov-report=html
Code Quality
Maintain code quality with our linting and type-checking tools:
# Run linter
uv run ruff check .
# Auto-fix linting issues
uv run ruff check . --fix
# Type checking
uv run mypy .
🤝 Contributing
We're excited to have you contribute to QuOptuna! Here's how you can help:
- Fork the repository on GitHub
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes and write tests
- Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
Please ensure your code:
- Passes all tests (
pytest) - Follows our style guide (
ruff check) - Includes appropriate documentation
- Has type hints where applicable
For detailed guidelines, see our Contributing Guidelines.
📄 License
This project is licensed under the Apache 2.0 License. See the LICENSE file for full details.
🙏 Acknowledgments
This project builds on the excellent work of:
- Wolt Python Package Cookiecutter - Project template and structure
- XanaduAI's qml-benchmarks - Quantum machine learning benchmarking tools (Apache License 2.0)
- Optuna - The hyperparameter optimization framework that powers QuOptuna
Special thanks to all our contributors who help make QuOptuna better!
📊 Project Activity
Documentation • Report Bug • Request Feature
Made with ❤️ by the Qentora team
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file quoptuna-0.0.6.tar.gz.
File metadata
- Download URL: quoptuna-0.0.6.tar.gz
- Upload date:
- Size: 447.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5a129f277f911ef8c0a058b2f51b9af494e1617a4cc20cbe4495162ddd37386
|
|
| MD5 |
6960a4b5a24fb43a24ce24100e2b59b5
|
|
| BLAKE2b-256 |
fb904de797040b22243fff4a6d6b6add49b7907ee33b0c0315ee126ae73cc57b
|
File details
Details for the file quoptuna-0.0.6-py3-none-any.whl.
File metadata
- Download URL: quoptuna-0.0.6-py3-none-any.whl
- Upload date:
- Size: 509.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ddbe8253de58e8bfa3dc010163498403decf2e2e63a3b4f2815c2d5fad335000
|
|
| MD5 |
c0b0e2b552cf3e71a9edda37e3ab5415
|
|
| BLAKE2b-256 |
4502be2d7e68b0f3413f0f78e39f1cff62113816ee2cb31c34a2e6bc0b7d41eb
|