Binary Autoencoder-based QUBO optimization library
Project description
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
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
quron-0.1.0.tar.gz
(133.2 kB
view details)
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
quron-0.1.0-py3-none-any.whl
(21.0 kB
view details)
File details
Details for the file quron-0.1.0.tar.gz.
File metadata
- Download URL: quron-0.1.0.tar.gz
- Upload date:
- Size: 133.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b251c05a42c2b02c0a1cb73a1ed131975acbe2069a0379152f4eaa1a92512cce
|
|
| MD5 |
5a22f7a10b44b1c8c854f0ebba9de133
|
|
| BLAKE2b-256 |
67cf4af2d4f1e9632913be2c896fa2b63e0c27435a4ab596467e788875741f1d
|
File details
Details for the file quron-0.1.0-py3-none-any.whl.
File metadata
- Download URL: quron-0.1.0-py3-none-any.whl
- Upload date:
- Size: 21.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c8f16a96fa64680abf69ed79386bbb6d2a49048435c320d47efd0ea9dfdcb69
|
|
| MD5 |
99759d20a15c781b7116611dc5bcf060
|
|
| BLAKE2b-256 |
bce26fba285821d9cc354ef603f0246d5235327139d16029d8c9a7aea01515d5
|