From fd55dfcd6dfbaf26edb49ba71eb179bf1cb19627 Mon Sep 17 00:00:00 2001 From: Joel Pasvolsky Date: Mon, 28 Mar 2022 14:56:20 -0700 Subject: [PATCH 1/4] Fix note that broke following formatting, update link --- 01-exploring-pegasus.ipynb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/01-exploring-pegasus.ipynb b/01-exploring-pegasus.ipynb index 15c2216..ab0237e 100644 --- a/01-exploring-pegasus.ipynb +++ b/01-exploring-pegasus.ipynb @@ -42,7 +42,8 @@ "source": [ "## Minor-Embedding: Mapping Problems to Qubits\n", "\n", - "
Note: If you already understand how problems are mapped to the D-Wave system, please skip ahead to the next text cell by clicking the **Run** button.
\n", + "> **Note:** If you already understand how problems are mapped to the D-Wave system, please skip ahead to the \n", + " next text cell by clicking the **Run** button.\n", " \n", "D-Wave systems solve binary quadratic models (BQMs): the [Ising model](https://en.wikipedia.org/wiki/Ising_model) traditionally used in statistical mechanics and its computer-science equivalent, the quadratic unconstrained binary optimization ([QUBO](https://en.wikipedia.org/wiki/Quadratic_unconstrained_binary_optimization)) problem. Given $N$ variables $x_1,...,x_N$, where each variable $x_i$ can have binary values $0$ or $1$, the system finds assignments of values that minimize the QUBO,\n", "\n", @@ -50,7 +51,7 @@ "\n", "where $q_i$ and $q_{i,j}$ are configurable (linear and quadratic) coefficients. \n", "\n", - "Such [objective functions](https://docs.ocean.dwavesys.com/en/stable/concepts) can be represented by graphs. A graph comprises a collection of nodes, representing variables, and edges representing the connections between them. For example, a Boolean AND, $z \\Leftrightarrow x_1 \\wedge x_2$, expressed in [QUBO formulation](https://docs.dwavesys.com/docs/latest/c_handbook_3.html) as, \n", + "Such [objective functions](https://docs.ocean.dwavesys.com/en/stable/concepts) can be represented by graphs. A graph comprises a collection of nodes, representing variables, and edges representing the connections between them. For example, a Boolean AND, $z \\Leftrightarrow x_1 \\wedge x_2$, expressed in [QUBO formulation](https://docs.dwavesys.com/docs/latest/handbook_reformulating.html) as, \n", "\n", "$x_1 x_2 - 2(x_1+x_2)z +3z$, \n", "\n", From 11ac6e068423a137ce9a9140cfe581ac761ba547 Mon Sep 17 00:00:00 2001 From: Joel Pasvolsky Date: Mon, 28 Mar 2022 15:05:03 -0700 Subject: [PATCH 2/4] Fix two more notes for VS Code compatibility --- 01-exploring-pegasus.ipynb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/01-exploring-pegasus.ipynb b/01-exploring-pegasus.ipynb index ab0237e..7698a9b 100644 --- a/01-exploring-pegasus.ipynb +++ b/01-exploring-pegasus.ipynb @@ -158,7 +158,8 @@ "\n", "To demonstrate the benefits of the Pegasus topology, the following subsections compare its performance with that of the Chimera. This is done by generating and embedding many random graphs that are representative of problems of sizes commensurate with the size of a DW-2000Q QPU. \n", "\n", - "
The demonstrations of this section do not submit problems to a D-Wave system for solution, and so are not associated with a cost for QPU usage time.
\n", + "> **NOTE:** The demonstrations of this section do not submit problems to a D-Wave system for solution, and so \n", + " are not associated with a cost for QPU usage time.\n", "\n", "The next three code cells import three functions used throughout this section. You can see (and modify) the code for these functions by selecting Jupyter File Explorer View from the Online Learning page.\n", "\n", @@ -206,7 +207,9 @@ "source": [ "The second function, `try_embedding`, uses one of Ocean's embedding tools to find a minor-embedding for a given problem. You can configure the number or attempts this heuristic algorithm makes, `tries`, and a timeout value for those attempts, `timeout`. \n", "\n", - "
You can also update the code (located in the helpers folder for this notebook) to configure additional embedding parameters, described here: minorminer.
\n", + "> **NOTE:** You can also update the code (located in the `helpers` folder for this notebook) to configure \n", + " additional embedding parameters, described here: [minorminer](https://docs.ocean.dwavesys.com/en/stable/docs_minorminer/source/sdk_index.html)\n", + "\n", "Run it on the graph you generated in the previous code cell:" ] }, From 3f830ff80c7053518a340c862588fb5ac3b566c5 Mon Sep 17 00:00:00 2001 From: Joel Pasvolsky Date: Tue, 29 Mar 2022 07:20:14 -0700 Subject: [PATCH 3/4] Fix all alerts/notes for VS code --- 01-exploring-pegasus.ipynb | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/01-exploring-pegasus.ipynb b/01-exploring-pegasus.ipynb index 7698a9b..98966e2 100644 --- a/01-exploring-pegasus.ipynb +++ b/01-exploring-pegasus.ipynb @@ -158,8 +158,8 @@ "\n", "To demonstrate the benefits of the Pegasus topology, the following subsections compare its performance with that of the Chimera. This is done by generating and embedding many random graphs that are representative of problems of sizes commensurate with the size of a DW-2000Q QPU. \n", "\n", - "> **NOTE:** The demonstrations of this section do not submit problems to a D-Wave system for solution, and so \n", - " are not associated with a cost for QPU usage time.\n", + "\n", + "
The demonstrations of this section do not submit problems to a D-Wave system for solution, and so are not associated with a cost for QPU usage time.
\n", "\n", "The next three code cells import three functions used throughout this section. You can see (and modify) the code for these functions by selecting Jupyter File Explorer View from the Online Learning page.\n", "\n", @@ -288,9 +288,14 @@ "cell_type": "markdown", "metadata": {}, "source": [ + " \n", "

Important: Loops that run multiple attempts at embeddings on multiple graphs, some of them big, can take minutes to execute. To reduce runtimes, the code cells below run by default on quarter-sized, C8 and P8, graphs. You can run on the full-sized C16 and P16 graphs by setting the flag fast_run=False in the code cells below.

\n", "\n", - "

Note: In this and similar code cells below, you can shorten the runtime by setting a lower value to the problems parameter, which represents the number of graphs of each size, and/or modifying the loop variable, nodes, to fewer and smaller values.

You can also modify the embedding_timeout and embedding_tries parameters used to configure the minorminer embedding heuristic.

" + "> **Note:** In this and similar code cells below, you can shorten the runtime by setting a lower value to the \n", + " `problems` parameter, which represents the number of graphs of each size, and/or modifying the loop variable, \n", + " `nodes`, to fewer and smaller values. You can also modify the `embedding_timeout` and `embedding_tries` parameters\n", + " used to configure the\n", + " [minorminer](https://docs.ocean.dwavesys.com/en/stable/docs_minorminer/source/sdk_index.html) embedding heuristic." ] }, { @@ -519,7 +524,9 @@ "\n", "\n", "\n", - "
Note that if your problems are represented by sparse graphs, using a clique embedding can be (1) wasteful of qubits, needlessly limiting the size of problem you can embed and (2) result in longer chains and possibly lower-quality solutions.
" + "> **Note:** If your problems are represented by sparse graphs, using a clique embedding can be (1) wasteful of \n", + " qubits, needlessly limiting the size of problem you can embed and (2) result in longer chains and possibly \n", + " lower-quality solutions." ] }, { From cf0248ebf1fe1059dbb6a8c32daafdec9a870298 Mon Sep 17 00:00:00 2001 From: Joel Pasvolsky Date: Tue, 29 Mar 2022 07:33:15 -0700 Subject: [PATCH 4/4] Fix link and position graphic --- 01-exploring-pegasus.ipynb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/01-exploring-pegasus.ipynb b/01-exploring-pegasus.ipynb index 98966e2..d338052 100644 --- a/01-exploring-pegasus.ipynb +++ b/01-exploring-pegasus.ipynb @@ -235,7 +235,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "The `try_embedding` function returns for both QPU topologies the longest chain it needed for the embedding. As mentioned above, for a group of qubits to act as a chain, you need to strongly couple them so that they tend to return a single value for the variable the chain represents. In this context \"strong\" is relative to values used for the problem's quadratic interactions, which are also represented by coupling strengths. Because coupling values have a finite range, relatively strong, long chains can come at the [cost](https://docs.dwavesys.com/docs/latest/c_handbook_6.html) of a smaller range of coupling strengths for representing the problem's quadratic interactions. \n", + "The `try_embedding` function returns for both QPU topologies the longest chain it needed for the embedding. As mentioned above, for a group of qubits to act as a chain, you need to strongly couple them so that they tend to return a single value for the variable the chain represents. In this context \"strong\" is relative to values used for the problem's quadratic interactions, which are also represented by coupling strengths. Because coupling values have a finite range, relatively strong, long chains can come at the [cost](https://docs.dwavesys.com/docs/latest/handbook_embedding.html) of a smaller range of coupling strengths for representing the problem's quadratic interactions. \n", "\n", "The last of the three functions,`embedding_loop`, runs the two previous ones and saves some of the parameters and results in a [pandas](https://pandas.pydata.org/pandas-docs/stable/index.html) data structure for convenient analysis." ] @@ -539,7 +539,9 @@ "QPU architecture is described in more detail in the [documentation](https://docs.dwavesys.com/docs/latest/c_gs_4.html) and below; for now it's sufficient to know that the Chimera topology's structure is a grid of unit cells, each with four horizontal qubits connected to four vertical qubits via couplers. Graphs that can be split into two sets of vertices, with all vertices of one set connected to all vertices of the second, are known as *bicliques* or complete bipartite graphs; a Chimera unit cell is a $K_{4,4}$ [biclique](https://en.wikipedia.org/wiki/Complete_bipartite_graph). Unit cells are tiled vertically and horizontally with adjacent qubits connected, creating a lattice of sparsely connected qubits.\n", "\n", "The figure below shows a C3 $3x3$ lattice of Chimera unit cells.\n", + "\n", "\n", + "\n", "If repeated structures of a problem can be embedded in a unit cell, you might then be able to duplicate that across unit cells and interconnect these in a very efficient overall embedding. " ] },