QAOA 算法
A Quantum Approximate Optimization Algorithm#
Abstract
We introduce a quantum algorithm that produces approximate solutions for combinatorial optimization problems. The algorithm depends on a positive integer p and the quality of the approximation improves as p is increased. The quantum circuit that implements the algorithm consists of unitary gates whose locality is at most the locality of the objective function whose optimum is sought. The depth of the circuit grows linearly with p times (at worst) the number of constraints. If p is fixed, that is, independent of the input size, the algorithm makes use of efficient classical preprocessing. If p grows with the input size a different strategy is proposed. We study the algorithm as applied to MaxCut on regular graphs and analyze its performance on 2-regular and 3-regular graphs for fixed p. For p = 1, on 3-regular graphs the quantum algorithm always finds a cut that is at least 0.6924 times the size of the optimal cut.
组合优化问题的编码#
任意一个组合优化问题都可以被编码为 MAX-SAT 的形式(
C(z) = \sum^m_{\alpha=1}C_{\alpha}(z)
其中,
对于一个量子计算机,其运行在一个
我们通过 量子计算原理 中的内容,将目标改写为通过构造一个参数
在介绍如何构造哈密顿量之前,我们引入一个理论基础
绝热量子计算#
那么,我们构建一个 含时的哈密顿量演化过程
\hat{H}(t) = (1 - s(t))H_B + s(t)H_P
其中,
Tldr
通过薛定谔方程,我们可以直接求得
\begin{aligned}
\ket{\psi} &= \mathcal{T}\exp{(\frac{-i}{\hbar}\int^{t}_{0}\hat{H}(t)dt)\ket{\psi_0}}\\
&= U(t)\ket{\psi_0}
\end{aligned}我们期望演化足够缓慢,于是
\hat{H}(t) = \prod_j^p \bigg((1 - s(j\Delta t))H_B + s(j\Delta t)H_P \bigg)\Delta t
本质上,我们相当于演化了
\ket{\psi} = \prod_i U_i\ket{\psi_0}
其中
\ket{\psi} = \prod^p_{j=1} \exp \Bigg(-i \bigg( (1 - s(j\Delta t))H_B + s(j\Delta t)H_P \bigg)\Delta t \Bigg)\ket{\psi_0}
进一步的,为了方便电路的实现,对每次的演化,我们规定如下:
\begin{aligned}
s(t) = 1 &, t \in [0, \gamma_1) \\
s(t) = 0 &, t \in [\gamma_1, \gamma_1 + \beta_1)\\
s(t) = 1 &, t \in [\gamma_1 + \beta_1, \gamma_1 + \beta_1 + \gamma_2)\\
&\vdots
\end{aligned}
也就是来回演化
\begin{aligned}
\ket{\psi(\overrightarrow{\gamma}, \overrightarrow{\beta})} &= e^{-iH_B\beta_p}\times e^{-iH_P\gamma_p} \times \dots \times e^{-iH_B\beta_1} \times e^{-iH_P\gamma_1} \ket{+} \\
&= \prod^p_{j=1} e^{-iH_B\beta_j} e^{-iH_P\gamma_j} \ket{+} \\
&= \prod^p_{j=1}U_B^{(j)}U_C^{(j)} \ket{+}
\end{aligned}
我们令
\ket{\psi(\theta)} = \prod^p_{j=1}U_B^{(j)}U_C^{(j)} \ket{+}
其中,
根据 量子计算理论基础 可以知道,我们现在就得到了一个可以使用经典优化器优化的模型:
C(\theta) = \bra{\psi(\theta)}H\ket{\psi(\theta)}
通过测量得到
最后,我们在基态中测量
最小顶点覆盖示例#
考虑
于是,对于每个顶点,我们使用
\ket{z} = \ket{\psi_i} \otimes \dots \otimes \ket{\psi_n}
问题的哈密顿量为:
H_C \ = \ 3 \sum_{(i, j) \in E(G)} (\sigma^i_z \sigma^j_z \ + \ \sigma^i_z \ + \ \sigma^j_z) \ - \
\displaystyle\sum_{i \in V(G)} \sigma^i_z
其中
于是,我们的目的就是求得当哈密顿量最小时的基态
考虑一个简单的图,如下所示,显然其最小顶点覆盖的解为:{2, 1},需要求得的量子比特位
我们考虑两层的 QAOA 算法,线路如下所示:
随后,我们使用梯度下降优化器来优化参数
最终,我们测量出现概率最高的基态:
概率最高的也同样是
可以发现现在概率高的都已经是正确解了






讨论
想法、补充,或只是打个招呼。