To be continued

Quantum Approximation Optimization Algorithm (QAOA)

In this note, I will first introduce the basic idea of QAOA and some of explicit applications of QAOA. This note is organized in the following way:

  • The basic idea of QAOA
  • Applicate into several problem
    1. Max Cut Problem
    2. Traverse Ising model
    3. The binary linear least squares (BLLS) problem
  • Development for QAOA

    1. Relation to the Quantum Adiabatic
    2. From the QAOA to a Quantum Alternating Operator Ansatz

Since QAOA is an approximation algorithm, it does not deliver the 'best' result, but rather the 'good enough' one, characterized by a lower bound of the approximation ratio.

Reference

  1. An Introduction to Quantum Optimization Approximation Algorithm. Qingfeng Wang, Tauqir Abdullah 2018
  2. Quantum approximate optimization for hard problems in linear algebra. Ajinkya Borle, Vincent E. Elfving and Samuel J. Lomonaco. SciPost Phys. Core 4, 031 (2021)
  3. Application of the quantum approximate optimization algorithm to combinatorial optimization problems. PONTUS VIKSTÅL, 2020

1. The basic idea of QAOA

The basic idea of Quantum Approximation Optimization Algorithm (QAOA)

  1. The solution to the problem are encoded into the quantum state ψ(βopt ,γopt )\left|\psi\left(\boldsymbol{\beta}_{\text {opt }}, \boldsymbol{\gamma}_{\text {opt }}\right)\right\rangle
  2. We uses a unitary U(β,γ)U(\boldsymbol{\beta}, \boldsymbol{\gamma}) to prepare a quantum state ψ(β,γ)|\psi(\boldsymbol{\beta}, \gamma)\rangle.
  3. The goal of the algorithm is to find optimal parameters (βopt ,γopt)\left(\beta_{\text {opt }}, \gamma_{o p t}\right)
    • This part of the optimization is performed by a classical computer

This algorithm is based on two unitaries U(C,γ),U(B,β)U(C, \gamma), U(B, \beta) and an integer p1p \geq 1.

  • The two unitaries corresponds to some rotations on our qubits
  • The integer pp denotes the depth of our circuit.

The first unitary operator depends on an angle γ\gamma and a Hamiltonian of cost function U(C,γ)=eiγH^C=(i,j)EeiγH^Cij U(C, \gamma)=e^{-i \gamma \hat{H}_C}=\prod_{(i, j) \in E} e^{-i \gamma \hat{H}_{C \langle i j\rangle}} where

  • γ\gamma lies between 0 and 2π2 \pi.
  • H^C=121i<jnwij(1sisj)\hat{H}_C=\frac{1}{2} \sum_{1 \leq i<j \leq n} w_{i j}\left(1-s_i s_j\right) The Hamiltonian of cost function encode the problem

The second unitary operator depends on an angle γ\gamma and a Hamiltonian H^B\hat{H}_B
U(B,β)=eiβB=eiβj=1nσjx=j=1neiβσjx \begin{aligned} U(B, \beta)=& e^{-i \beta B} \\=& e^{-i \beta \sum_{j=1}^n \sigma_j^x}\\=&\prod_{j=1}^n e^{-i \beta \sigma_j^x} \end{aligned} where

  • choosing H^B\hat{H}_B to be H^B=iσ^ix\hat{H}_B=\sum_i \hat{\sigma}_i^x

The total evolution operator become U^(β,γ)=k=1pU(βk)U(γk)=k=1peiβkH^BeiγkH^C \begin{aligned} \hat{U}(\boldsymbol{\beta}, \boldsymbol{\gamma}) &=\prod_{k=1}^pU(\beta_k) U(\gamma_k) \\&=\prod_{k=1}^p \mathrm{e}^{-\mathrm{i} \beta_k \hat{H}_B} \mathrm{e}^{-\mathrm{i} \gamma_k \hat{H}_C} \end{aligned} where

  • for each level kk we apply the unitary U(C,γk)U\left(C, \gamma_k\right) followed by the unitary U(B,βk)U\left(B, \beta_k\right)
  • total number of level are pp

