Skip to content

Commit 5f5bfc7

Browse files
authored
Improve wording across example Colab notebooks (#343)
Also fixes some small bugs introduced in #342 in one of the notebooks.
1 parent e059321 commit 5f5bfc7

24 files changed

+143
-153
lines changed

Diff for: examples/Advanced_Sampling_Introduction.ipynb

+13-15
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
"\n",
2626
"# Setting up the environment\n",
2727
"\n",
28-
"First, we set up our environment. We use an already compiled and packaged installation of HOOMD-blue and the hoomd-dlext plugin.\n",
29-
"We download it from Google Drive and make it visible to the running python process in this Colab instance.\n"
28+
"First, we set up our environment. We will be using a pre-compiled and packaged installation of HOOMD-blue and the hoomd-dlext plugin.\n",
29+
"It will be downloaded from Google Drive and made accessible to the Python process running in this Colab instance.\n"
3030
]
3131
},
3232
{
@@ -130,7 +130,7 @@
130130
"\n",
131131
"## PySAGES\n",
132132
"\n",
133-
"The next step is to install PySAGES. First, we need to install JAX. Fortunately, Colab already ships with JAX pre-installed (to learn how to install it you can look at the [JAX documentation](https://jax.readthedocs.io) for more details). To install PySAGES, we retrieve the latest version from GitHub and add its dependecies via `pip`.\n"
133+
"The next step is to install PySAGES. First, we need to install JAX. Fortunately, Colab already ships with JAX pre-installed (to learn how to install it you can look at the [JAX documentation](https://jax.readthedocs.io) for more details). To install PySAGES, we retrieve the latest version from GitHub and add its dependencies via `pip`.\n"
134134
]
135135
},
136136
{
@@ -183,7 +183,7 @@
183183
"\n",
184184
"- Protein folding\n",
185185
"- Protein-ligand binding\n",
186-
"- Liqid membrane fusion"
186+
"- Liquid membrane fusion"
187187
]
188188
},
189189
{
@@ -285,7 +285,7 @@
285285
"\n",
286286
"Let's examine such a system via computer simulations.\n",
287287
"\n",
288-
"- fast to integration\n",
288+
"- fast to integrate\n",
289289
"- custom bond potential to shape the free-energy landscape\n",
290290
"\n",
291291
"$$P(r) = Ar^2 + A(1-e^{-r^2})\\cos(r p \\pi)$$\n"
@@ -1073,7 +1073,7 @@
10731073
"\n",
10741074
"We want to find the free-energy profile along a given path in the space for collective variables. Usually, this path can be multidimensional.\n",
10751075
"\n",
1076-
"Example dihedral angles of Alanine Dipeptide. [PySAGES Alanine Dipentide examples](https://colab.research.google.com/github/SSAGESLabs/PySAGES/blob/main/examples/openmm/Harmonic_Bias.ipynb)\n",
1076+
"Example dihedral angles of Alanine Dipeptide. [PySAGES Alanine Dipeptide examples](https://colab.research.google.com/github/SSAGESLabs/PySAGES/blob/main/examples/openmm/Harmonic_Bias.ipynb)\n",
10771077
"\n",
10781078
"<img src=https://cdn.ncbi.nlm.nih.gov/pmc/blobs/a1dd/4715807/e8dece12c024/nihms-706794-f0001.jpg width=500>\n",
10791079
"\n",
@@ -1459,7 +1459,7 @@
14591459
"General Idea:\n",
14601460
"\n",
14611461
"Move the string (path) along the perpendicular component $\\Delta V^\\perp$ at each discretized point $v_i = - \\Delta V^\\perp$. (Gradient descent)\n",
1462-
"The parallel component would move the discretized point just along the path and end up in the minima.\n",
1462+
"The parallel component would move the discretized point just along the path and end up in a minimum.\n",
14631463
"\n",
14641464
"Problem 1:\n",
14651465
"\n",
@@ -1489,20 +1489,18 @@
14891489
"\n",
14901490
"### Improved string method\n",
14911491
"\n",
1492-
"Using the perpendicular component directly does not lead to good convergences.\n",
1492+
"Using the perpendicular component directly does not lead to good convergence.\n",
14931493
"Instead, we can use the improved string method.\n",
14941494
"\n",
14951495
"Iterate:\n",
14961496
"\n",
14971497
"1. Calculate $\\Delta V|_{t_i}$\n",
14981498
"2. Move string $\\xi_0(t_i)$ += $\\alpha \\Delta V|_{t_i}$\n",
14991499
"3. Calculate spline $\\xi_0^s(t)$\n",
1500-
"4. Re-parametrize the string points.\n",
1501-
" > Such that $|\\xi*0^s(t_i) - \\xi_0^s(t*{i+1})| = $const.\n",
1502-
" >\n",
1503-
" > - cancels out parallel force component\n",
1504-
" > - well-discretized string\n",
1505-
" > - requires a norm in $\\xi$ space. For example $L^2$ norm in $\\xi$ space.\n",
1500+
"4. Re-parametrize the string points such that $|\\xi_0^s(t_i) - \\xi_0^s(t_{i+1})| = const$.\n",
1501+
" - cancels out parallel force component\n",
1502+
" - well-discretized string\n",
1503+
" - requires a norm in $\\xi$ space. For example $L^2$ norm in $\\xi$ space.\n",
15061504
"\n",
15071505
"Stop iteration if converged and test $\\Delta V^\\perp = 0$.\n",
15081506
"\n",
@@ -1514,7 +1512,7 @@
15141512
"\n",
15151513
"Let us define a committor probability.\n",
15161514
"\n",
1517-
"For a given point $r_i$ we can define the probability that a simulation started from this point ends in minima $B$ first before it moves through $B$.\n",
1515+
"For a given point $r_i$ we can define the probability that a simulation started from this point ends in minimum $B$ first before it moves through $B$.\n",
15181516
"$$\\text{commitor probability B: } p_B(r_i)$$\n",
15191517
"\n",
15201518
"This is a probability since we can have multiple realizations of $r_i$ in momentum space (Maxwell-Boltzmann distribution). Each of these realizations has its path and we simulate them and measure if they arrive in $A$ or $B$ first."

Diff for: examples/Advanced_Sampling_Introduction.md

+13-15
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ The University of Chicago
2929

3030
# Setting up the environment
3131

32-
First, we set up our environment. We use an already compiled and packaged installation of HOOMD-blue and the hoomd-dlext plugin.
33-
We download it from Google Drive and make it visible to the running python process in this Colab instance.
32+
First, we set up our environment. We will be using a pre-compiled and packaged installation of HOOMD-blue and the hoomd-dlext plugin.
33+
It will be downloaded from Google Drive and made accessible to the Python process running in this Colab instance.
3434

3535
<!-- #endregion -->
3636

@@ -76,7 +76,7 @@ We'll also need some additional python dependencies
7676

7777
## PySAGES
7878

79-
The next step is to install PySAGES. First, we need to install JAX. Fortunately, Colab already ships with JAX pre-installed (to learn how to install it you can look at the [JAX documentation](https://jax.readthedocs.io) for more details). To install PySAGES, we retrieve the latest version from GitHub and add its dependecies via `pip`.
79+
The next step is to install PySAGES. First, we need to install JAX. Fortunately, Colab already ships with JAX pre-installed (to learn how to install it you can look at the [JAX documentation](https://jax.readthedocs.io) for more details). To install PySAGES, we retrieve the latest version from GitHub and add its dependencies via `pip`.
8080

8181
<!-- #endregion -->
8282

@@ -106,7 +106,7 @@ Many systems have rugged free-energy landscapes, where different basins are divi
106106

107107
- Protein folding
108108
- Protein-ligand binding
109-
- Liqid membrane fusion
109+
- Liquid membrane fusion
110110
<!-- #endregion -->
111111

112112
<!-- #region id="mHOcKW-fXoK5" -->
@@ -189,7 +189,7 @@ $$p \propto e^{-\beta \Delta E} \ll 1$$
189189

190190
Let's examine such a system via computer simulations.
191191

192-
- fast to integration
192+
- fast to integrate
193193
- custom bond potential to shape the free-energy landscape
194194

195195
$$P(r) = Ar^2 + A(1-e^{-r^2})\cos(r p \pi)$$
@@ -645,7 +645,7 @@ Can we bias simulations in these regions too, to improve sampling coverage?
645645

646646
We want to find the free-energy profile along a given path in the space for collective variables. Usually, this path can be multidimensional.
647647

648-
Example dihedral angles of Alanine Dipeptide. [PySAGES Alanine Dipentide examples](https://colab.research.google.com/github/SSAGESLabs/PySAGES/blob/main/examples/openmm/Harmonic_Bias.ipynb)
648+
Example dihedral angles of Alanine Dipeptide. [PySAGES Alanine Dipeptide examples](https://colab.research.google.com/github/SSAGESLabs/PySAGES/blob/main/examples/openmm/Harmonic_Bias.ipynb)
649649

650650
<img src=https://cdn.ncbi.nlm.nih.gov/pmc/blobs/a1dd/4715807/e8dece12c024/nihms-706794-f0001.jpg width=500>
651651

@@ -916,7 +916,7 @@ The normal component of the force $\Rightarrow \Delta V^\perp = 0$ is zero.
916916
General Idea:
917917

918918
Move the string (path) along the perpendicular component $\Delta V^\perp$ at each discretized point $v_i = - \Delta V^\perp$. (Gradient descent)
919-
The parallel component would move the discretized point just along the path and end up in the minima.
919+
The parallel component would move the discretized point just along the path and end up in a minimum.
920920

921921
Problem 1:
922922

@@ -946,20 +946,18 @@ $\Rightarrow$ smooth path $\xi_0^s(t)$ with $\xi_0^s(t) = \xi(t_i)$.
946946

947947
### Improved string method
948948

949-
Using the perpendicular component directly does not lead to good convergences.
949+
Using the perpendicular component directly does not lead to good convergence.
950950
Instead, we can use the improved string method.
951951

952952
Iterate:
953953

954954
1. Calculate $\Delta V|_{t_i}$
955955
2. Move string $\xi_0(t_i)$ += $\alpha \Delta V|_{t_i}$
956956
3. Calculate spline $\xi_0^s(t)$
957-
4. Re-parametrize the string points.
958-
> Such that $|\xi*0^s(t_i) - \xi_0^s(t*{i+1})| = $const.
959-
>
960-
> - cancels out parallel force component
961-
> - well-discretized string
962-
> - requires a norm in $\xi$ space. For example $L^2$ norm in $\xi$ space.
957+
4. Re-parametrize the string points such that $|\xi_0^s(t_i) - \xi_0^s(t_{i+1})| = const$.
958+
- cancels out parallel force component
959+
- well-discretized string
960+
- requires a norm in $\xi$ space. For example $L^2$ norm in $\xi$ space.
963961

964962
Stop iteration if converged and test $\Delta V^\perp = 0$.
965963

@@ -971,7 +969,7 @@ With the converged path, calculate the free-energy profile using umbrella integr
971969

972970
Let us define a committor probability.
973971

974-
For a given point $r_i$ we can define the probability that a simulation started from this point ends in minima $B$ first before it moves through $B$.
972+
For a given point $r_i$ we can define the probability that a simulation started from this point ends in minimum $B$ first before it moves through $B$.
975973
$$\text{commitor probability B: } p_B(r_i)$$
976974

977975
This is a probability since we can have multiple realizations of $r_i$ in momentum space (Maxwell-Boltzmann distribution). Each of these realizations has its path and we simulate them and measure if they arrive in $A$ or $B$ first.

Diff for: examples/Installing_a_PySAGES_Environment.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@
243243
"\n",
244244
"## Building and Installing the HOOMD-dlext Plugin\n",
245245
"\n",
246-
"Now we can install the `dlext` plugin for HOOMD-blue. But, we need to get some dependecies first.\n"
246+
"Now we can install the `dlext` plugin for HOOMD-blue. But, we need to get some dependencies first.\n"
247247
]
248248
},
249249
{
@@ -320,7 +320,7 @@
320320
"\n",
321321
"# Adding OpenMM Support\n",
322322
"\n",
323-
"Having previously set our the environment, we can now just simply install some required dependencies and build and install OpenMM.\n",
323+
"Having previously set up the environment, we can now just simply install some required dependencies and build and install OpenMM.\n",
324324
"\n",
325325
"Again, installing dependencies will be different depending on your operating system and python environment."
326326
]

Diff for: examples/Installing_a_PySAGES_Environment.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ cmake --build $BUILD_PATH --target install -j8 > /dev/null
148148

149149
## Building and Installing the HOOMD-dlext Plugin
150150

151-
Now we can install the `dlext` plugin for HOOMD-blue. But, we need to get some dependecies first.
151+
Now we can install the `dlext` plugin for HOOMD-blue. But, we need to get some dependencies first.
152152

153153
<!-- #endregion -->
154154

@@ -191,7 +191,7 @@ import hoomd.dlext
191191

192192
# Adding OpenMM Support
193193

194-
Having previously set our the environment, we can now just simply install some required dependencies and build and install OpenMM.
194+
Having previously set up the environment, we can now just simply install some required dependencies and build and install OpenMM.
195195

196196
Again, installing dependencies will be different depending on your operating system and python environment.
197197
<!-- #endregion -->

Diff for: examples/hoomd-blue/ann/Butane_ANN.ipynb

+9-11
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"source": [
99
"# Setting up the environment\n",
1010
"\n",
11-
"First, we set up our environment. We use an already compiled and packaged installation of HOOMD-blue and the hoomd-dlext plugin.\n",
12-
"We download it from Google Drive and make it visible to the running python process in this Colab instance."
11+
"First, we set up our environment. We will be using a pre-compiled and packaged installation of HOOMD-blue and the hoomd-dlext plugin.\n",
12+
"It will be downloaded from Google Drive and made accessible to the Python process running in this Colab instance."
1313
]
1414
},
1515
{
@@ -112,7 +112,7 @@
112112
"source": [
113113
"## PySAGES\n",
114114
"\n",
115-
"The next step is to install PySAGES. We retrieve the latest version from GitHub and add its dependecies via `pip`."
115+
"Next, we install PySAGES. The latest version is retrieved from GitHub and installed (along with its dependencies) using `pip`."
116116
]
117117
},
118118
{
@@ -157,7 +157,7 @@
157157
"source": [
158158
"ANN gradually learns the free energy from a probability density estimate based on the frequency of visits to the grid on collective variable space.\n",
159159
"\n",
160-
"For this Colab, we are using butane as the example molecule."
160+
"In this Colab notebook, we will use butane as an example system."
161161
]
162162
},
163163
{
@@ -435,7 +435,7 @@
435435
},
436436
"source": [
437437
"\n",
438-
"Next, we load PySAGES and the relevant classes and methods for our problem\n"
438+
"Next, we import PySAGES and the necessary classes and methods for our simulation\n"
439439
]
440440
},
441441
{
@@ -494,8 +494,8 @@
494494
},
495495
"source": [
496496
"\n",
497-
"We now simulate $5\\times10^5$ time steps.\n",
498-
"Make sure to run with GPU support, otherwise, it can take a very long time.\n"
497+
"We will now run a simulation for $5\\times10^5$ time steps.\n",
498+
"For optimal performance, ensure that the simulation is executed with GPU acceleration. Otherwise, it may take a considerably longer time to complete.\n"
499499
]
500500
},
501501
{
@@ -688,8 +688,7 @@
688688
"id": "PXBKUfK0p9T2"
689689
},
690690
"source": [
691-
"\n",
692-
"Let's now plot the free energy landscape learned by the ANN sampling method.\n"
691+
"We can now visualize the free energy landscape learned by the ANN sampling method."
693692
]
694693
},
695694
{
@@ -768,8 +767,7 @@
768767
"id": "Kf_CMdih90Cd"
769768
},
770769
"source": [
771-
"\n",
772-
"You can compare this with the free energy landscape for the different conformations of butane.\n"
770+
"You can compare this with the free energy landscape for the different conformations of butane."
773771
]
774772
}
775773
],

