A Quadratic Unconstrained Binary Optimization (QUBO) solver library using quantum and classical approaches.
Project description
Qubo Solver
Solving combinatorial optimization (CO) problems using quantum computing is one of those promising applications for the near term. The Quadratic Unconstrained Binary Optimization (QUBO) (also known as unconstrained binary quadratic programming) model enables to formulate many CO problems that can be tackled using quantum hardware. QUBO offers a wide range of applications from finance and economics to machine learning. The Qubo Solver is a Python library designed for solving Quadratic Unconstracined Binary Optimization (QUBO) problems on a neutral atom quantum processor.
The core of the library is focused on the development of several algorithms for solving QUBOs: classical (tabu-search, simulated annealing, ...), quantum (Variational Quantum Algorithms, Quantum Adiabatic Algorithm, ...) or hybrid quantum-classical.
Users setting their first steps into quantum computing will learn how to implement the core algorithm in a few simple steps and run it using the Pasqal Neutral Atom QPU. More experienced users will find this library to provide the right environment to explore new ideas - both in terms of methodologies and data domain - while always interacting with a simple and intuitive QPU interface.
!!! warning "Usage restrictions" At the moment, only QUBO matrices in symmetric form with non-negative off diagonal terms are supported. We plan to handle negative off diagonal terms in a future release.
Development tools
Installation
Install as a dependency
Using hatch, uv or any pyproject-compatible Python manager
Edit file pyproject.toml to add the line
"qubo-solver"
Using pip or pipx
To install the pipy package using pip or pipx
- Create a
venvif that's not done yet
$ python -m venv .venv
- Enter the venv
$ source .venv/bin/activate
- Install the package
$ pip install qubo-solver
# or
$ pipx install qubo-solver
Alternatively, you can also:
- install with
pipin development mode by simply runningpip install -e .. Notice that in this way you will install all the dependencies, including extras. - install it with
condaby simply usingpipinside the Conda environment.
Windows Note
This package require features available on Unix systems. Under Windows, these features can be installed as part of the Windows Subsystem for Linux.
Cplex Installation
The cplex package is only available under some combinations of platforms and versions of Python. We
recommend using python 3.11 or 3.12, which we have tested to work with cplex.
If you wish to use the licensed version of cplex, you will need to set the environment
variable ILOG_LICENSE_FILE to the location of the license file -- for more details, see the documentation
of cplex.
QuickStart
With a quantum solver
from qubosolver import QUBOInstance
from qubosolver.config import SolverConfig
from qubosolver.solver import QuboSolver
from qoolqit._solvers.data import BackendConfig
from qoolqit._solvers.types import BackendType
# define QUBO
Q = torch.tensor([[1.0, 0.0], [0.0, 1.0]])
instance = QUBOInstance(coefficients=Q)
# Create a SolverConfig object to use a quantum backend
config = SolverConfig(use_quantum=True, backend_config = BackendConfig(backend=BackendType.QUTIP))
# Instantiate the quantum solver.
solver = QuboSolver(instance, config)
# Solve the QUBO problem.
solution = solver.solve()
With a classical solver
from qubosolver import QUBOInstance
from qubosolver.config import ClassicalConfig, SolverConfig
from qubosolver.solver import QuboSolverClassical, QuboSolverQuantum
# define QUBO
Q = torch.tensor([[1.0, 0.0], [0.0, 1.0]])
instance = QUBOInstance(coefficients=Q)
# Create a SolverConfig object with classical solver options.
classical_config = ClassicalConfig(
classical_solver_type="cplex",
cplex_maxtime=10.0,
cplex_log_path="test_solver.log",
)
config = SolverConfig(use_quantum=False, classical=classical_config)
# Instantiate the classical solver via the pipeline's classical solver dispatcher.
classical_solver = QuboSolver(instance, config)
# Solve the QUBO problem.
solution = classical_solver.solve()
Documentation
Getting in touch
- Pasqal Community Portal (forums, chat, tutorials, examples, code library).
- Github repository (source code, issue tracker).
- Professional Support (if you need tech support, custom licenses, a variant of this library optimized for your workload, your own QPU, remote access to a QPU, ...)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qubo_solver-0.0.5.tar.gz.
File metadata
- Download URL: qubo_solver-0.0.5.tar.gz
- Upload date:
- Size: 61.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e2a9a5bb6d8749c3b0aa633722dae78f2037d9cccf690f68633e684b01ff71e
|
|
| MD5 |
979c0f3fb66a023909768e2f7afc74fb
|
|
| BLAKE2b-256 |
1367017d83a5fe93987eae21af9f82bf261450daba2e9f71954e19fb2b64b7c3
|
Provenance
The following attestation bundles were made for qubo_solver-0.0.5.tar.gz:
Publisher:
publish.yml on pasqal-io/qubo-solver
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qubo_solver-0.0.5.tar.gz -
Subject digest:
4e2a9a5bb6d8749c3b0aa633722dae78f2037d9cccf690f68633e684b01ff71e - Sigstore transparency entry: 563469272
- Sigstore integration time:
-
Permalink:
pasqal-io/qubo-solver@0629d911f6fa7c982def4e1fb37c4dc612f6709e -
Branch / Tag:
refs/tags/v0.0.5 - Owner: https://github.com/pasqal-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0629d911f6fa7c982def4e1fb37c4dc612f6709e -
Trigger Event:
release
-
Statement type:
File details
Details for the file qubo_solver-0.0.5-py3-none-any.whl.
File metadata
- Download URL: qubo_solver-0.0.5-py3-none-any.whl
- Upload date:
- Size: 70.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db945f7e977935bc44815860551b7fb0811272465214478831e898ba4e231d5a
|
|
| MD5 |
4a4d2b35d46311f0ce58445de3e8fbb2
|
|
| BLAKE2b-256 |
411ac16c21b2b81e057167355c9624a871c93eefbdd1dee227b6d94edda6545e
|
Provenance
The following attestation bundles were made for qubo_solver-0.0.5-py3-none-any.whl:
Publisher:
publish.yml on pasqal-io/qubo-solver
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qubo_solver-0.0.5-py3-none-any.whl -
Subject digest:
db945f7e977935bc44815860551b7fb0811272465214478831e898ba4e231d5a - Sigstore transparency entry: 563469285
- Sigstore integration time:
-
Permalink:
pasqal-io/qubo-solver@0629d911f6fa7c982def4e1fb37c4dc612f6709e -
Branch / Tag:
refs/tags/v0.0.5 - Owner: https://github.com/pasqal-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0629d911f6fa7c982def4e1fb37c4dc612f6709e -
Trigger Event:
release
-
Statement type: