A full tutorial on QAOA algorithm without leave-it-as-an-exercise-for-reader


This is not finished.
2020-07-30 first commit

The problem definition

Traverse field Ising model

Adibatic quantum computation

Circuit design

Coding

Trival state preparation

After several days of thinking and researching, I decided to answer my own question.

N.B. The tensor product symbol \otimes are omitted when there is no risk in confusion, especially when the index is different. In symbol,

A_iB_j = A_i \otimes B_j (i \neq j).

Firstly, for case

e^{i \beta B} Z_i Z_j e^{-i \beta B},

we only consider qubit j, in which B_e=\sum_{k \in e}{X_k}. As X_i and X_j act on different qubits,

e^{i{(X_i+X_j)}}=e^{i((X_i\otimes I_j)+(I_i \otimes X_j))}=e^{iX_i}e^{iX_j}.

Now,

(1)   \begin{align*}e^{-i \beta X}& = e^{-i \beta \begin{bmatrix}0 & 1\\ 1 & 0\end{bmatrix}} \\& = e^{-i \beta \begin{bmatrix}\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}}\\ \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}}\end{bmatrix}\begin{bmatrix}1 & 0\\ 0 & 1\end{bmatrix}\begin{bmatrix}\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}}\\ \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}}\end{bmatrix}} \\& = \begin{bmatrix}\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}}\\ \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}}\end{bmatrix}\begin{bmatrix}e^{-i \beta} & 0\\ 0 & e^{-i \beta}\end{bmatrix}\begin{bmatrix}\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}}\\ \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}}\end{bmatrix} \\& = \begin{bmatrix}\cos(\beta) & -i\sin(\beta)\\ -i\sin(\beta) & \cos(\beta)\end{bmatrix} \\& = I\cos(\beta)-iX\sin(\beta).\end{align*}

Thus,

(2)   \begin{align*}e^{i \beta X}& = I\cos(\beta)+iX\sin(\beta).\end{align*}

Hence,

(3)   \begin{align*}e^{i \beta X} Z e^{-i \beta X} & = (I\cos(\beta)+iX\sin(\beta))Z(I\cos(\beta)-iX\sin(\beta)) \\& = Z \cos(2\beta) + Y\sin(2\beta).\end{align*}

For the Ising traverse field Hamiltonian, we only consider
G_{e=(i,k)}=Z_iZ_k.

For e^{i \gamma Z_iZ_k}, it can be evaluated as

(4)   \begin{align*}e^{i \gamma Z_iZ_k} &= e^{i \gamma \begin{bmatrix}1&&&\\&-1&&\\&&-1&\\&&&1\end{bmatrix}} \\& = \begin{bmatrix}e^{i\gamma}&&&\\&e^{-i\gamma}&&\\&&e^{-i\gamma}&\\&&&e^{i\gamma}\end{bmatrix} \\& = \begin{bmatrix}\cos\gamma+i\sin\gamma &&&\\&\cos\gamma-i\sin\gamma&&\\&&\cos\gamma-i\sin\gamma&\\&&&\cos\gamma+i\sin\gamma\end{bmatrix} \\& = \cos\gamma\begin{bmatrix}1&&&\\&1&&\\&&1&\\&&&1\end{bmatrix}+i\sin\gamma\begin{bmatrix}1&&&\\&-1&&\\&&-1&\\&&&1\end{bmatrix} \\& = I_i I_k \cos\gamma + i Z_1Z_2 \sin\gamma.\end{align*}


We can calculate two-qubit operations independently, such that

Y_i (Z_i Z_k) = (Y_i \otimes I_k)(Z_i \otimes Z_k)=(Y_i Z_i) \otimes (I_kZ_k) = i X_i \otimes Z_k = i X_i Z_k.

Numerically, if you cannot convince yourself,

Y_i \otimes I_k = \begin{bmatrix} &&-i&\\&&&-i\\i&&&\\&i&& \end{bmatrix}

and

Z_i \otimes Z_k = \begin{bmatrix} 1&&&\\&-1&&\\&&-1&\\&&& 1\end{bmatrix}

and

(Y_i \otimes I_k)(Z_i \otimes Z_k) = \begin{bmatrix} &&i&\\&&&-i\\i&&&\\&-i&&\end{bmatrix} = i(X_i \otimes Z_k).

Now, for a more specific example,

(5)   \begin{align*}e^{-i \gamma Z_iZ_k} Y_i e^{i \gamma Z_iZ_k} & = (I_i I_k \cos\gamma - i Z_1Z_2 \sin\gamma) (Y_i \otimes I_k) (I_i I_k \cos\gamma + i Z_1Z_2 \sin\gamma) \\& = Y_i \cos^2\gamma - Y_i\sin^2\gamma - X_i Z_k\sin\gamma\cos\gamma - X_i Z_k \sin\gamma\cos\gamma \\& = Y_i \cos 2\gamma - X_iZ_k\sin 2\gamma.\end{align*}

Q.E.D.

发表评论