the final variational "QAOA" state is obtained

ψp(γ,β)=U(B,βp)U(C,γp)U(B,β2)U(C,γ2)U(B,β1)U(C,γ1)+n \left|\psi_p(\vec{\gamma}, \vec{\beta})\right\rangle =U\left(B, \beta_p\right) U\left(C, \gamma_p\right) \cdots U\left(B, \beta_2\right) U\left(C, \gamma_2\right) U\left(B, \beta_1\right) U\left(C, \gamma_1\right)|+\rangle^{\otimes n} where

  • the state depends on the angles γ=(γ1,γ2,,γp)\vec{\gamma}=\left(\gamma_1, \gamma_2, \ldots, \gamma_p\right) and β=(β1,β2,,βp)\vec{\beta}=\left(\beta_1, \beta_2, \ldots, \beta_p\right)
  • The starting state is the superposition of all possible states in the computational basis with equal probability

+nHn0n=12nz{0,1}nz |+\rangle^{\otimes n} \equiv H^{\otimes n}|0\rangle^{\otimes n}=\frac{1}{\sqrt{2^n}} \sum_{z \in\{0,1\}^n}|z\rangle

The expectation value of H^C\hat{H}_C in this state Fp(γ,β)ψp(γ,β)H^Cψp(γ,β) F_p(\vec{\gamma}, \vec{\beta}) \equiv\left\langle\psi_p(\vec{\gamma}, \vec{\beta})\left|\hat{H}_C\right| \psi_p(\vec{\gamma}, \vec{\beta})\right\rangle Let MpM_p be the maximum of FmaxF_{\max } over the angles Fmax=maxγ,βFp(γ,β) F_{\max } =\max _{\vec{\gamma}, \vec{\beta}} F_p(\vec{\gamma}, \vec{\beta}) To maximize the expectation value above, find good angles γ=(γ1,γ2,,γp)\vec{\gamma}=\left(\gamma_1, \gamma_2, \ldots, \gamma_p\right) and β=(β1,β2,,βp)\vec{\beta}=\left(\beta_1, \beta_2, \ldots, \beta_p\right) by querying a classical optimizer. Several classical optimizers has been implemented.

  1. Gradient descent arXiv:2004.04197
  2. Bayesian optimization DOI: 10.1109/JPROC.2015.2494218
  3. Nelder-mead https://doi.org/10.1093/comjnl/7.4.308

2. Application

  1. Max Cut Problem
  2. Traverse Ising model
  3. The binary linear least squares (BLLS) problem

2.1. Max Cut Problem

