Quadratic unconstrained binary optimization (QUBO), also known as unconstrained binary quadratic programming (UBQP), is a combinatorial optimization problem with a wide range of applications from finance and economics to machine learning. QUBO is an NP hard problem, and for many classical problems from theoretical computer science, like maximum cut, graph coloring and the partition problem, embeddings into QUBO have been formulated. Embeddings for machine learning models include support-vector machines, clustering and probabilistic graphical models. Moreover, due to its close connection to Ising models, QUBO constitutes a central problem class for adiabatic quantum computation, where it is solved through a physical process called quantum annealing.

## Definition

Let $f_{Q}:\mathbb {B} ^{n}\rightarrow \mathbb {R}$ be a quadratic polynomial over binary variables,

$f_{Q}(x)=\sum _{i=1}^{n}\sum _{j=1}^{i}q_{ij}x_{i}x_{j}$ with $x_{i}\in \mathbb {B}$ for $i\in [n]$ and coefficients $q_{ij}\in \mathbb {R}$ for $1\leq j\leq i\leq n$ . Here $[n]$ denotes the set of strictly positive integers less or equal to $n$ , and $\mathbb {B} =\lbrace 0,1\rbrace$ . The QUBO problem consists of finding a binary vector $x^{*}$ that is minimal with respect to $f_{Q}$ among all other binary vectors, namely

$x^{*}={\underset {x\in \mathbb {B} ^{n}}{\arg \min }}~f_{Q}(x)$ Sometimes, QUBO is defined as a maximization instead of a minimization problem, which has no effect on the problem's complexity class, as maximizing $f_{Q}$ is the same as minimizing $f_{-Q}=-f_{Q}$ (see below). Another, more compact way to formulate $f_{Q}$ is using matrix notation,

$f_{Q}(x)=x^{\top }Qx$ where $Q\in \mathbb {R} ^{n\times n}$ is the symmetric $n\times n$ matrix containing the coefficients $q_{ij}$ .

## Properties

• Multiplying the coefficients $q_{ij}$ with a positive factor $\alpha >0$ scales the output of $f$ accordingly, leaving the optimum $x^{*}$ unchanged:
$f_{\alpha Q}(x)=\sum _{i\leq j}(\alpha q_{ij})x_{i}x_{j}=\alpha \sum _{i\leq j}q_{ij}x_{i}x_{j}=\alpha f_{Q}(x)$ • Flipping the sign of all coefficients flips the sign of $f$ 's output, making $x^{*}$ the binary vector that maximizes $f_{-Q}$ :
$f_{-Q}(x)=\sum _{i\leq j}(-q_{ij})x_{i}x_{j}=-\sum _{i\leq j}q_{ij}x_{i}x_{j}=-f_{Q}(x)$ • If all coefficients are positive, the optimum is trivially $x^{*}=(0,\dots ,0)$ . Similarly, if all coefficients are negative, the optimum is $x^{*}=(1,\dots ,1)$ .
• If $\forall i\neq j:~q_{ij}=0$ , then the corresponding QUBO problem is solvable in ${\mathcal {O}}(n)$ , the optimal variable assignments $x_{i}^{*}$ simply being 1 if $q_{ii}<0$ and 0 otherwise.

## Connection to Ising models

QUBO is very closely related and computationally equivalent to the Ising model, whose Hamiltonian function is defined as

$H(\sigma )=-\sum _{\langle i~j\rangle }J_{ij}\sigma _{i}\sigma _{j}-\mu \sum _{j}h_{j}\sigma _{j}$ with real-valued parameters $h_{j},J_{ij},\mu$ for all $i,j$ . The spin variables $\sigma _{j}$ are binary with values from $\lbrace -1,+1\rbrace$ instead of $\mathbb {B}$ . Moreover, in the Ising model the variables are typically arranged in a lattice where only neighboring pairs of variables $\langle i~j\rangle$ can have non-zero coefficients. Applying the identity $\sigma \mapsto 2x-1$ yields an equivalent QUBO problem:

{\begin{aligned}f(x)&=\sum _{\langle i~j\rangle }-J_{ij}(2x_{i}-1)(2x_{j}-1)+\sum _{j}\mu h_{j}(2x_{j}-1)\\&=\sum _{\langle i~j\rangle }-4J_{ij}x_{i}x_{j}+2J_{ij}x_{i}+2J_{ij}x_{j}-J_{ij}+\sum _{j}2\mu h_{j}x_{j}-\mu h_{j}&&{\text{using }}x_{j}=x_{j}x_{j}\\&=\sum _{i=1}^{n}\sum _{j=1}^{i}q_{ij}x_{i}x_{j}+C\end{aligned}} where

{\begin{aligned}q_{ij}&={\begin{cases}-4J_{ij}&{\text{if }}i\neq j\\\sum _{\langle k~i\rangle }2J_{ki}+\sum _{\langle i~\ell \rangle }2J_{i\ell }+2\mu h_{i}&{\text{if }}i=j\end{cases}}\\C&=-\sum _{\langle i~j\rangle }J_{ij}-\sum _{j}\mu h_{j}\end{aligned}} As the constant $C$ does not change the position of the optimum $x^{*}$ , it can be neglected during optimization and is only important for recovering the original Hamiltonian function value.