Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"source": [
"# Quantum Algorithm for Solving the Poisson Equation\n",
"\n",
"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",
"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",
"$$\n",
"\\nabla^2 u = b,\n",
"$$\n",
Expand Down Expand Up @@ -46,7 +46,7 @@
"0 & 0 & \\cdots & -1 & 1 \\\\\n",
"\\end{pmatrix}\n",
"$$\n",
"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."
"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."
]
},
{
Expand All @@ -56,7 +56,7 @@
"source": [
"<center>\n",
"<img src=\"https://docs.classiq.io/resources/poisson_grid.png\" style=\"width:100%\">\n",
"<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",
"<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",
"</center>"
]
},
Expand Down Expand Up @@ -128,7 +128,7 @@
"id": "9",
"metadata": {},
"source": [
"### Calculating the Diagonal Hamiltonian"
"### Diagonal Hamiltonian Calculation"
]
},
{
Expand All @@ -147,7 +147,7 @@
"$$\n",
"and $k = 0, 1, \\ldots, N_y-1$ and $j = 0, 1, \\ldots, N_x-1$.\n",
"\n",
"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."
"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."
]
},
{
Expand Down Expand Up @@ -412,7 +412,7 @@
"id": "27",
"metadata": {},
"source": [
"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."
"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."
]
},
{
Expand Down Expand Up @@ -531,7 +531,7 @@
"id": "34",
"metadata": {},
"source": [
"We define a postprocess function that gets the quantum solution out of the execution and returns a solution."
"We define a postprocess function that gets the quantum solution out of the execution and returns a solution:"
]
},
{
Expand Down