Metadata-Version: 2.1
Name: pyqbpp
Version: 2026.4.4.1
Summary: Python bindings for QUBO++ (HUBO/QUBO symbolic computation)
Author: NakanoCS
Author-email: info@nakanocs.com
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.

> **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](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.
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.

```bash
$ export QBPP_LICENSE_KEY=[Your QUBO++ license key]
$ qbpp-license -a
```

## Quick Example

The following program finds an 8x8 binary matrix where each row and each column contains exactly one 1 (a one-hot constraint).

```python
import pyqbpp.c32e64 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][j]) for j in range(n)])
```

## Documentation

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