VQE_EN.ipynb 44.1 KB
Newer Older
Q
Quleaf 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Variational Quantum Eigensolver\n",
    "\n",
    "<em> Copyright (c) 2021 Institute for Quantum Computing, Baidu Inc. All Rights Reserved. </em>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Overview\n",
    "\n",
    "It is widely believed that one of the most promising applications of quantum computing in the near future is solving quantum chemistry problems [1-2]. **Variational Quantum Eigensolver** (VQE) is a strong proof to this possibility of studying quantum chemistry with **Noisy Intermediate-Scale Quantum** (NISQ) devices [1-4]. The core task is to solve the ground state of any molecular Hamiltonian $\\hat{H}$ by preparing a parametrized wave function ansatz $|\\Psi(\\boldsymbol\\theta)\\rangle$ on a quantum computer and adopt classical optimization methods (e.g. gradient descent) to adjust the parameters $\\boldsymbol\\theta$ to minimize the expectation value $\\langle \\Psi(\\boldsymbol\\theta)|\\hat{H}|\\Psi(\\boldsymbol\\theta)\\rangle$. This approach is based on the **Rayleigh-Ritz variational principle**. \n",
    "\n",
    "$$\n",
    "E_0 = \\min_{\\boldsymbol\\theta} \\langle \\Psi(\\boldsymbol\\theta)|\\hat{H}|\\Psi(\\boldsymbol\\theta)\\rangle.\n",
    "\\tag{1}\n",
    "$$\n",
    "\n",
    "where $E_0$ denotes the ground state energy. Numerically, it can be understood as finding the smallest eigenvalue $\\lambda_{\\min}$ of a **discretized** Hamiltonian $H$ (hermitian matrix) and its corresponding eigenvector $|\\Psi_0\\rangle$. How such a discretization can be done on a classical computer belongs to the art of quantum chemistry and is far beyond the scope of this tutorial. We will discuss this part with a few words in the background section. In general, such a Hamiltonian $H$ is expressed as a weighted sum of Pauli spin operators $\\{X,Y,Z\\}$ (native to quantum devices) such that this information can be processed on a quantum computer.\n",
    "\n",
    "$$\n",
    "H = \\sum_k c_k ~ \\bigg( \\bigotimes_{j=0}^{M-1} \\sigma_j^{(k)} \\bigg),\n",
    "\\tag{2}\n",
    "$$\n",
    "\n",
    "where $\\sigma_j^{(k)} \\in \\{I,X,Y,Z\\}$ and $M$ stands for qubit number. We refer this form of Hamiltonian as **Pauli strings**. For example, \n",
    "\n",
    "$$\n",
    "H= 0.12~Y_0 \\otimes I_1-0.04~X_0\\otimes Z_1.\n",
    "\\tag{3}\n",
    "$$\n",
    "\n",
    "In the next section, we will provide a brief review on the electronic structure problem which essentially tells us how to calculate the Hamiltonian $H$. For those who are already familiar with this topic or only interested in how to implement VQE on Paddle Quantum, please skip this part and jump into the illustrative example of hydrogen molecule $H_2$.\n",
    "\n",
    "## Background: the electronic structure problem\n",
    "\n",
    "In this section, we focus on one of the fundamental problems in quantum chemistry --  **the electronic structure problem**. To be more specific, we are interested in the low lying energy eigenstates of any given molecule. These knowledge could help predict reaction rates and location of stable structures [5]. Suppose a molecule consists of $N_n$ nuclei and $N_e$ electrons, the first quantized (canonical quantization) Hamiltonian operator $\\hat{H}_{mol}$ describing the total energy of this molecular system can be written as\n",
    "\n",
    "$$\n",
    "\\begin{align}\n",
    "\\hat{H}_{\\text{mol}} & = -\\sum_{i}\\frac{\\nabla_{R_i}^2}{2M_i} - \\sum_{i} \\frac{\\nabla_{r_i}^2}{2} -\\sum_{i,j}\\frac{Z_i}{\\lvert R_i - r_j\\lvert} + \\sum_{i,j>i}\\frac{Z_iZ_j}{\\lvert R_i - R_j\\lvert} + \\sum_{i, j>i}\\frac{1}{\\lvert r_i - r_j\\lvert}, \n",
    "\\tag{4}\n",
    "\\end{align}\n",
    "$$\n",
    "\n",
    "where $R_i, M_i,$ and $Z_i$ denote the position, mass and atomic number (the number of protons) of the $i^{th}$ nucleus, and the positions of electrons are $r_i$. The first two sums describe the kinetic energy of nuclei and electrons, respectively. The third sum describes the attractive Coulomb interaction between the positively charged nuclei and the negatively charged electrons. The last two terms represent the repulsive nuclei-nuclei and electron-electron interactions.  Here, the molecular Hamiltonian $\\hat{H}_\\text{mol}$ is already in atomic units of energy, **Hartree**. $1$ Hartree is $[\\hbar^2/(m_ee^2a_0^2)] = 27.2$ eV or $630$ kcal/mol, where $m_e, e,$ and $a_0$ stand for the mass of electron, charge of electron, and Bohr radius. \n",
    "\n",
    "\n",
    "**Note:** The spin-orbit interaction and hyperfine interaction are not considered in this picture. They can be treated as perturbations if necessary. \n",
    "\n",
    "### Born-Oppenheimer approximation\n",
    "\n",
    "Since the nuclei are much heavier than electrons, the electrons will move much faster than the nuclei. It is reasonable to treat the positions of nuclei as fixed, $R_i =$ constants. This is known as the Born-Oppenheimer approximation by decoupling the behavior of nuclei and electrons in time scale. Consequently, the kinetic energy term of nuclei will disappear and the nuclei-nuclei repulsive interaction term can be viewed as an energy shift (independent of electron positions $r_i$). We could derive the electronic Hamiltonian $\\hat{H}_{\\text{electron}}$ as\n",
    "\n",
    "$$\n",
    "\\begin{align}\n",
    "\\hat{H}_{\\text{electron}} & =  - \\sum_{i} \\frac{\\nabla_{r_i}^2}{2} -\\sum_{i,j}\\frac{Z_i}{\\lvert R_i - r_j\\lvert} + \\sum_{i, j>i}\\frac{1}{\\lvert r_i - r_j\\lvert} \n",
    "\\tag{5},\n",
    "\\end{align}\n",
    "$$\n",
    "\n",
    "The energy levels of the electrons in the molecule can be found by solving the time independent Schrödinger equation\n",
    "\n",
    "$$\n",
    "\\hat{H}_{\\text{electron}} |\\Psi_n \\rangle = E_n |\\Psi_n \\rangle,\n",
    "\\tag{6}\n",
    "$$\n",
    "\n",
    "where $n$ stands for the energy level. Notice the electron repulsion terms scale as $N_e(N_e-1)/2$ which means for the Oxygen molecule $O_2$ carrying 16 electrons there will be 120 electron repulsion terms in total! In general, this problem cannot be solved analytically. As Dirac concluded in [Quantum mechanics of many-electron systems](https://royalsocietypublishing.org/doi/10.1098/rspa.1929.0094) [6],\n",
    "\n",
    "> *The underlying physical laws necessary for the mathematical theory of a large part of physics and the whole of chemistry are thus completely known, and the difficulty is only that the exact application of these laws leads to equations much too complicated to be soluble.*                                                                                                                                                                  \n",
    ">\n",
    "> ​\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t-- Paul Dirac (1929)\n",
    "\n",
    "A straightforward numerical approach is discretizing the infinite-dimensional Hilbert space into equidistant grid points where linear algebra guides the whole calculation. Suppose each axis of space is discretized into $k$ points, the $N$-electron (drop the subscript e for simplicity) wave function can be written as [2]\n",
    "\n",
    "$$\n",
    "|\\Psi \\rangle = \\sum_{\\mathbf{x_1}, \\ldots, \\mathbf{x_N}} \\psi(\\mathbf{x_1}, \\ldots, \\mathbf{x_N}) \\mathcal{A}(|\\mathbf{x_1}, \\ldots, \\mathbf{x_N}\\rangle).\n",
    "\\tag{7}\n",
    "$$\n",
    "\n",
    "where coordinate $|\\mathbf{x_j}\\rangle = |r_j\\rangle |\\sigma_j\\rangle$ records the spatial location and spin of the $j^{th}$ electron, $|r_j\\rangle  = |x_j,y_j,z_j\\rangle$ for $j\\in \\{1,2,\\cdots,N\\}$, $x_j,y_j,z_j \\in \\{0,1,\\cdots,k-1\\}$ and  $\\sigma_j \\in \\{\\downarrow,\\uparrow\\}$ for spin down or up.  There will be $k^{3N}\\times 2^{N}$ complex amplitudes in total. Here, $\\mathcal{A}$ denotes anti-symmetrization and a consequence of the Pauli exclusion principle (electrons are fermion), and $\\psi(\\mathbf{x_1}, \\mathbf{x_2}, \\ldots, \\mathbf{x_N})=\\langle\\mathbf{x_1}, \\mathbf{x_2}, \\ldots, \\mathbf{x_N}|\\Psi\\rangle$. One can see that storing such a wave function already requires **exponentially growing memory** with respect to the number of electrons $N$. This would make classical simulation methods based on this naive numerical approach intractable for systems size larger than few tens of electrons. Now, the question becomes can we prepare such a wave function $|\\Psi\\rangle$ directly on a quantum computer and measure the expectation value $E_0$? In the next section, let's take the simplest molecular system -- hydrogen molecule $H_2$ as a concrete example.\n",
    "\n",
    "\n",
    "\n",
    "**Note:** A detailed review on quantum chemistry and existing classical computational methods are far beyond the scope of this tutorial, we refer the enthusiastic readers to the standard textbooks *'Molecular Electronic-Structure Theory'* [5] by Helgaker and *'Modern Quantum Chemistry: Introduction to Advanced Electronic Structure Theory'* [7] by Szabo & Ostlund. To bridge to knowledge gap between quantum chemistry and quantum computing, please check the following review papers [Quantum computational chemistry](https://journals.aps.org/rmp/abstract/10.1103/RevModPhys.92.015003) [2] and [Quantum Chemistry in the Age of Quantum Computing](https://pubs.acs.org/doi/10.1021/acs.chemrev.8b00803) [1].\n",
    "\n",
    "**Note:** For energy calculation, it is desired to reach the **chemical accuracy** of $1.6\\times10^{-3}$ Hartree or 1 kcal/mol . "
   ]
  },
  {
Q
Quleaf 已提交
98
   "attachments": {},
Q
Quleaf 已提交
99 100 101 102 103 104 105
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ground state of the hydrogen molecule $H_2$\n",
    "\n",
    "### Building electronic Hamiltonian\n",
    "\n",
Q
Quleaf 已提交
106
    "First of all, let us import the necessary libraries and packages. *qchem* module in Paddle Quantum is developed on top of *openfermion*, and currently, its quantum chemistry backend is *PySCF* so you need to install these two packages before executing the following codes (NOTE: PySCF only support Mac and Linux platform, we are adding support for more quantum chemistry backends, and will improve our support for Windows in our next release). We strongly encourage you to read the tutorial [Building molecular Hamiltonian](./BuildingMolecule_EN.ipynb) first, which introduces how to utilize our quantum chemistry toolkit `qchem`.\n",
Q
Quleaf 已提交
107 108 109 110 111 112
    "\n",
    "**Note: As to the environment setting, please refer to [README.md](https://github.com/PaddlePaddle/Quantum/blob/master/README.md).**"
   ]
  },
  {
   "cell_type": "code",
Q
Quleaf 已提交
113
   "execution_count": 1,
Q
Quleaf 已提交
114 115 116 117 118 119
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-04-30T09:14:44.970178Z",
     "start_time": "2021-04-30T09:14:40.895128Z"
    }
   },
