Skip to content

Commit 42c7768

Browse files
AnnePicusclassiqdor
authored andcommitted
English suggestions for Integer Programming
1 parent 4d68d38 commit 42c7768

File tree

1 file changed

+22
-33
lines changed

1 file changed

+22
-33
lines changed

applications/optimization/integer_linear_programming/integer_linear_programming.ipynb

Lines changed: 22 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
{
44
"cell_type": "markdown",
55
"id": "0",
6-
"metadata": {
7-
"jp-MarkdownHeadingCollapsed": true
8-
},
6+
"metadata": {},
97
"source": [
108
"# Integer Linear Programming"
119
]
@@ -15,44 +13,35 @@
1513
"id": "1",
1614
"metadata": {},
1715
"source": [
18-
"## Introduction\n",
19-
"\n",
20-
"In Integer Linear Programming (ILP), we seek to find a vector of integer numbers that maximizes (or minimizes) a linear cost function under a set of linear equality or inequality constraints [[1]](#ILP). In other words, it is an optimization problem where the cost function to be optimized and all the constraints are linear and the decision variables are integer.\n",
21-
"\n",
16+
"Integer Linear Programming (ILP) seeks a vector of integer numbers that maximizes (or minimizes) a linear cost function under a set of linear equality or inequality constraints [[1]](#ILP). In other words, it is an optimization problem where the cost function to optimize and all the constraints are linear and the decision variables are integers.\n",
2217
"\n",
2318
"\n",
24-
"### Mathematical Formulation\n",
25-
"The ILP problem can be formulated as follows:\n",
26-
"\n",
27-
"Given an $n$-dimensional vector $\\vec{c} = (c_1, c_2, \\ldots, c_n)$, an $m \\times n$ matrix $A = (a_{ij})$ with $i=1,\\ldots,m$ and $j=1,\\ldots,n$, and an $m$-dimensional vector $\\vec{b} = (b_1, b_2, \\ldots, b_m)$, find an $n$-dimensional vector $\\vec{x} = (x_1, x_2, \\ldots, x_n)$ with integer entries that maximizes (or minimizes) the cost function:\n",
19+
"## Mathematical Formulation\n",
20+
"The ILP problem can be formulated as follows: given an $n$-dimensional vector $\\vec{c} = (c_1, c_2, \\ldots, c_n)$, an $m \\times n$ matrix $A = (a_{ij})$ with $i=1,\\ldots,m$ and $j=1,\\ldots,n$, and an $m$-dimensional vector $\\vec{b} = (b_1, b_2, \\ldots, b_m)$, find an $n$-dimensional vector $\\vec{x} = (x_1, x_2, \\ldots, x_n)$ with integer entries that maximizes (or minimizes) the cost function:\n",
2821
"\n",
2922
"\\begin{align*}\n",
3023
"\\vec{c} \\cdot \\vec{x} = c_1x_1 + c_2x_2 + \\ldots + c_nx_n\n",
3124
"\\end{align*}\n",
3225
"\n",
33-
"subject to the constraints:\n",
26+
"subject to these constraints:\n",
3427
"\n",
3528
"\\begin{align*}\n",
3629
"A \\vec{x} & \\leq \\vec{b} \\\\\n",
3730
"x_j & \\geq 0, \\quad j = 1, 2, \\ldots, n \\\\\n",
3831
"x_j & \\in \\mathbb{Z}, \\quad j = 1, 2, \\ldots, n\n",
3932
"\\end{align*}\n",
4033
"\n",
41-
"\n",
42-
"\n",
43-
"## Solving with the Classiq platform\n",
44-
"\n",
45-
"We go through the steps of solving the problem with the Classiq platform, using QAOA algorithm [[2](#QAOA)]. The solution is based on defining a Pyomo model for the optimization problem we would like to solve."
34+
"This tutorial guides you through the steps of solving the problem with the Classiq platform, using QAOA [[2](#QAOA)]. The solution is based on defining a Pyomo model for the optimization problem to solve."
4635
]
4736
},
4837
{
4938
"cell_type": "markdown",
5039
"id": "2",
5140
"metadata": {},
5241
"source": [
53-
"## Building the Pyomo model from a graph input\n",
42+
"## Building the Pyomo Model from a Graph Input\n",
5443
"\n",
55-
"We proceed by defining the Pyomo model that will be used on the Classiq platform, using the mathematical formulation defined above:"
44+
"Define the Pyomo model to use on the Classiq platform, using the mathematical formulation defined above:"
5645
]
5746
},
5847
{
@@ -160,7 +149,7 @@
160149
"source": [
161150
"## Setting Up the Classiq Problem Instance\n",
162151
"\n",
163-
"In order to solve the Pyomo model defined above, we use the `CombinatorialProblem` quantum object. Under the hood it tranlastes the Pyomo model to a quantum model of the QAOA algorithm, with cost hamiltonian translated from the Pyomo model. We can choose the number of layers for the QAOA ansatz using the argument `num_layers`, and the `penalty_factor`, which will be the coefficient of the constraints term in the cost hamiltonian."
152+
"To solve the Pyomo model defined above, use the `CombinatorialProblem` quantum object. Under the hood it translates the Pyomo model to a quantum model of QAOA, with the cost Hamiltonian translated from the Pyomo model. Choose the number of layers for the QAOA ansatz using the `num_layers` argument. The `penalty_factor` is the coefficient of the constraints term in the cost Hamiltonian."
164153
]
165154
},
166155
{
@@ -195,7 +184,7 @@
195184
"source": [
196185
"## Synthesizing the QAOA Circuit and Solving the Problem\n",
197186
"\n",
198-
"We can now synthesize and view the QAOA circuit (ansatz) used to solve the optimization problem:"
187+
"Synthesize and view the QAOA circuit (ansatz) used to solve the optimization problem:"
199188
]
200189
},
201190
{
@@ -222,7 +211,7 @@
222211
"id": "11",
223212
"metadata": {},
224213
"source": [
225-
"We also set the quantum backend we want to execute on:"
214+
"Set the quantum backend on which to execute:"
226215
]
227216
},
228217
{
@@ -244,7 +233,7 @@
244233
"id": "13",
245234
"metadata": {},
246235
"source": [
247-
"We now solve the problem by calling the `optimize` method of the `CombinatorialProblem` object. For the classical optimization part of the QAOA algorithm we define the maximum number of classical iterations (`maxiter`) and the $\\alpha$-parameter (`quantile`) for running CVaR-QAOA, an improved variation of the QAOA algorithm [[3](#cvar)]:"
236+
"Solve the problem by calling the `optimize` method of the `CombinatorialProblem` object. For the classical optimization part of QAOA, define the maximum number of classical iterations (`maxiter`) and the $\\alpha$-parameter (`quantile`) for running CVaR-QAOA, an improved variation of QAOA [[3](#cvar)]:"
248237
]
249238
},
250239
{
@@ -270,7 +259,7 @@
270259
"id": "15",
271260
"metadata": {},
272261
"source": [
273-
"We can check the convergence of the run:"
262+
"Check the convergence of the run:"
274263
]
275264
},
276265
{
@@ -322,15 +311,15 @@
322311
"id": "18",
323312
"metadata": {},
324313
"source": [
325-
"We can also examine the statistics of the algorithm. The optimization is always defined as a minimzation problem, so the positive maximization objective was tranlated to a negative minimization one by the Pyomo to qmod translator."
314+
"Examine the statistics of the algorithm. The optimization is always defined as a minimization problem, so the positive maximization objective is translated to negative minimization by the Pyomo-to-Qmod translator."
326315
]
327316
},
328317
{
329318
"cell_type": "markdown",
330319
"id": "19",
331320
"metadata": {},
332321
"source": [
333-
"In order to get samples with the optimized parameters, we call the `sample` method:"
322+
"To get samples with the optimized parameters, call the `sample` method:"
334323
]
335324
},
336325
{
@@ -431,7 +420,7 @@
431420
"id": "21",
432421
"metadata": {},
433422
"source": [
434-
"We also want to compare the optimized results to uniformly sampled results:"
423+
"Compare the optimized results to uniformly sampled results:"
435424
]
436425
},
437426
{
@@ -497,7 +486,7 @@
497486
"id": "25",
498487
"metadata": {},
499488
"source": [
500-
"Let us plot the solution:"
489+
"Plot the solution:"
501490
]
502491
},
503492
{
@@ -529,15 +518,15 @@
529518
"id": "27",
530519
"metadata": {},
531520
"source": [
532-
"## Comparison to a classical solver"
521+
"## Comparing to a Classical Solver"
533522
]
534523
},
535524
{
536525
"cell_type": "markdown",
537526
"id": "28",
538527
"metadata": {},
539528
"source": [
540-
"Lastly, we can compare to the classical solution of the problem:"
529+
"Compare to the classical solution of the problem:"
541530
]
542531
},
543532
{
@@ -571,11 +560,11 @@
571560
"\n",
572561
"## References\n",
573562
"\n",
574-
"<a id='MVC'>[1]</a>: [Integer Programming (Wikipedia).](https://en.wikipedia.org/wiki/Integer_programming)\n",
563+
"<a id='MVC'>[1]</a> [Integer Programming (Wikipedia).](https://en.wikipedia.org/wiki/Integer_programming)\n",
575564
"\n",
576-
"<a id='QAOA'>[2]</a>: [Farhi, Edward, Jeffrey Goldstone, and Sam Gutmann. \"A quantum approximate optimization algorithm.\" arXiv preprint arXiv:1411.4028 (2014).](https://arxiv.org/abs/1411.4028)\n",
565+
"<a id='QAOA'>[2]</a> [Farhi, Edward, Jeffrey Goldstone, and Sam Gutmann. (2014). \"A quantum approximate optimization algorithm.\" arXiv preprint arXiv:1411.4028.](https://arxiv.org/abs/1411.4028)\n",
577566
"\n",
578-
"<a id='cvar'>[3]</a>: [Barkoutsos, Panagiotis Kl, et al. \"Improving variational quantum optimization using CVaR.\" Quantum 4 (2020): 256.](https://arxiv.org/abs/1907.04769)\n"
567+
"<a id='cvar'>[3]</a> [Barkoutsos, Panagiotis Kl, et al. (2020). \"Improving variational quantum optimization using CVaR.\" Quantum 4: 256.](https://arxiv.org/abs/1907.04769)\n"
579568
]
580569
}
581570
],

0 commit comments

Comments
 (0)