Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graph Cut Search Problem with Grover Oracle English suggestions #793

Merged
merged 1 commit into from
Feb 23, 2025
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
18 changes: 9 additions & 9 deletions algorithms/grover/grover_max_cut/grover_max_cut.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
"id": "5193de81-389e-4a87-89dc-1acb2f2630e0",
"metadata": {},
"source": [
"The \"Maximum Cut Problem\" (MaxCut) [[1](#MaxCutWiki)] is an example of combinatorial optimization problem. It refers to finding a partition of a graph into two sets, such that the number of edges between the two sets is maximal.\n",
"The \"Maximum Cut Problem\" (MaxCut) [[1](#MaxCutWiki)] is an example of a combinatorial optimization problem. It refers to finding a partition of a graph into two sets, such that the number of edges between the two sets is the maximum.\n",
"\n",
"## Mathematical Formulation\n",
"\n",
"Given a graph $G=(V,E)$ with $|V|=n$ nodes and $E$ edges, a cut is defined as a partition of the graph into two complementary subsets of nodes. In the MaxCut problem we look for a cut where the number of edges between the two subsets is maximal. We can represent a cut of the graph by a binary vector $x$ of size $n$, assigning 0 and 1 to nodes in the first and second subsets, respectively. The number of connecting edges for a given cut is simply given by summing over $x_i (1-x_j)+x_j (1-x_i)$ for every pair of connected nodes $(i,j)$.\n",
"Given a graph $G=(V,E)$ with $|V|=n$ nodes and $E$ edges, a cut is defined as a partition of the graph into two complementary subsets of nodes. In the MaxCut problem we look for a cut where the number of edges between the two subsets is the maximum. We can represent a cut of the graph by a binary vector $x$ of size $n$, assigning 0 and 1 to nodes in the first and second subsets, respectively. The number of connecting edges for a given cut is simply given by summing over $x_i (1-x_j)+x_j (1-x_i)$ for every pair of connected nodes $(i,j)$.\n",
"\n",
"# Solving with the Classiq Platform\n"
"## Solving with the Classiq Platform\n"
]
},
{
Expand Down Expand Up @@ -52,15 +52,15 @@
"id": "6e32027b-edd3-47d2-bb68-233bbea58fc9",
"metadata": {},
"source": [
"### Define the Cut Search Problem"
"### Defining the Cut Search Problem"
]
},
{
"cell_type": "markdown",
"id": "a651a787-2c21-476d-8426-5a5f1be75e10",
"metadata": {},
"source": [
"We use SymPy to create an formula for the cut, for use later in the quantum algorithm."
"We use SymPy to create an formula for the cut, for use later in the quantum algorithm:"
]
},
{
Expand Down Expand Up @@ -90,7 +90,7 @@
"id": "39d882bc-56e8-4680-8803-14b1dd05d115",
"metadata": {},
"source": [
"### Define a Specific Problem Input"
"### Defining a Specific Problem Input"
]
},
{
Expand Down Expand Up @@ -219,7 +219,7 @@
}
},
"source": [
"## Synthesizing the Circuit\n",
"### Synthesizing the Circuit\n",
"\n",
"We synthesize the circuit using the Classiq synthesis engine. The synthesis takes several seconds:"
]
Expand All @@ -246,7 +246,7 @@
"tags": []
},
"source": [
"## Showing the Resulting Circuit\n",
"### Showing the Resulting Circuit\n",
"\n",
"After the Classiq synthesis engine finishes the job, we display the resulting circuit in the interactive GUI:"
]
Expand Down Expand Up @@ -302,7 +302,7 @@
}
},
"source": [
"### Execute on a Simulator to Find a Valid Solution\n",
"### Executing on a Simulator to Find a Valid Solution\n",
"Lastly, we run the resulting circuit on the Classiq execute interface using the `execute` function."
]
},
Expand Down