Skip to main content

Python bindings for QUBO++ (HUBO/QUBO symbolic computation)

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.

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. 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. The following command will activate an anonymous trial license:

$ qbpp-license -a

If you have a QUBO++ license key, activate it as follows:

$ 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).

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/

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.4.5-py3-none-manylinux_2_31_x86_64.whl (34.1 MB view details)

Uploaded Python 3manylinux: glibc 2.31+ x86-64

pyqbpp-2026.4.5-py3-none-manylinux_2_31_aarch64.whl (32.5 MB view details)

Uploaded Python 3manylinux: glibc 2.31+ ARM64

File details

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

File metadata

  • Download URL: pyqbpp-2026.4.5-py3-none-manylinux_2_31_x86_64.whl
  • Upload date:
  • Size: 34.1 MB
  • Tags: Python 3, manylinux: glibc 2.31+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.31.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

File hashes

Hashes for pyqbpp-2026.4.5-py3-none-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 87afbe0037ea74685fb129917b77e20ac62f9fbd5a0eb47509e4f7a4e94e0d7b
MD5 2e5439b97fc446e87722aa37f577ee2c
BLAKE2b-256 e680ae2c9f298d3eaf113fc6e4e1756d0b2d3ab900ab34d21b3dd4eb962dd486

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyqbpp-2026.4.5-py3-none-manylinux_2_31_aarch64.whl
  • Upload date:
  • Size: 32.5 MB
  • Tags: Python 3, manylinux: glibc 2.31+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.31.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

File hashes

Hashes for pyqbpp-2026.4.5-py3-none-manylinux_2_31_aarch64.whl
Algorithm Hash digest
SHA256 366d136f52f45b2d91d6aa7df9aeb854979e8155700b6e16376614c68830cc81
MD5 2fa261a7a02cbe789bf16a32dc62a17d
BLAKE2b-256 f3ec37e58a95249077e8ec30f3e134acee5fae3c2eb77f625fabe97b5c0219ec

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