Consider cost function CC as a operator, then act on the basis state z|z\rangle Cz=jkCjk(z)z=C(z)z C|z\rangle=\sum_{\langle j k\rangle} C_{\langle j k\rangle}(z)|z\rangle=C(z)|z\rangle where Cjkz=12(sjsk+I)z={z, if edge jk is a cut, that is, sjskz=I0, if edge jk is not a cut, that is, sjskz=I \begin{aligned} C_{\langle j k\rangle}|z\rangle=&\frac{1}{2}\left(-s_j \otimes s_k+I\right)|z\rangle \\=& \begin{cases}|z\rangle, & \text { if edge }\langle j k\rangle \text { is a cut, that is, } s_j \otimes s_k|z\rangle=-I \\ 0, & \text { if edge }\langle j k\rangle \text { is not a cut, that is, } s_j \otimes s_k|z\rangle=I\end{cases} \end{aligned}

To be continued

2.2. Traverse Ising model

Traverse filed Ising model (TFIM) describe 1D chain with nn interacting spin, the Hamiltonian of the model H=j=1nJjσjzσj+1z+j=1nhjσjx H=\sum_{j=1}^n J_j \sigma_j^z \sigma_{j+1}^z+\sum_{j=1}^n h_j \sigma_j^x where

  • interacting strength JjJ_j
  • the external magnetic field hjh_j
  • σjz\sigma_j^z and σjx\sigma_j^x are Pauli matrixs

To solve traverse filed Ising model with QAOA, we use the Hamiltonian of TFIM as H^C\hat{H}_C H^C=H^ \hat{H}_C=\hat{H} Thus eiγHC=eiγH=eiγ(j=1nσjzσj+1z+j=1nσjx)=eiγj=1nσjxeiγj=1nσjzσj+1z \begin{aligned} e^{-i \gamma H_C} &=e^{-i \gamma H}\\ &=e^{-i \gamma\left(\sum_{j=1}^n \sigma_j^z \sigma_{j+1}^z+\sum_{j=1}^n \sigma_j^x\right)} \\ &=e^{-i \gamma \sum_{j=1}^n \sigma_j^x} e^{-i \gamma \sum_{j=1}^n \sigma_j^z \sigma_{j+1}^z} \end{aligned} Choosing H^B\hat{H}_B to be H^B=jσ^jx \hat{H}_B=\sum_j \hat{\sigma}_j^x evolution operator become U^=U(β)U(γ)=eiβH^BeiγH^C=(eiβj=1nσjx)(eiγj=1nσjxeiγj=1nσjzσj+1z)=ei(β+γ)j=1nσjxeiγj=1nσjzσj+1z=eiβj=1nσjxeiγj=1nσjzσj+1z \begin{aligned} \hat{U}&=U(\beta) U(\gamma) \\&=e^{-i \beta \hat{H}_B} e^{-i \gamma \hat{H}_C} \\&=\left(e^{-i \beta \sum_{j=1}^n \sigma_j^x}\right)\left(e^{-i \gamma \sum_{j=1}^n \sigma_j^x} e^{ -i \gamma \sum_{j=1}^n \sigma_j^z \sigma_{j+1}^z }\right) \\ &=e^{-i(\beta+\gamma) \sum_{j=1}^n \sigma_j^x} e^{-i \gamma \sum_{j=1}^n \sigma_j^z \sigma_{j+1}^z} \\ &=e^{-i \beta^{\prime} \sum_{j=1}^n \sigma_j^x} e^{-i \gamma \sum_{j=1}^n \sigma_j^z \sigma_{j+1}^z} \end{aligned} where

  • denote β=β+γ\beta^{\prime}=\beta+\gamma as new β\beta

The expectation value contains two parts. H=ψj=1nσjzσj+1z+j=1nσjxψ=ψj=1nσjzσj+1zψ+ψj=1nσjzσj+1zψ=H1+H2 \begin{aligned} \langle H\rangle &= \langle\psi |\sum_{j=1}^n \sigma_j^z \sigma_{j+1}^z+\sum_{j=1}^n \sigma_j^x | \psi \rangle \\ &= \langle\psi |\sum_{j=1}^n \sigma_j^z \sigma_{j+1}^z | \psi \rangle+ \langle\psi |\sum_{j=1}^n \sigma_j^z \sigma_{j+1}^z | \psi \rangle \\ &=\left\langle H_1\right\rangle+\left\langle H_2\right\rangle \end{aligned}

2.2.1. example: 2-qubit system

The general form of final state of 2-qubit system ψ=a0000+a0101+a1010+a1111 |\psi\rangle=a_{00}|00\rangle+a_{01}|01\rangle+a_{10}|10\rangle+a_{11}|11\rangle where

  • The coefficients {a00,a01,a10,a01}\left\{a_{00}, a_{01}, a_{10}, a_{01}\right\} are given by the probability distribution from the circuit result.

The expectation value of first part. ψH1ψ=ψj=01σ0zσ1zψ=(a0000+a0101+a1010+a1111)(σ0zσ1z+σ1zσ0z)(a0000+a0101+a1010+a1111)=(a0000+a0101+a1010+a1111)σ0zσ1z(a0000+a0101+a1010+a1111)+(a0000+a0101+a1010+a1111)σ1zσ0z(a0000+a0101+a1010+a1111)=(a0000+a0101+a1010+a1111)(a0000a0101a1010+a1111)+(a0000+a0101+a1010+a1111)(a0000a0101a1010+a1111)=2(a002a012a102+a012) \begin{aligned} \left\langle\psi\left|H_1\right| \psi\right\rangle=& \langle\psi |\sum_{j=0}^1 \sigma_0^z \sigma_1^z | \psi \rangle \\ =&\left(a _ { 0 0 } \left\langle0 0 \left|+a_{01}\left\langle0 1 \left|+a_{10}\left\langle 10\left|+a_{11}\langle 11|\right) \left(\sigma_0^z \sigma_1^z+\sigma_1^z \sigma_0^z\right) \left(a_{00}|00\rangle+a_{01}|01\rangle+a_{10}|10\rangle+a_{11} \mid 11\right\rangle \right) \right.\right.\right.\right.\right.\\ =&\left(a _ { 0 0 } \left\langle0 0 \left|+a_{01}\left\langle0 1 \left|+a_{10}\left\langle 10\left|+a_{11}\langle 11|\right) \sigma_0^z \sigma_1^z\left(a_{00}|00\rangle+a_{01}|01\rangle+a_{10}|10\rangle+a_{11} \mid 11\right)\right\rangle\right.\right.\right.\right.\right.\\ &+\left(a _ { 0 0 } \left\langle0 0 \left|+a_{01}\left\langle0 1 \left|+a_{10}\left\langle 10\left|+a_{11}\langle 11|\right) \sigma_1^z \sigma_0^z\left(a_{00}|00\rangle+a_{01}|01\rangle+a_{10}|10\rangle+a_{11} \mid 11\right)\right\rangle\right.\right.\right.\right.\right.\\ =&\left(a _ { 0 0 } \left\langle0 0 \left|+a_{01}\left\langle0 1 \left|+a_{10}\left\langle 10\left|+a_{11}\langle 11|\right)\left(a_{00}|00\rangle-a_{01}|01\rangle-a_{10}|10\rangle+a_{11} \mid 11\right)\right\rangle\right.\right.\right.\right.\right.\\ &+\left(a _ { 0 0 } \left\langle0 0 \left|+a_{01}\left\langle0 1 \left|+a_{10}\left\langle 10\left|+a_{11}\langle 11|\right)\left(a_{00}|00\rangle-a_{01}|01\rangle-a_{10}|10\rangle+a_{11} \mid 11\right)\right\rangle\right.\right.\right.\right.\right.\\ =& 2\left(a_{00}^2-a_{01}^2-a_{10}^2+a_{01}^2\right) \end{aligned} For second part, we apply HH gate to the circuit to get the new state Hψ=H(a0000+a0101+a1010+a1111)=(a00+a01+a10+a11)00+(a00a01+a10a11)01+(a00+a01a10a11)10+(a00a01a10+a11)11=b0000+b0101+b1010+b1111 \begin{aligned} H|\psi\rangle =& H \left(a_{00}|00\rangle+a_{01}|01\rangle+a_{10}|10\rangle+a_{11}|11\rangle\right) \\= &\left(a_{00}+a_{01}+a_{10}+a_{11}\right)|00\rangle \\&+\left(a_{00}-a_{01}+a_{10} -a_{11}\right)|01\rangle \\& +\left(a_{00}+a_{01}-a_{10}-a_{11}\right)|10\rangle \\&+\left(a_{00}-a_{01}-a_{10}+a_{11}\right)|11\rangle \\= & b_{00}|00\rangle+b_{01}|01\rangle+b_{10}|10\rangle+b_{11}|11\rangle \end{aligned} where we denote

  • b00=(a00+a01+a10+a11)b_{00}=\left(a_{00}+a_{01}+a_{10}+a_{11}\right)
  • b01=(a00a01+a10a11)b_{01}=\left(a_{00}-a_{01}+a_{10}-a_{11}\right)
  • b10=(a00+a01a10a11)b_{10}=\left(a_{00}+a_{01}-a_{10}-a_{11}\right)
  • b11=(a00a01a10+a11)b_{11}=\left(a_{00}-a_{01}-a_{10}+a_{11}\right)

The HH gate also make σxHσz\sigma^x \stackrel{H}{\longrightarrow} \sigma^z, Thus the expectation value of second part. H2=(b0000+b0101+b1010+b1111)(σ0z+σ1z)(b0000+b0101+b1010+b1111)=(b0000+b0101+b1010+b1111)(σ0z)(b0000+b0101+b1010+b1111)+(b0000+b0101+b1010+b1111)(σ1z)(b0000+b0101+b1010+b1111)=b002+b012b102b112+b002b012+b102b112=2b0022b112=2(a00a01+a00a10+a11a01+a11a10) \begin{aligned} \left\langle H_2\right\rangle=&\left(b _ { 0 0 } \left\langle0 0 \left|+b_{01}\left\langle0 1 \left|+b_{10}\left\langle 10\left|+b_{11}\langle 11|\right)\left(\sigma_0^z+\sigma_1^z\right)\left(b_{00}|00\rangle+b_{01}|01\rangle+b_{10}|10\rangle+b_{11}|11\rangle\right)\right.\right.\right.\right.\right.\right.\\ =&\left(b _ { 0 0 } \left\langle0 0 \left|+b_{01}\left\langle0 1 \left|+b_{10}\left\langle 10\left|+b_{11}\langle 11|\right)\left(\sigma_0^z\right)\left(b_{00}|00\rangle+b_{01}|01\rangle+b_{10}|10\rangle+b_{11}|11\rangle\right)\right.\right.\right.\right.\right.\right.\\ &+\left(b _ { 0 0 } \left\langle0 0 \left|+b_{01}\left\langle0 1 \left|+b_{10}\left\langle 10\left|+b_{11}\langle 11|\right)\left(\sigma_1^z\right)\left(b_{00}|00\rangle+b_{01}|01\rangle+b_{10}|10\rangle+b_{11}|11\rangle\right)\right.\right.\right.\right.\right.\right.\\ =& b_{00}^2+b_{01}^2-b_{10}^2-b_{11}^2+b_{00}^2-b_{01}^2+b_{10}^2-b_{11}^2 \\ =& 2 b_{00}^2-2 b_{11}^2 \\ =& 2\left(a_{00} a_{01}+a_{00} a_{10}+a_{11} a_{01}+a_{11} a_{10}\right) \end{aligned} In last step, we transform notation from bb to aa. We can find this result is the same with H2=(a0000+a0101+a1010+a1111)(σ0x+σ1x)(a0000+a0101+a1010+a1111)=2(a00a01+a00a10+a11a01+a11a10) \begin{aligned} \left\langle H_2\right\rangle &=\left(a _ { 0 0 } \left\langle0 0 \left|+a_{01}\left\langle0 1 \left|+a_{10}\left\langle 10\left|+a_{11}\langle 11|\right)\left(\sigma_0^x+\sigma_1^x\right)\left(a_{00}|00\rangle+a_{01}|01\rangle+a_{10}|10\rangle+a_{11} \mid 11\right)\right\rangle\right.\right.\right.\right.\right.\\ &=2\left(a_{00} a_{01}+a_{00} a_{10}+a_{11} a_{01}+a_{11} a_{10}\right) \end{aligned} Which we calculate directly without change of basis.

2.3. BLLS problem

Reference

  • Quantum approximate optimization for hard problems in linear algebra. Ajinkya Borle, Vincent E. Elfving and Samuel J. Lomonaco. SciPost Phys. Core 4, 031 (2021)

The binary linear least squares (BLLS) problem

3. Development

3.1. History

  1. QAOA was first proposed by Farhi etal in 2014. (arXiv:1411.4028)
    • they applied QAOA on MaxCut problem
    • they showed the complexity of problem depends on pp rather than nn.
    • they showed the relationship between QAOA and quantum adiabatic algorithm (QAA)
  2. QAOA can exhibit a form of Quantum Supremacy. 2016 (arXiv:1602.07674)

To be continued

results matching ""

    No results matching ""