Diff for: examples/hoomd-blue/ann/Butane_ANN.md

+8-12
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ jupyter:
1616
<!-- #region id="T-Qkg9C9n7Cc" -->
1717
# Setting up the environment
1818

19-
First, we set up our environment. We use an already compiled and packaged installation of HOOMD-blue and the hoomd-dlext plugin.
20-
We download it from Google Drive and make it visible to the running python process in this Colab instance.
19+
First, we set up our environment. We will be using a pre-compiled and packaged installation of HOOMD-blue and the hoomd-dlext plugin.
20+
It will be downloaded from Google Drive and made accessible to the Python process running in this Colab instance.
2121
<!-- #endregion -->
2222

2323
```bash id="3eTbKklCnyd_"
@@ -61,7 +61,7 @@ We'll also need some additional python dependencies
6161
<!-- #region id="we_mTkFioS6R" -->
6262
## PySAGES
6363

64-
The next step is to install PySAGES. We retrieve the latest version from GitHub and add its dependecies via `pip`.
64+
Next, we install PySAGES. The latest version is retrieved from GitHub and installed (along with its dependencies) using `pip`.
6565
<!-- #endregion -->
6666

6767
```python id="B-HB9CzioV5j"
@@ -81,7 +81,7 @@ cd /content/ann
8181
<!-- #region id="0W2ukJuuojAl" -->
8282
ANN gradually learns the free energy from a probability density estimate based on the frequency of visits to the grid on collective variable space.
8383

