Skip to main content

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

https://qbpp-doc.cs.hiroshima-u.ac.jp/python/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyqbpp-2026.3.15-py3-none-manylinux_2_31_x86_64.whl (18.9 MB view details)

Uploaded Python 3manylinux: glibc 2.31+ x86-64

pyqbpp-2026.3.15-py3-none-manylinux_2_31_aarch64.whl (18.1 MB view details)

Uploaded Python 3manylinux: glibc 2.31+ ARM64

File details

Details for the file pyqbpp-2026.3.15-py3-none-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for pyqbpp-2026.3.15-py3-none-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 a39370c9c5396891df34a097bcafafd55aa45fc6d25b3ec49ecf3cfd1d005396
MD5 85366c8752b005f1cd193b60c9cf5905
BLAKE2b-256 11b35c367273dc9cf29b3e91466ad91ac62ecf92587d8e4343e4f0fdc963364a

See more details on using hashes here.

File details

Details for the file pyqbpp-2026.3.15-py3-none-manylinux_2_31_aarch64.whl.

File metadata

File hashes

Hashes for pyqbpp-2026.3.15-py3-none-manylinux_2_31_aarch64.whl
Algorithm Hash digest
SHA256 31eaafe7027c1e2f9c19210792f03ee753997f446c9377a2e9c3cb2fa64a875d
MD5 ed9fc7d6a509127fdd59b2cd3ad899d1
BLAKE2b-256 5cea6be9847b302e11b720de84b2d8e0238da1525dbac3edcbc1a0f00cf1c8a5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page