Metadata-Version: 2.1
Name: pyqbpp
Version: 2026.4.5
Summary: Python bindings for QUBO++ (HUBO/QUBO symbolic computation)
Home-page: https://qubo-plus.github.io/python/
Author: Koji Nakano
Author-email: nakano@cs.hiroshima-u.ac.jp
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: POSIX :: Linux
Requires-Python: >=3.6
Description-Content-Type: text/markdown

# 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.

## 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
- CUDA-enabled NVIDIA GPUs
- Python 3.8 or later

## Installation

PyQBPP is available on [PyPI](https://pypi.org/project/pyqbpp/).
We recommend using a Python virtual environment (venv) to install PyQBPP.
No sudo privileges are required.

```bash
$ python3 -m venv ~/qbpp-env
$ source ~/qbpp-env/bin/activate
$ pip install pyqbpp
```

After installation, activate your QUBO++ license.
The following command will activate an anonymous trial license:
```bash
$ qbpp-license -a
```
If you have a QUBO++ license key, activate it as follows:
```bash
$ qbpp-license -k YOUR-LICENSE-KEY -a
```

## Quick Example

The following program finds an 8x8 permutation matrix (each row and column has exactly one 1).

```python
import pyqbpp as qbpp

n = 8
x = qbpp.var("x", n, n)

# Each row and column has exactly one 1
f = qbpp.sum(qbpp.vector_sum(x, 0) == 1) + qbpp.sum(qbpp.vector_sum(x, 1) == 1)

f.simplify_as_binary()

solver = qbpp.EasySolver(f)
sol = solver.search({"target_energy": 0})

for i in range(n):
    print(sol(x[i]))
```

Example output:
```
[0, 1, 0, 0, 0, 0, 0, 0]
[0, 0, 0, 1, 0, 0, 0, 0]
[0, 0, 0, 0, 1, 0, 0, 0]
[0, 0, 0, 0, 0, 1, 0, 0]
[0, 0, 0, 0, 0, 0, 0, 1]
[1, 0, 0, 0, 0, 0, 0, 0]
[0, 0, 1, 0, 0, 0, 0, 0]
[0, 0, 0, 0, 0, 0, 1, 0]
```


## Documentation

https://qubo-plus.github.io/python/
