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.
Development tools
Section titled “Development tools”Installation
Section titled “Installation”Install as a dependency
Section titled “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
Section titled “Using pip or pipx”To install the pipy
package using pip
or pipx
- Create a
venv
if 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
pip
in development mode by simply runningpip install -e .
. Notice that in this way you will install all the dependencies, including extras. - install it with
conda
by simply usingpip
inside the Conda environment.
Windows Note
Section titled “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 (external).
Cplex Installation
Section titled “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
Section titled “QuickStart”With a quantum solver
Section titled “With a quantum solver”from qubosolver import QUBOInstancefrom qubosolver.config import SolverConfigfrom qubosolver.solver import QuboSolverfrom qoolqit._solvers.data import BackendConfigfrom qoolqit._solvers.types import BackendType
# define QUBOQ = torch.tensor([[1.0, 0.0], [0.0, 1.0]])instance = QUBOInstance(coefficients=Q)
# Create a SolverConfig object to use a quantum backendconfig = 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
Section titled “With a classical solver”from qubosolver import QUBOInstancefrom qubosolver.config import ClassicalConfig, SolverConfigfrom qubosolver.solver import QuboSolverClassical, QuboSolverQuantum
# define QUBOQ = 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
Section titled “Documentation”Getting in touch
Section titled “Getting in touch”- Pasqal Community Portal (external) (forums, chat, tutorials, examples, code library).
- Github repository (external) (source code, issue tracker).
- Professional Support (external) (if you need tech support, custom licenses, a variant of this library optimized for your workload, your own QPU, remote access to a QPU, ...)