Quadratic Unconstrained Binary Optimization (QUBO)

#quantum #qcobalt

Part of Womanium Quantum + AI 2024 program


Definition

Quadratic unconstrained binary optimization is an optimization technique where the problem to be optimized is described using a binary quadratic model.

Binary quadratic models are mathematical models used to describe problems based on their objectives and constraints. These models can be represented as function where the goal of the optimization is to minimize or maximize this function.

A binary quadratic model contains linear and quadratic terms and its objective function can be mathematically represented as:

f(x)=iaixi+i<jbixixj

The first part of the function represents the linear terms and the second part represent the quadratic terms.

When optimizing the objective function it's commonly set such that the function is minimized, however if we needed to maximize our function we can simply negate all of the coefficients then minimize it.

maxf(x)=min(f(x))

Matrix Representation

An objective function can be mapped such that it's represented as a matrix. The matrix can be constructed in an upper-triangular form or in a symmetric form.

A matrix of the objective function f(x) can be constructed as:

Q=[ax1ax1x2ax1x3ax1xn0ax2ax2x3ax2xn00ax3ax3xn000axn]

Where ay is the coefficient of the term y.

Note

Note that all the coefficients of linear terms fall along the main diagonal of the matrix, while the coefficients of quadratic terms are in the upper-right section.

Now that we have the objective function represented as a matrix, we define x as a vector for to be applied to the matrix.

x=[x1x2xn]

Finally we define optimizing the objective function as:

minx{0,1}nxTQxxTQx=[x1x2xn][ax1ax1x2ax1xn0ax2ax2xn00axn][x1x2xn]=[ax1x1ax2x2+ax1x2x1xnaxn+ax1xnx1++axn1xnxn1][x1x2xn]=[(ax1x12)+(ax2x22+ax1x2x1x2)++(xnaxn2+ax1xnx1xn++axn1xnxn1xn)]

But since x is a vector of binary variables we know that:

x={01x2={02=012=1x2=x[(ax1x12)+(ax2x22+ax1x2x1x2)++(xnaxn2+ax1xnx1xn++axn1xnxn1xn)]=[(ax1x1)+(ax2x2+ax1x2x1x2)++(xnaxn+ax1xnx1xn++axn1xnxn1xn)]=[iaxixi+i<jaxixjxixj]

This proves that the matrix representation of the objective function is equivalent to the function representation.

Examples

Example 1

Find the values of each xi that will minimize the following function:

f(x)=5x1+7x1x23x2

We try all 22 possible combinations of x1 and x2 to find the smallest value of f(x).

x1=0,x2=1 minimizes the function and results in 3.

Example 2

Represent the following objective functions in a matrix form.

minf(x)=5x1+7x1x23x2Q=[5703]

Solving a Quadratic Unconstrained Binary Optimization Problem

The simplest way to solve a QUBO problem is to iterate over all possible values of the vector ( x ) and compute the function result:

result=xTQx

By keeping track of the vector that achieves the minimum result, we obtain the solution at the end.

This approach has a classical complexity of O(2n), where n is the number of binary variables.


< Prev