Python QUBO++ Symbolic Computation Library (C++ backend)
Project description
PyQBPP: Python Interface for QUBO++
PyQBPP is a Python wrapper for the QUBO++ library, allowing you to model and solve combinatorial optimization problems using QUBO/HUBO formulations directly from Python.
Note: PyQBPP is currently in alpha. The API may change without notice, and there may be bugs. Please report any issues to the author.
Features
- Symbolic construction of QUBO/HUBO expressions in Python
- Access to QUBO++ solvers (Easy Solver, Exhaustive Solver, ABS3)
- Familiar Python syntax with the full power of the QUBO++ engine
Supported Environment
- Linux (Ubuntu 20.04 or later)
- x86_64 or arm64 (aarch64) CPUs
- Python 3.8 or later
Installation
PyQBPP is available on PyPI. We recommend using a Python virtual environment (venv) to install PyQBPP. No sudo privileges are required.
$ python3 -m venv ~/qbpp-env
$ source ~/qbpp-env/bin/activate
$ pip install pyqbpp
After installation, activate your QUBO++ license.
Set the QBPP_LICENSE_KEY environment variable to your license key and run qbpp-license -a.
If QBPP_LICENSE_KEY is not set, an anonymous trial license will be activated.
$ export QBPP_LICENSE_KEY=[Your QUBO++ license key]
$ qbpp-license -a
Quick Example
The following program finds an 8×8 binary matrix where each row and each column contains exactly one 1 (a one-hot constraint).
from pyqbpp import EasySolver, var, sum, vector_sum
n = 8
x = var("x", n, n)
# Each row and column has exactly one 1
f = sum(vector_sum(x, 0) == 1) + sum(vector_sum(x, 1) == 1)
f.simplify_as_binary()
solver = EasySolver(f)
solver.target_energy(0)
sol = solver.search()
for i in range(n):
print([sol(x[i][j]) for j in range(n)])
Documentation
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 Distributions
Built Distributions
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 pyqbpp-2026.3.17-py3-none-manylinux_2_31_x86_64.whl.
File metadata
- Download URL: pyqbpp-2026.3.17-py3-none-manylinux_2_31_x86_64.whl
- Upload date:
- Size: 19.2 MB
- Tags: Python 3, manylinux: glibc 2.31+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
605795e94be2fa725313acbac4e54c5ea3380b68e05801aa301dd28b75e3fac0
|
|
| MD5 |
b7215fd28d52f4b55d5b3d05d19cd0ad
|
|
| BLAKE2b-256 |
02e13389018ce063d2c47e242db2da9dbde052ceff339e3241f0e24fc7b62881
|
File details
Details for the file pyqbpp-2026.3.17-py3-none-manylinux_2_31_aarch64.whl.
File metadata
- Download URL: pyqbpp-2026.3.17-py3-none-manylinux_2_31_aarch64.whl
- Upload date:
- Size: 18.4 MB
- Tags: Python 3, manylinux: glibc 2.31+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c304321d1c54154871f8525a9d9bfb83f053240d31333fbeca12d29d37f326a
|
|
| MD5 |
4d286207544bac86d31e1fc568aa1d40
|
|
| BLAKE2b-256 |
af4cb255dc7177eb3575f927d61ef55ce206b3554573f47b1d989630c821d4e5
|