84-
For this Colab, we are using butane as the example molecule.
84+
In this Colab notebook, we will use butane as an example system.
8585
<!-- #endregion -->
8686

8787
```python id="BBvC7Spoog82"
@@ -347,7 +347,7 @@ def generate_simulation(kT = kT, dt = dt, device = hoomd.device.auto_select(), s
347347

348348
<!-- #region id="3UrzENm_oo6U" -->
349349

350-
Next, we load PySAGES and the relevant classes and methods for our problem
350+
Next, we import PySAGES and the necessary classes and methods for our simulation
351351

352352
<!-- #endregion -->
353353

@@ -384,8 +384,8 @@ method = ANN(cvs, grid, topology, kT)
384384

385385
<!-- #region id="Fz8BfU34pA_N" -->
386386

387-
We now simulate $5\times10^5$ time steps.
388-
Make sure to run with GPU support, otherwise, it can take a very long time.
387+
We will now run a simulation for $5\times10^5$ time steps.
388+
For optimal performance, ensure that the simulation is executed with GPU acceleration. Otherwise, it may take a considerably longer time to complete.
389389

390390
<!-- #endregion -->
391391

@@ -394,9 +394,7 @@ run_result = pysages.run(method, generate_simulation, int(5e5))
394394
```
395395

396396
<!-- #region id="PXBKUfK0p9T2" -->
397-
398-
Let's now plot the free energy landscape learned by the ANN sampling method.
399-
397+
We can now visualize the free energy landscape learned by the ANN sampling method.
400398
<!-- #endregion -->
401399

402400
```python id="X69d1R7OpW4P"
@@ -421,7 +419,5 @@ fig.show()
421419
```
422420

423421
<!-- #region id="Kf_CMdih90Cd" -->
424-
425422
You can compare this with the free energy landscape for the different conformations of butane.
426-
427423
<!-- #endregion -->

0 commit comments

Comments
 (0)