|
7 | 7 | "source": [ |
8 | 8 | "# Quantum Algorithm for Solving the Poisson Equation\n", |
9 | 9 | "\n", |
10 | | - "The Poisson equation is a partial differential equation that appears in various research areas, such as physics and engineering. It describes the distribution of a potential field, $u$, under some source term $b$:\n", |
| 10 | + "The Poisson equation is a partial differential equation that appears in various research fields, such as physics and engineering. It describes the distribution of a potential field, $u$, under some source term $b$:\n", |
11 | 11 | "$$\n", |
12 | 12 | "\\nabla^2 u = b,\n", |
13 | 13 | "$$\n", |
|
46 | 46 | "0 & 0 & \\cdots & -1 & 1 \\\\\n", |
47 | 47 | "\\end{pmatrix}\n", |
48 | 48 | "$$\n", |
49 | | - "and $\\Delta x$ and $\\Delta y$ are the discretization of the $x$ and $y$ axes, respectively. The above square matrices, which are of dimensions $N_x$ and $N_y$, respectively, represent the solution at the inner part of our geometry." |
| 49 | + "and $\\Delta x$ and $\\Delta y$ are the discretization of the $x$ and $y$ axes, respectively. The square matrices above, which are of dimensions $N_x$ and $N_y$, respectively, represent the solution at the inner part of our geometry." |
50 | 50 | ] |
51 | 51 | }, |
52 | 52 | { |
|
56 | 56 | "source": [ |
57 | 57 | "<center>\n", |
58 | 58 | "<img src=\"https://docs.classiq.io/resources/poisson_grid.png\" style=\"width:100%\">\n", |
59 | | - "<figcaption align = \"middle\"> Figure 1. A schematic description of discrediting the Poisson equation. The blue line designates the area for solving the problem. The linear equations are written only for the inner filled grid points. The unfilled ghost points are used to impose the boundary conditions. In the example above, a Dirichlet boundary condition is given by setting $u_{0,k}=-u_{-1,k}$ and $u_{3,k}=-u_{4,k}$, whereas a Neumann boundary condition reads $u_{j,0}=u_{j,-1}$ and $u_{j,3}=u_{j,4}$. </figcaption>\n", |
| 59 | + "<figcaption align = \"middle\"> Figure 1. A schematic description of discretizing the Poisson equation. The blue line designates the area for solving the problem. The linear equations are written only for the inner filled grid points. The unfilled ghost points are used to impose the boundary conditions. In the example above, a Dirichlet boundary condition is given by setting $u_{0,k}=-u_{-1,k}$ and $u_{3,k}=-u_{4,k}$, whereas a Neumann boundary condition reads $u_{j,0}=u_{j,-1}$ and $u_{j,3}=u_{j,4}$. </figcaption>\n", |
60 | 60 | "</center>" |
61 | 61 | ] |
62 | 62 | }, |
|
128 | 128 | "id": "9", |
129 | 129 | "metadata": {}, |
130 | 130 | "source": [ |
131 | | - "### Calculating the Diagonal Hamiltonian" |
| 131 | + "### Diagonal Hamiltonian Calculation" |
132 | 132 | ] |
133 | 133 | }, |
134 | 134 | { |
|
147 | 147 | "$$\n", |
148 | 148 | "and $k = 0, 1, \\ldots, N_y-1$ and $j = 0, 1, \\ldots, N_x-1$.\n", |
149 | 149 | "\n", |
150 | | - "The HHL algorithm requires the application of an Hamiltonian simulation $e^{iH}$. In this notebook this quantum block is implemented using the Suzuki-Trotter built-in funcion. We start with defining a function that gets $N_x$ and $N_y$, and returns the corresponding Hamiltonian. The decomposition of the diagonal matrix to the Pauli basis is done using the Walsh Hadamard transform." |
| 150 | + "The HHL algorithm requires the application of an Hamiltonian simulation $e^{iH}$. In this notebook this quantum block is implemented using the Suzuki-Trotter built-in function. We start with defining a function that gets $N_x$ and $N_y$ and returns the corresponding Hamiltonian. The decomposition of the diagonal matrix to the Pauli basis is done using the Walsh Hadamard transform." |
151 | 151 | ] |
152 | 152 | }, |
153 | 153 | { |
|
412 | 412 | "id": "27", |
413 | 413 | "metadata": {}, |
414 | 414 | "source": [ |
415 | | - "Now, we need to define the resolution (QPE size) for the quantum solver. The required number of QPE phase qubits depends on the condition number $\\kappa$ of the inverted matrix. In the case of the Laplacian matrix, this parameter is of the order of the matrix dimension $O(2^{N_x+N_y})$, which eliminates the exponential advantage. However, in our example we have a smooth source term, and high modes are expected to have minor effects on the solution. The highest mode of $\\mathcal{L}$ is $\\lambda_{\\max}=8$, whereas the smallest one is $\\lambda_{x,0}\\sim 4\\pi^2/(2N_x)^2$. Let us assume that the highest mode participating in the solution is $\\sim 2^6 \\lambda_{x,0}$, and take a QPE size of 6 qubits." |
| 415 | + "Now, we need to define the resolution (QPE size) for the quantum solver. The required number of QPE phase qubits depends on the condition number $\\kappa$ of the inverted matrix. In the case of the Laplacian matrix, this parameter is of the order of the matrix dimension $O(2^{N_x+N_y})$, which eliminates the exponential advantage. However, in our example we have a smooth source term, and high modes are expected to have minor effects on the solution. The highest mode of $\\mathcal{L}$ is $\\lambda_{\\max}=8$, whereas the smallest one is $\\lambda_{x,0}\\sim 4\\pi^2/(2N_x)^2$. Let us assume that the highest mode participating in the solution is $\\sim 2^6 \\lambda_{x,0}$, and take a QPE size of six qubits." |
416 | 416 | ] |
417 | 417 | }, |
418 | 418 | { |
|
531 | 531 | "id": "34", |
532 | 532 | "metadata": {}, |
533 | 533 | "source": [ |
534 | | - "We define a postprocess function that gets the quantum solution out of the execution and returns a solution." |
| 534 | + "We define a postprocess function that gets the quantum solution out of the execution and returns a solution:" |
535 | 535 | ] |
536 | 536 | }, |
537 | 537 | { |
|
0 commit comments