← All problem classes
QUBO

QUBO / Ising

Quadratic unconstrained binary optimization: the native quantum format.

In plain terms

Many puzzles come down to flipping a set of yes/no switches to make some total as small as possible, where switches interact in pairs. This is the natural language of quantum computers, but Quicopt solves it on an ordinary machine, no million-euro hardware required.

The technical picture

QUBO is the native input format of quantum and quantum-inspired solvers: binary variables and a quadratic objective, no constraints. Max-Cut (partitioning a graph to maximize the edges crossing the cut) is the canonical example, and its QUBO/Ising form is exactly the energy a quantum annealer targets.

Quicopt matches quantum-vendor performance on standard hardware: no €10–20M quantum computer required. For higher-order objectives (degree ≥ 3), see the PUBO / HUBO class.

Mathematical model

Minimize a quadratic form over binary variables (QUBO); equivalently, an Ising energy over spins.

Example

From install to solved model: a small, self-contained example, copy-paste ready.

1

Install the client

$ pip install "quicopt[mathopt]"
2

Copy the example

maxcut.py
from ortools.math_opt.python import mathopt
from quicopt import Client

# Max-Cut as a QUBO: split the graph's nodes into two sides so that as
# many edges as possible cross between them. Binary x_i picks the side;
# the quadratic objective is exactly the QUBO/Ising energy. (The Gset
# benchmark is this same problem at scale.)
edges = [(0, 1), (1, 2), (2, 3), (0, 3)]
model = mathopt.Model(name="maxcut")
x = [model.add_binary_variable(name=f"x{i}") for i in range(4)]
model.minimize(sum(2 * x[i] * x[j] - x[i] - x[j] for i, j in edges))

client = Client("https://try.quicoptapi.pgi.fz-juelich.de")
result = client.solve(model)
print(result.display)
3

Run it

$ python maxcut.py
What you’ll see
├── shots
│   ├── 1 · Heuristic 1    0   0.0s
│   ├── 2 · Heuristic 2   -4   0.0s  ◀ best
│   └── 3 · Heuristic 2   -4   0.0s
├── status:     heuristic
├── feasible:   n/a
├── objective:  -4.0
├── x:          x0=0, x1=1, x2=0, x3=1  (4 variables)
└── solve_time: 0.041 s

Docs, API reference and more examples live in the Developer Hub →

Benchmark

Max-Cut on the Gset graphs is a canonical QUBO/Ising family: see the measured comparison against the best-known cuts across 71 instances.

Worked guides

Step-by-step, runnable guides for problems in this class (developer hub, in English):