Q
Quleaf 已提交
120 121 122 123 124 125 126 127 128 129 130 131 132 133
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/usr/local/Caskroom/miniconda/base/envs/pq_new/lib/python3.8/site-packages/paddle/tensor/creation.py:125: DeprecationWarning: `np.object` is a deprecated alias for the builtin `object`. To silence this warning, use `object` by itself. Doing this will not modify any behavior and is safe. \n",
      "Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations\n",
      "  if data.dtype == np.object:\n",
      "/usr/local/Caskroom/miniconda/base/envs/pq_new/lib/python3.8/site-packages/paddle/tensor/creation.py:125: DeprecationWarning: `np.object` is a deprecated alias for the builtin `object`. To silence this warning, use `object` by itself. Doing this will not modify any behavior and is safe. \n",
      "Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations\n",
      "  if data.dtype == np.object:\n"
     ]
    }
   ],
Q
Quleaf 已提交
134 135
   "source": [
    "import paddle\n",
Q
Quleaf 已提交
136
    "import paddle_quantum\n",
Q
Quleaf 已提交
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
    "import paddle_quantum.qchem as qchem\n",
    "from paddle_quantum.loss import ExpecVal\n",
    "from paddle_quantum import Hamiltonian\n",
    "from paddle_quantum.state import zero_state, State\n",
    "from paddle_quantum.ansatz import Circuit\n",
    "from paddle_quantum.linalg import dagger\n",
    "from paddle_quantum import Backend\n",
    "\n",
    "import os\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "import numpy\n",
    "from numpy import pi as PI\n",
    "from numpy import savez, zeros\n",
    "\n",
    "# Eliminate noisy python warnings\n",
    "import warnings\n",
    "warnings.filterwarnings(\"ignore\")"
   ]
  },
  {
Q
Quleaf 已提交
158
   "attachments": {},
Q
Quleaf 已提交
159 160 161
   "cell_type": "markdown",
   "metadata": {},
   "source": [
Q
Quleaf 已提交
162
    "To analyze specific molecules, we need several key information such as **geometry**, **basis set** (such as STO-3G), **multiplicity**, and **charge** to model the molecule and to calculate its one-body integral, two-body integral and the Hamiltonian. We can use `Molecule` class provided by *qchem* in Paddle Quantum to easily obtain molecular Hamiltonian stored as Paddle Quantum's `Hamiltonian` object. This will facilitates our further operations."
Q
Quleaf 已提交
163 164 165 166
   ]
  },
  {
   "cell_type": "code",
Q
Quleaf 已提交
167
   "execution_count": 2,
Q
Quleaf 已提交
168 169 170 171 172 173 174 175 176 177 178
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-04-30T09:14:44.982005Z",
     "start_time": "2021-04-30T09:14:44.975892Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
Q
Quleaf 已提交
179
      "converged SCF energy = -1.11675930739643\n",
Q
Quleaf 已提交
180 181
      "\n",
      "The generated h2 Hamiltonian is \n",
Q
Quleaf 已提交
182 183 184 185 186 187 188 189 190 191
      " -0.0970662681676312 I\n",
      "0.1714128264477692 Z0\n",
      "0.17141282644776926 Z1\n",
      "-0.22343153690813466 Z2\n",
      "-0.22343153690813466 Z3\n",
      "0.16868898170361213 Z0, Z1\n",
      "0.12062523483390417 Z0, Z2\n",
      "0.16592785033770344 Z0, Z3\n",
      "0.16592785033770344 Z1, Z2\n",
      "0.12062523483390417 Z1, Z3\n",
Q
Quleaf 已提交
192
      "0.1744128761226159 Z2, Z3\n",
Q
Quleaf 已提交
193 194 195 196
      "-0.04530261550379927 X0, X1, Y2, Y3\n",
      "0.04530261550379927 X0, Y1, Y2, X3\n",
      "0.04530261550379927 Y0, X1, X2, Y3\n",
      "-0.04530261550379927 Y0, Y1, X2, X3\n"
Q
Quleaf 已提交
197 198 199 200
     ]
    }
   ],
   "source": [
Q
Quleaf 已提交
201 202 203 204 205 206
    "mol = qchem.Molecule(\n",
    "    geometry=[('H', [-0., 0., 0.0]), ('H', [-0., 0., 0.74])],   # Molecular geometry\n",
    "    basis=\"sto-3g\",                                             # Basis set\n",
    "    multiplicity=1,                                             # Spin multiplicity\n",
    "    charge=0,                                                   # Total charge\n",
    "    driver=qchem.PySCFDriver()                                  # Quantum chemistry engine\n",
Q
Quleaf 已提交
207
    ")\n",
Q
Quleaf 已提交
208 209 210 211
    "# extract Hamiltonian\n",
    "molecular_hamiltonian = mol.get_molecular_hamiltonian()\n",
    "\n",
    "# print result\n",
Q
Quleaf 已提交
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240
    "print(\"\\nThe generated h2 Hamiltonian is \\n\", molecular_hamiltonian)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Note:** This Hamiltonian is generated with an interatomic distance of $d = 74$ pm. \n",
    "\n",
    "In addition to inputting molecular geometry directly, inputting molecular geometry file (.xyz file) is also allowed. For more information about quantum chemistry toolkit, please refer to the tutorial [Building molecular Hamiltonian](./BuildingMolecule_EN.ipynb). If you need to test the geometric configuration of more molecules, please check out this [database](http://smart.sns.it/molecules/index.html)."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Building QNN and trial wave function\n",
    "\n",
    "To implement VQE, we firstly need to design a quantum neural network QNN to prepare the wave function ansatz $|\\Psi(\\boldsymbol\\theta)\\rangle$. Here, we provide a 4-qubit quantum circuit template with a depth of $D$ blocks. The dotted frame in the figure below denotes a single block:\n",
    "\n",
    "\n",
    "![Utheta.jpg](https://release-data.cdn.bcebos.com/PIC%2FUtheta.jpg)\n",
    "\n",
    "Next, we use the `Circuit` class and the built-in `real_entangled_layer()` circuit template in Paddle Quantum to realize this QNN.\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
Q
Quleaf 已提交
241
   "execution_count": 3,
Q
Quleaf 已提交
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-04-30T09:14:50.083041Z",
     "start_time": "2021-04-30T09:14:50.062255Z"
    }
   },
   "outputs": [],
   "source": [
    "def U_theta(num_qubits: int, depth: int) -> Circuit:\n",
    "    \"\"\"\n",
    "    Quantum Neural Network\n",
    "    \"\"\"\n",
    "    \n",
    "    # Initialize the quantum neural network according to the number of qubits N\n",
    "    cir = Circuit(num_qubits)\n",
    "    \n",
    "    # Built-in {R_y + CNOT} circuit template\n",
    "    cir.real_entangled_layer(depth = depth)\n",
    "    \n",
    "    # Lay R_y gates in the last row\n",
    "    cir.ry()\n",
    "        \n",
    "    return cir"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Setting up the loss function and model\n",
    "\n",
    "Now that we have the target Hamiltonian and QNN, we will further define the training model and loss function. By applying the QNN $U(\\theta)$ on the initial state $|0..0\\rangle$, we get the output state $|\\psi(\\boldsymbol\\theta)\\rangle $. Then, the loss function to be minimized is the expectation value, \n",
    "\n",
    "\n",
    "$$\n",
    "\\min_{\\boldsymbol\\theta}  \\mathcal{L}(\\boldsymbol \\theta) = \\min_{\\boldsymbol\\theta} \\langle \\Psi(\\boldsymbol\\theta)|H |\\Psi(\\boldsymbol\\theta)\\rangle\n",
    "= \\min_{\\boldsymbol\\theta} \\sum_k c_k~\\langle \\Psi(\\boldsymbol\\theta)| \\bigotimes_j \\sigma_j^{(k)}|\\Psi(\\boldsymbol\\theta)\\rangle.\n",
    "\\tag{8}\n",
    "$$"
   ]
  },
  {
   "cell_type": "code",
Q
Quleaf 已提交
285 286
   "execution_count": 4,
   "metadata": {},
Q
Quleaf 已提交
287 288
   "outputs": [],
   "source": [
Q
Quleaf 已提交
289 290
    "# Define loss function\n",
    "loss_func = ExpecVal(molecular_hamiltonian)"
Q
Quleaf 已提交
291 292 293 294 295 296 297 298 299 300 301 302 303
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Hyper-parameters\n",
    "\n",
    "Before training the QNN, we also need to set some training hyper-parameters, mainly the learning rate (LR), the number of iterations (ITR), and the depth (D) of repeated blocks. "
   ]
  },
  {
   "cell_type": "code",
Q
Quleaf 已提交
304
   "execution_count": 5,
Q
Quleaf 已提交
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-04-30T09:14:50.222465Z",
     "start_time": "2021-04-30T09:14:50.187093Z"
    }
   },
   "outputs": [],
   "source": [
    "ITR = 80  # Set the number of optimization iterations\n",
    "LR = 0.4   # Set the learning rate\n",
    "D = 2      # Set the depth of the repetitive calculation module in QNN\n",
    "N = molecular_hamiltonian.n_qubits # Set number of qubits"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Training\n",
    "\n",
    "After all the training model parameters are set, we convert the data into Tensor in the Paddle, and then train the quantum neural network. The results of the training process is stored in the summary_data file.\n"
   ]
  },
  {
   "cell_type": "code",
Q
Quleaf 已提交
330
   "execution_count": 6,
Q
Quleaf 已提交
331 332 333 334 335 336 337 338 339 340 341
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-04-30T09:15:52.165788Z",
     "start_time": "2021-04-30T09:15:29.625076Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
Q
Quleaf 已提交
342 343 344 345 346 347 348 349
      "iter: 20 loss: -1.0850\n",
      "iter: 20 Ground state energy: -1.0850 Ha\n",
      "iter: 40 loss: -1.1306\n",
      "iter: 40 Ground state energy: -1.1306 Ha\n",
      "iter: 60 loss: -1.1364\n",
      "iter: 60 Ground state energy: -1.1364 Ha\n",
      "iter: 80 loss: -1.1371\n",
      "iter: 80 Ground state energy: -1.1371 Ha\n",
Q
Quleaf 已提交
350 351
      "\n",
      "Circuit after training:\n",
Q
Quleaf 已提交
352
      "--Ry(7.897)----*--------------x----Ry(1.523)----*--------------x----Ry(3.116)--\n",
Q
Quleaf 已提交
353
      "               |              |                 |              |               \n",
Q
Quleaf 已提交
354
      "--Ry(1.603)----x----*---------|----Ry(4.714)----x----*---------|----Ry(4.633)--\n",
Q
Quleaf 已提交
355
      "                    |         |                      |         |               \n",
Q
Quleaf 已提交
356
      "--Ry(6.198)---------x----*----|----Ry(1.801)---------x----*----|----Ry(4.580)--\n",
Q
Quleaf 已提交
357
      "                         |    |                           |    |               \n",
Q
Quleaf 已提交
358
      "--Ry(6.146)--------------x----*----Ry(1.552)--------------x----*----Ry(3.128)--\n",
Q
Quleaf 已提交
359 360 361 362 363 364
      "                                                                               \n"
     ]
    }
   ],
   "source": [
    "# Determine the parameter dimensions of the network \n",
Q
Quleaf 已提交
365
    "cir = U_theta(N, D)\n",
Q
Quleaf 已提交
366 367 368
    "\n",
    "# In general, we use the Adam optimizer to obtain relatively good convergence,\n",
    "# Of course you can change it to SGD or RMS prop.\n",
Q
Quleaf 已提交
369
    "opt = paddle.optimizer.Adam(learning_rate=LR, parameters=cir.parameters())\n",
Q
Quleaf 已提交
370 371 372 373 374 375 376 377 378 379 380
    "\n",
    "# Define initial state\n",
    "init_state = zero_state(N)\n",
    "\n",
    "# Record optimization results\n",
    "summary_iter, summary_loss = [], []\n",
    "\n",
    "# Optimize iterations\n",
    "for itr in range(1, ITR + 1):\n",
    "\n",
    "    # Forward propagation calculates the loss function\n",
Q
Quleaf 已提交
381 382
    "    state = cir(init_state)\n",
    "    loss = loss_func(state)\n",
Q
Quleaf 已提交
383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416
    "    # Back propagation minimizes the loss function\n",
    "    loss.backward()\n",
    "    opt.minimize(loss)\n",
    "    opt.clear_grad()\n",
    "\n",
    "    # Update optimization results\n",
    "    summary_loss.append(loss.numpy())\n",
    "    summary_iter.append(itr)\n",
    "\n",
    "    # Print results\n",
    "    if itr % 20 == 0:\n",
    "        print(\"iter:\", itr, \"loss:\", \"%.4f\" % loss.numpy())\n",
    "        print(\"iter:\", itr, \"Ground state energy:\", \"%.4f Ha\" \n",
    "                                            % loss.numpy())\n",
    "    if itr == ITR:\n",
    "        print(\"\\nCircuit after training:\") \n",
    "        print(cir)\n",
    "\n",
    "# Save the training results in the Output folder\n",
    "os.makedirs(\"output\", exist_ok=True)\n",
    "savez(\"./output/summary_data\", iter = summary_iter, \n",
    "                               energy=summary_loss)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Benchmarking\n",
    "We have now completed the training of the quantum neural network, and the estimated value of the ground state energy obtained is $E_0 \\approx -1.137 $ Hartree. The estimation obtained with VQE is consistent with the value of the ground state energy $E_0 = -1.13728$ Hartree calculated by `psi4` at sto-3g basis using the full configuration-interaction (FCI) method within the chemical accuracy $\\varepsilon = 1.6 \\times 10^{-3}$ Hartree.\n"
   ]
  },
  {
   "cell_type": "code",
Q
Quleaf 已提交
417
   "execution_count": 7,
Q
Quleaf 已提交
418 419 420 421 422 423 424 425 426
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-04-30T09:15:18.096944Z",
     "start_time": "2021-04-30T09:15:17.481250Z"
    }
   },
   "outputs": [
    {
     "data": {
Q
Quleaf 已提交
427
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY0AAAEHCAYAAABSjBpvAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAAsTAAALEwEAmpwYAAAytklEQVR4nO3deXxU1f3/8deHJUDY91UkKDuEAAGkLSi7dQMVq9ZW0YrVStVuLj/tt7RqtVptrVr3tVKX0iIutCgUFLWKoOyIKARBEZCwI5CQz++PcxNDSMIEkswkeT8fj/uYucvc+2FmmE/OOfecY+6OiIhILKrFOwAREak4lDRERCRmShoiIhIzJQ0REYmZkoaIiMRMSUNERGJWI94BmFkT4HmgA5ABfM/dtxY4Jg14AGgAHABudffnYzl/s2bNvEOHDqUXs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91WE5NKVMEbThRaGYX+PMIREp+j4eQUTRqQ/MMfDYHLZwGRgSCHHxWoUcH0UwxygNtA+2ve6u2dGzw34vZktJgxv0ZbDD9v9HeAZAHf/CFgL5CaNWe6+3d33EkpTxx7Fv0EqKJU0pDL4M2HipSfybcsm+qPIzKoB+ae53JfveU6+9RwO/j9RcIwdJ/wQ/9TdZ+TfYWYnEYbwLg8GnO3uKwvEMLBADBcAzYF+7p5lYbTd2kdx3fzv2wH0+1ElqaQhFV70l/ULHDyVZQahOgjC3Ac1j+DU55hZtaidoyNhhrYZwBUWhonHzDpHo8QWZx5wopk1szC98PnAGyWIYydQP9/6DOCn0WimmFmfIl7XkDCfR1bUNpFbMih4vvzmEpINUbVUe8K/WwRQ0pDK4y4g/11UjxB+qBcR5tY4klLAZ4Qf/H8Dl0fVMo8SqmY+iBqPH+Iwf3F7mNXtesIw1YuABe5ekiGqZwPdcxvCgZsJSXCxmS2L1gszGUg3syWEtpiPoni2ENpilhZsgAf+ClSLXvM8MD6qxhMB0Ci3IiISO5U0REQkZkoaIiISMyUNERGJmZKGiIjETElDRERipqQhIiIxU9IQEZGYKWmIiEjM/j9VjpiU0zDfDAAAAABJRU5ErkJggg==",
Q
Quleaf 已提交
428
      "text/plain": [
Q
Quleaf 已提交
429
       "<Figure size 432x288 with 1 Axes>"
Q
Quleaf 已提交
430 431
      ]
     },
Q
Quleaf 已提交
432 433 434
     "metadata": {
      "needs_background": "light"
     },
Q
Quleaf 已提交
435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507
     "output_type": "display_data"
    }
   ],
   "source": [
    "result = numpy.load('./output/summary_data.npz')\n",
    "\n",
    "eig_val, eig_state = numpy.linalg.eig(\n",
    "                     molecular_hamiltonian.construct_h_matrix())\n",
    "min_eig_H = numpy.min(eig_val.real)\n",
    "min_loss = numpy.ones([len(result['iter'])]) * min_eig_H\n",
    "\n",
    "plt.figure(1)\n",
    "func1, = plt.plot(result['iter'], result['energy'], \n",
    "                  alpha=0.7, marker='', linestyle=\"-\", color='r')\n",
    "func_min, = plt.plot(result['iter'], min_loss, \n",
    "                  alpha=0.7, marker='', linestyle=\":\", color='b')\n",
    "plt.xlabel('Number of iteration')\n",
    "plt.ylabel('Energy (Ha)')\n",
    "\n",
    "plt.legend(handles=[\n",
    "    func1,\n",
    "    func_min\n",
    "],\n",
    "    labels=[\n",
    "        r'$\\left\\langle {\\psi \\left( {\\theta } \\right)} '\n",
    "        r'\\right|H\\left| {\\psi \\left( {\\theta } \\right)} \\right\\rangle $',\n",
    "        'Ground-state energy',\n",
    "    ], loc='best')\n",
    "plt.text(-15.5, -1.145, f'{min_eig_H:.5f}', fontsize=10, color='b')\n",
    "#plt.savefig(\"vqe.png\", bbox_inches='tight', dpi=300)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Determining the interatomic distance\n",
    "\n",
    "Recall the above calculation is done with an interatomic distance $d = 74$ pm between two hydrogen atoms. Another interesting aspect we can try with VQE is determining the true interatomic distance by modifying the `h2.xyz` file. The results are summarize in figure below,\n",
    "\n",
    "![vqe-fig-dist](figures/vqe-fig-distance.png)\n",
    "\n",
    "The lowest value is found around $d = 74$ pm (1 pm = $1\\times 10^{-12}$m), which is consistent with the [experimental data](https://cccbdb.nist.gov/exp2x.asp?casno=1333740&charge=0) $d_{exp} (H_2) = 74.14$ pm."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "_______\n",
    "\n",
    "## References\n",
    "\n",
    "[1] Cao, Yudong, et al. Quantum Chemistry in the Age of Quantum Computing. [Chemical reviews 119.19 (2019): 10856-10915.](https://pubs.acs.org/doi/10.1021/acs.chemrev.8b00803)\n",
    "\n",
    "[2] McArdle, Sam, et al. Quantum computational chemistry. [Reviews of Modern Physics 92.1 (2020): 015003.](https://journals.aps.org/rmp/abstract/10.1103/RevModPhys.92.015003)\n",
    "\n",
    "\n",
    "[3] Peruzzo, A. et al. A variational eigenvalue solver on a photonic quantum processor. [Nat. Commun. 5, 4213 (2014).](https://www.nature.com/articles/ncomms5213)\n",
    "\n",
    "[4] Moll, Nikolaj, et al. Quantum optimization using variational algorithms on near-term quantum devices. [Quantum Science and Technology 3.3 (2018): 030503.](https://iopscience.iop.org/article/10.1088/2058-9565/aab822)\n",
    "\n",
    "[5] Helgaker, Trygve, Poul Jorgensen, and Jeppe Olsen. Molecular electronic-structure theory. John Wiley & Sons, 2014.\n",
    "\n",
    "[6] Dirac, Paul Adrien Maurice. Quantum mechanics of many-electron systems. [Proceedings of the Royal Society of London. Series A, Containing Papers of a Mathematical and Physical Character 123.792 (1929): 714-733.](https://royalsocietypublishing.org/doi/10.1098/rspa.1929.0094)\n",
    "\n",
    "[7] Szabo, Attila, and Neil S. Ostlund. Modern quantum chemistry: introduction to advanced electronic structure theory. Courier Corporation, 2012."
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
Q
Quleaf 已提交
508
   "display_name": "modellib",
Q
Quleaf 已提交
509 510 511 512 513 514 515 516 517 518 519 520 521
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
Q
Quleaf 已提交
522
   "version": "3.8.13"
Q
Quleaf 已提交
523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {
    "height": "calc(100% - 180px)",
    "left": "10px",
    "top": "150px",
    "width": "426.667px"
   },
   "toc_section_display": true,
   "toc_window_display": false
Q
Quleaf 已提交
541 542 543 544 545
  },
  "vscode": {
   "interpreter": {
    "hash": "8f24120f890011f53feb4ed62c47961d8565ec1de8b7cb23548c15bd6da8f2d2"
   }
Q
Quleaf 已提交
546 547 548 549 550
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}