A multi-agent LLM pipeline that converts plain-English optimization problems into verified, executable QUBO formulations — ready for quantum and classical solvers.
A fully automated pipeline for QUBO formulation generation, verification, and code synthesis.
Quadratic Unconstrained Binary Optimization (QUBO) is the universal input format for quantum annealers and many classical heuristics — but formulating a real-world problem as a QUBO requires deep mathematical expertise and is notoriously error-prone.
QuantumQUBO Agent replaces this manual process with a six-stage LLM pipeline: a natural language problem description enters one end, and a mathematically verified QUBO matrix with executable Python code comes out the other.
Evaluated on the QUBOBench dataset — 100 diverse optimization problems across 9 application domains — our system achieves a 68% end-to-end success rate with automatic test-case generation and brute-force verification, no human in the loop.
All benchmarks are drawn from the QUBOBench dataset. Filter by domain or search by name.
100 problems shown
| # | Problem | Domain | Status | Tokens | Time (s) |
|---|
Four worked examples showing the natural language input, QUBO formulation, and generated Python code.
Graph Theory · ✓ Success
Given an undirected weighted graph $G=(V,E)$, partition the vertices into two disjoint subsets $V_0$ and $V_1$ to maximise the total weight of edges crossing the cut. Each vertex $i$ is assigned a binary variable $x_i \in \{0,1\}$.
import numpy as np def build_qubo(instance): n = instance["n_nodes"] Q = np.zeros((n, n)) for i, j, w in instance["edges"]: Q[i, i] -= w Q[j, j] -= w Q[i, j] += 2 * w return Q
Combinatorial · ✓ Success
Select a subset of $n$ items, each with value $v_i$ and weight $w_i$, to maximise total value subject to the constraint that the total weight does not exceed capacity $W$. Binary variable $x_i=1$ if item $i$ is selected.
where $P$ is a penalty coefficient chosen so that $P > \max_i v_i$.
def build_qubo(instance): v = instance["values"] w = instance["weights"] W = instance["capacity"] n = len(v) P = max(v) + 1 Q = np.zeros((n, n)) for i in range(n): Q[i,i] += -v[i] + P*w[i]**2 - 2*P*W*w[i] for j in range(i+1, n): Q[i,j] += 2*P*w[i]*w[j] return Q
Quantum Computing · ✓ Success
Map logical qubits to physical qubits on a hardware graph such that all two-qubit gates act on adjacent physical qubits, minimising the total SWAP overhead. Variables $x_{lp}=1$ if logical qubit $l$ is mapped to physical qubit $p$.
def build_qubo(instance): L = instance["n_logical"] P = instance["n_physical"] hw = set(map(tuple, instance["hw_edges"])) gates = instance["circuit_edges"] n = L * P; P1 = 10; P2 = 5 Q = np.zeros((n, n)) # one-hot constraints … return Q
Finance · ✓ Success
Select exactly $k$ assets from a universe of $n$ to maximise expected return $\mu^Tx$ while minimising portfolio variance $x^T\Sigma x$. The cardinality constraint $\sum_i x_i = k$ is enforced as a penalty.
$\lambda$ trades off return vs. risk; $P$ enforces the cardinality constraint.
def build_qubo(instance): mu = np.array(instance["returns"]) Sigma = np.array(instance["covariance"]) k, lam = instance["k"], instance["lambda"] n = len(mu); P = float(np.max(np.abs(mu))) * n Q = lam * Sigma.copy() for i in range(n): Q[i,i] += -mu[i] + P*(1-2*k) for j in range(i+1,n): Q[i,j] += 2*P return Q
If you use QuantumQUBO Agent in your research, please cite our paper. For the benchmark dataset, also cite QUBOBench.