Skip to content

Commit

Permalink
Minor demo fixes (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
ElePT committed Mar 6, 2024
1 parent 014e75e commit ccf2849
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions demos/qiskit_patterns/2_qiskit_patterns.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
"source": [
"# Scaling Quantum Optimization with Qiskit Patterns\n",
"\n",
"In this how-to we will learn about Qiskit Patterns and quantum approximate optimization. Qiskit Patterns define a four-step process for running algorithms on a quantum computer:\n",
"\n",
"In this how-to we will learn about Qiskit Patterns and quantum approximate optimization. A Qiskit Pattern is an intuitive, repeatable set of steps for implementing a quantum computing workflow: \n",
"\n",
"<img src=\"imgs/patterns.png\" alt=\"Drawing\" style=\"float: left; width: 200px;\"/>\n",
"\n",
Expand Down Expand Up @@ -48,7 +47,7 @@
"id": "74b92ba5-c48a-405c-9c4b-04e985a7afbc",
"metadata": {},
"source": [
"Max-Cut is a hard to solve optimization problem with applications in clustering, network science, and statistical physics. The goal of this problem is to partition the nodes of a graph into to sets such that the number of edges traversed by this cut is maximum.\n",
"Max-Cut is a hard to solve optimization problem with applications in clustering, network science, and statistical physics. The goal of this problem is to partition the nodes of a graph into two sets such that the number of edges traversed by this cut is maximum.\n",
"\n",
"<img src=\"imgs/max-cut.png\" alt=\"Max-Cut\"/>"
]
Expand Down Expand Up @@ -171,7 +170,6 @@
"H_C=\\sum_{ij}Q_{ij}Z_iZ_j + \\sum_i b_iZ_i.\n",
"\\end{align}\n",
"\n",
"<div class=\"alert alert-block alert-info\">\n",
"First, a variable change, we convert the binary variables $x_i$ to variables $z_i\\in\\{-1, 1\\}$ by doing\n",
"\n",
"\\begin{align}\n",
Expand All @@ -195,10 +193,11 @@
"\\begin{align}\n",
"H_C=\\sum_{ij}Q_{ij}Z_iZ_j + \\sum_i b_iZ_i.\n",
"\\end{align}\n",
"</div>\n",
"\n",
"We refer to this Hamiltonian as the **cost function Hamiltonian**. It has the property that its gound state corresponds to the solution that **minimizes the cost function $f(x)$**.\n",
"Therefore, to solve our optimization problem we now need to prepare the ground state of $H_C$ (or a state with a high overlap with it) on the quantum computer. Then, sampling from this state will, with a high probability, yield the solution to $min f(x)$."
"<div class=\"alert alert-block alert-info\">\n",
"We refer to this Hamiltonian as the <b>cost function Hamiltonian</b>. It has the property that its gound state corresponds to the solution that <b>minimizes the cost function $f(x)$</b>.\n",
"Therefore, to solve our optimization problem we now need to prepare the ground state of $H_C$ (or a state with a high overlap with it) on the quantum computer. Then, sampling from this state will, with a high probability, yield the solution to $min~f(x)$.\n",
"</div>"
]
},
{
Expand Down Expand Up @@ -1362,7 +1361,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
"version": "3.10.0"
}
},
"nbformat": 4,
Expand Down
Binary file added demos/qiskit_patterns/imgs/eagle-heron-0.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified demos/qiskit_patterns/imgs/eagle-heron.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ccf2849

Please sign in to comment.