Skip to main content

QAOA

The Max-Cut Problem​

  • Goal: To partition the vertices of a graph into two sets such that the number of edges between the two sets is maximized.
  • The Max-Cut problem is a NP-hard problem.
  • Binary representation: For each vertex ii, define a binary variable xix_i, where xi=1x_i = 1 if ii belongs to one set, and xi=0x_i = 0 if ii belongs to the other set. For each edge (i,j)(i,j), it contributes to the cut if xi≠xjx_i \neq x_j.

QUBO Formulation​

  • The MaxCut objective function is exressed as:
    Maximize ∑(i,j)∈Ewij(1−xixj)\sum_{(i,j) \in E} w_ij (1 - x_i x_j)

Hamiltonian​

Using the substitution, xi=1−Zi2x_i = \frac{1 - Z_i}{2}, we can formulate the equtaion:

H^MaxCut=∑(i,j)∈EI−ZiZj2=−12∑(i,j)∈E(ZiZj)+12∣E∣I\begin{aligned} \hat{H}MaxCut &= \sum_{(i,j) \in E} \frac{I - Z_i Z_j}{2} \\ &= -\frac{1}{2} \sum_{(i,j) \in E} (Z_i Z_j) + \frac{1}{2} |E| I \\ \end{aligned}

Where ∣E∣|E| is the size of the edge

The Minimum Vertex Cover Problem​

  • Goal: To find the smallest set of vertices such that each edge in the graph has at least one endpoint in the set.
  • Binary Representation: For each vertex jj, xj=1x_j=1 if jj is in the vertex cover, and xj=0x_j=0 otherwise

QUBO Formulation​

Minimize ∑j∈Vxj\sum_{j \in V}{x_j},
for all (i,j)(i,j) in Edge EE , xi+xj≥1x_i + x_j \geq 1

For the constraint of MVC, we using the penalty function: P(1−x−y+xy)P(1-x-y+xy)

The penalty function can convert a constrinat problem to an unconstrained problem
The unconstrained alternative for MVC is (PP: Penalty Coefficient, wjw_j: weight to vertex jj, usually wj=1w_j = 1):

Minimize∑j∈Vwjxj+P(∑(i,j)∈E(1−xi−xj+xixj))\begin{aligned} \text{Minimize} & \sum_{j \in V}{w_j x_j} + & P\left(\sum_{(i,j)\in E} (1 - x_i - x_j + x_i x_j)\right) \end{aligned}

Hamiltonian​

Substitute xi=1−Zi2x_i = \frac{1 - Z_i}{2}, we can get the Hamiltonian for MVC:

y=∑j∈V(1−zj)wj2+P∑(i,j)∈E[1−1−zj2−1−zi2+1−zj21−zi2]=∣V∣wj2−∑j∈Vwjzj2+P∑(i,j)∈E[1−12+zj2−12+zi2+1−zi−zj+zizj4]=∣V∣wj2−∑j∈Vwjzj2+P∑(i,j)∈E[1+zizj+zi+zj4]\begin{aligned} y &= \sum_{j\in V} \frac{(1-z_j)w_j}{2} + P \sum_{(i,j)\in E} \left[1-\frac{1-z_j}{2}-\frac{1-z_i}{2}+\frac{1-z_j}{2}\frac{1-z_i}{2}\right] \\ &= \frac{|V|w_j}{2} - \sum_{j\in V}w_j\frac{z_j}{2} + P \sum_{(i,j)\in E} \left[1-\frac{1}{2}+\frac{z_j}{2}-\frac{1}{2}+\frac{z_i}{2}+\frac{1-z_i-z_j+z_iz_j}{4}\right] \\ &= \frac{|V|w_j}{2} - \sum_{j\in V}w_j\frac{z_j}{2} + P \sum_{(i,j)\in E} \left[\frac{1+z_iz_j+z_i+z_j}{4}\right] \end{aligned}

Then we have:

H^MVC=−∑j∈VwjZj2+P∑(i,j)∈E[ZiZj+Zi+Zj4]+∣V∣wj2I+∣E∣P4I\hat{H}_\text{MVC} = -\sum_{j\in V} w_j \frac{Z_j}{2} + P \sum_{(i,j)\in E} \left[\frac{Z_iZ_j + Z_i + Z_j}{4}\right] + \frac{|V|w_j}{2}\mathbb{I} + \frac{|E|P}{4}\mathbb{I}

where ∣V∣|V| is the number of vertices, ∣E∣|E| is the number of edges.

QUBO and Ising Model​

The Ising Model is a mathematicla formulation used in quantum systems to encode Optimization Problems.

  • For a single qubit, energy can be encoded using Z gate:
    • Z gate: Assigns +1 energy for the state ∣0⟩\ket{0} and -1 energy for the state ∣1⟩\ket{1}.
  • For multiple qubits, interactions are defined using Ising couplings between qubits:
    • ZiZiZ_i Z_i interactions for two qubits:
      • +1 for states ∣00⟩\ket{00} or ∣11⟩\ket{11}
      • -1 for states ∣01⟩\ket{01} or ∣10⟩\ket{10} The total energy of the system is determined by these couplings.

The objective in QUBO is to minimize a cost function of the from:

E(x1,x2,...,xn)=∑incixi+∑i,jnQijxixjE(x_1, x_2, ..., x_n) = \sum_{i}^n c_i x_i + \sum_{i,j}^n Q_ij x_i x_j
where xix_i are binary variables (0 or 1)

  • This cost function can be mapped to the Ising Hamiltonian:
    • xi=1−Zi2x_i = \frac{1 - Z_i}{2}
      ziz_i is the Pauli z operator