Quron
Binary Autoencoder-based QUBO optimization library for Python.
Overview
Quron は、組合せ最適化問題を QUBO (Quadratic Unconstrained Binary Optimization) に自動変換するための Python ライブラリです。
基本フロー:
- 解空間を
Variableで定義 AEBuilderで解をバイナリ潜在ベクトルに圧縮- Factorization Machine (FM) で目的関数の surrogate を学習
- FM を QUBO に変換
- イジングマシン(Amplify / D-Wave)で最適化
Installation
pip install quron
Optional Dependencies
ソルバーを使用する場合は、対応するオプションをインストールしてください。
# Amplify solver
pip install quron[amplify]
# D-Wave solver
pip install quron[dwave]
# Both solvers
pip install quron[solvers]
Quick Start
from quron import Variable, AEBuilder, Optimizer, AmplifySolver
# 1. 解空間の定義
var = Variable(length=5, var_type="integer", min_value=0, max_value=3)
# 2. 目的関数の定義(最小化)
def objective(solution):
return sum(solution)
# 3. 初期解の生成
initial_solutions = var.sample_random(20)
initial_values = [objective(sol) for sol in initial_solutions]
# 4. オートエンコーダの学習
ae = AEBuilder(var, latent_dim=8)
ae.train(initial_solutions)
# 5. ソルバーの設定
solver = AmplifySolver(token="YOUR_AMPLIFY_TOKEN")
# 6. 最適化
optimizer = Optimizer(var, ae, objective, solver)
optimizer.add_initial_data(initial_solutions, initial_values)
optimizer.optimize(num_iterations=5)
# 7. 結果の取得
print(f"Best solution: {optimizer.best_solution}")
print(f"Best value: {optimizer.best_value}")
API Reference
詳細は docs/reference.md を参照してください。
- Variable - 解空間の定義
- AEBuilder - RNN (GRU) ベースのオートエンコーダ
- Solver - QUBO ソルバー(AmplifySolver, DWaveSolver)
- Optimizer - AE + FM + Solver を組み合わせた最適化ループ
Requirements
- Python >= 3.11
- numpy >= 1.24.0
- torch >= 2.0.0
- pandas >= 2.0.0
License
MIT License
Metadata
Release files for quron 0.1.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 | |
|---|---|---|---|
| quron-0.1.0.tar.gz | 133.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| quron-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 154.2 kB
Release files / quron-0.1.0.tar.gz
| Download URL | quron-0.1.0.tar.gz |
|---|---|
| Size | 133.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b251c05a42c2b02c0a1cb73a1ed131975acbe2069a0379152f4eaa1a92512cce
|
|
BLAKE2b-256 checksum How to use checksums |
67cf4af2d4f1e9632913be2c896fa2b63e0c27435a4ab596467e788875741f1d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.4.18
|
Release files / quron-0.1.0-py3-none-any.whl
| Download URL | quron-0.1.0-py3-none-any.whl |
|---|---|
| Size | 21.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8c8f16a96fa64680abf69ed79386bbb6d2a49048435c320d47efd0ea9dfdcb69
|
|
BLAKE2b-256 checksum How to use checksums |
bce26fba285821d9cc354ef603f0246d5235327139d16029d8c9a7aea01515d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.4.18
|