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

Uploaded Python 3manylinux: glibc 2.31+ x86-64

pyqbpp-2026.4.6-py3-none-manylinux_2_31_aarch64.whl (32.6 MB view details)

Uploaded Python 3manylinux: glibc 2.31+ ARM64

File details

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

File metadata

File hashes

Hashes for pyqbpp-2026.4.6-py3-none-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 191f94a2fb663e974414374fefa581469bb72b68c4a6784f8ac04ff545f2c0b0
MD5 214e1c3b3aaa99f7851384eb76ad4462
BLAKE2b-256 0f54803735e70c09e06eceff7919305ed7c676bff179ef9bc2d88ca429c36e24

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqbpp-2026.4.6-py3-none-manylinux_2_31_aarch64.whl
Algorithm Hash digest
SHA256 d2f5e822e50c3c6fbdbd3b6775096fda76b1771766407c51defd5d497e35b976
MD5 19b82bb77890c7c022bf037a43f70d20
BLAKE2b-256 1b3d92f74180ddfda119a3cf9be9aa2ca733174b80dfe731deae5e30550acb70

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