QUBO matrix to Ising Hamiltonian
Here we discuss how the matrix formulation of a QUBO problem maps to a Ising Hamiltonian.
Example
To explain how to solve the problem with QAOA, let us use a simple example. Consider minimizing the following 2x2 QUBO objective function:
The function is minimized by \((x_1, \ x_2)=(1,0)\), and the corresponding objective function value is -5.
The weights are: \([ \ w_{12}=-4, \ w_{11} = -5, \ w_{22}=6 \ ]\).
We first convert the objective function to an Ising Hamiltonian using the following mapping:
We call the objective function mapped to a Ising model a QUBO Hamiltonian:
which simplifies to
The problem can be solved by finding the minimum of
which corresponds to the computational state \(\ket{10}\) and equals to -5, including the offset term \(-\frac{1}{2}I\).
The QUBO Hamiltonian is composed of single and two-qubit \(Z\)-Pauli terms. The weights of these terms are a linear combination of the weights \(w\) of the QUBO objective function Q and can be easily derived.
We label them \(\nu\). In this example, they are: \([ \ \nu_{22} = -2, \ \nu_{11} = 7/2, \ \nu_{12} = -1 \ ].\)
Formula
Any QUBO problem can be written, without loss of generality, in the following symmetric matricial form:
This is possible because \(x_i=x_i^2\) and because \(x_i\) and \(x_j\) commute. Using the binary-to-Ising mapping defined above, we obtain the following Hamiltonian:
Therefore, we have:
Validation on the example above: