Skip to content

Commit 57a57a9

Browse files
Merge pull request #14 from KennethQNgo/main
Text Improvements: Typos and Grammar Fixes in Chapters 1-8
2 parents 203b6e6 + ce13f9f commit 57a57a9

File tree

9 files changed

+43
-42
lines changed

9 files changed

+43
-42
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ expertise in these fields.
5151
#### Contributors
5252

5353
- [Jake Anderson](https://github.com/jaketanderson)
54+
- [Kenneth Ngo](https://github.com/KennethQNgo)
5455

5556
### Acknowledgments and license
5657

docs/source/chapters/chapter1.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,8 @@ any *AssertionError*:
325325

326326
.. code-block:: bw
327327
328-
Utilities does not inherit from MonteCarlo, as expected
329328
MonteCarlo correctly inherits from Utilities
329+
Utilities does not inherit from MonteCarlo, as expected
330330
331331
Alternatively, this test can also be launched using *Pytest* by typing in a terminal:
332332

docs/source/chapters/chapter2.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Setting Up the Simulation
44
==========================
55

66
To streamline the simulation process, all user-specified parameters will be
7-
non-dimensionalized. By removing units from the calculations, we simplify
8-
complex operations like force evaluation, making the code more efficient and
9-
easier to manage. This non-dimensionalization is handled within the *Prepare*
7+
nondimensionalized. By removing units from the calculations, we simplify
8+
complex operations like force evaluation, making the code more efficient, and
9+
easier to manage. This nondimensionalization is handled within the *Prepare*
1010
class.
1111

1212
While this step may not be the most thrilling aspect of the simulation, it is
@@ -80,7 +80,7 @@ Four atom parameters are provided to the *Prepare* class:
8080
- the LJ parameters :math:`\sigma` and :math:`\epsilon`,
8181
- and the number of atoms.
8282

83-
All these quantities must be supplied as lists. This will be useful later when
83+
All these quantities must be provided as lists of values. This will be useful later when
8484
we want to mix atoms of different types within the same simulation box.
8585

8686
Modify the *Prepare* class as follows:

docs/source/chapters/chapter4.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ following *run()* method to the *MinimizeEnergy* class:
8282
self.displacement = 0.01 # pick a random initial displacement (dimentionless)
8383
# *step* loops for 0 to *maximum_steps*+1
8484
for self.step in range(0, self.maximum_steps+1):
85-
# First, meevaluate the initial energy and max force
85+
# First, evaluate the initial energy and max force
8686
self.update_neighbor_lists() # Rebuild neighbor list, if necessary
8787
self.update_cross_coefficients() # Recalculate the cross coefficients, if necessary
8888
# Compute Epot/MaxF/force
89-
if hasattr(self, 'Epot') is False: # If self.Epot does not exists yet, calculate it
89+
if hasattr(self, 'Epot') is False: # If self.Epot does not exist yet, calculate it
9090
self.Epot = self.compute_potential()
91-
if hasattr(self, 'MaxF') is False: # If self.MaxF does not exists yet, calculate it
91+
if hasattr(self, 'MaxF') is False: # If self.MaxF does not exist yet, calculate it
9292
forces = self.compute_force()
9393
self.MaxF = np.max(np.abs(forces))
9494
init_Epot = self.Epot

docs/source/chapters/chapter5.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ VMD :cite:`humphrey1996vmd` or Ovito :cite:`stukowski2009visualization`.
1212
Create logger
1313
-------------
1414

15-
Let us create a function named *log_simulation_data()* to a file named *logger.py*.
16-
With the logger, some output are being printed in a file, as well as in the terminal.
15+
Let us create a function named *log_simulation_data()* in a file named *logger.py*.
16+
With the logger, various outputs are being printed to a file, as well as to the terminal.
1717
The period of printing, which is a multiple of the simulation steps, will be set
1818
by a new parameter named *thermo_period* (integer). All quantities are
19-
converted into *real* units before getting outputed (see :ref:`chapter2-label`).
19+
converted into *real* units before getting outputted (see :ref:`chapter2-label`).
2020

2121
.. label:: start_logger_class
2222

@@ -56,7 +56,7 @@ converted into *real* units before getting outputed (see :ref:`chapter2-label`).
5656
return logger
5757
5858
def log_simulation_data(code):
59-
# TOFIX: ceurrently, MaxF is returned dimensionless
59+
# TOFIX: currently, MaxF is returned dimensionless
6060
6161
# Setup the logger with the folder name, overwriting the log if code.step is 0
6262
logger = setup_logger(code.data_folder, overwrite=(code.step == 0))
@@ -87,10 +87,10 @@ converted into *real* units before getting outputed (see :ref:`chapter2-label`).
8787
8888
.. label:: end_logger_class
8989

90-
For simplicify, the *logger* uses the |logging| library, which provides a
90+
For simplicity, the *logger* uses the |logging| library, which provides a
9191
flexible framework for emitting log messages from Python programs. Depending on
92-
the value of *thermo_outputs*, different informations are printed, such as
93-
*step*, *Epot*, or/and *MaxF*.
92+
the value of *thermo_outputs*, different information are printed, such as
93+
*step*, *Epot*, and/or *MaxF*.
9494

9595
.. |logging| raw:: html
9696

@@ -185,7 +185,7 @@ Add the same lines at the top of the *MinimizeEnergy.py* file:
185185
.. label:: end_MinimizeEnergy_class
186186

187187
Finally, let us make sure that *thermo_period*, *dumping_period*, and *thermo_outputs*
188-
parameters are passed the InitializeSimulation method:
188+
parameters are passed to the InitializeSimulation method:
189189

190190
.. label:: start_InitializeSimulation_class
191191

@@ -244,7 +244,7 @@ during energy minimization.
244244
Test the code
245245
-------------
246246

247-
One can use a test similar as the previous ones. Let us ask our code to print
247+
One can use a test similar to the previous ones. Let us ask our code to print
248248
information in the *dump* and the *log* files, and then let us assert that the
249249
files were indeed created without the *Outputs/* folder:
250250

@@ -316,10 +316,10 @@ simulation. The content of the *simulation.log* file should resemble:
316316
75 -1.22 3.77
317317
100 -2.10 1.28
318318
319-
The data from the *simulation.log* can be used to generate plots using softwares
320-
line XmGrace, GnuPlot, or Python/Pyplot. For the later, one can use a simple data
319+
The data from the *simulation.log* can be used to generate plots using software
320+
like XmGrace, GnuPlot, or Python/Pyplot. For the latter, one can use a simple data
321321
reader to import the data from *simulation.log* into Python. Copy the
322-
following lines in a new file named *reader.py*:
322+
following lines into a new file named *reader.py*:
323323

324324
.. label:: start_reader_class
325325

docs/source/chapters/chapter6.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ Let us add a method named *monte_carlo_move* to the *MonteCarlo* class:
5151
# When needed, recalculate neighbor/coeff lists
5252
self.update_neighbor_lists()
5353
self.update_cross_coefficients()
54-
# If self.Epot does not exists yet, calculate it
54+
# If self.Epot does not exist yet, calculate it
5555
# It should only be necessary when step = 0
5656
if hasattr(self, 'Epot') is False:
5757
self.Epot = self.compute_potential()
58-
# Make a copy of the initial atoms positions and initial energy
58+
# Make a copy of the initial atom positions and initial energy
5959
initial_Epot = self.Epot
6060
initial_positions = copy.deepcopy(self.atoms_positions)
6161
# Pick an atom id randomly

docs/source/chapters/chapter7.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ To evaluate all the vectors between all the particles, let us also add the
8585
Test the code
8686
-------------
8787

88-
Let us test the outputed pressure.
88+
Let us test the outputted pressure.
8989

9090
.. label:: start_test_7a_class
9191

docs/source/chapters/chapter8.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ Monte Carlo insert
55

66
Here, a *Monte Carlo* simulation is implemented in the Grand Canonical ensemble,
77
where the number of atoms in the system fluctuates. The principle of the
8-
simulation resemble the Monte Carlo move from :ref:`chapter6-label`:
8+
simulation resembles the Monte Carlo move from :ref:`chapter6-label`:
99

10-
- 1) We start from a given intial configuration, and measure the potential
10+
- 1) We start from a given initial configuration, and measure the potential
1111
energy, :math:`E_\text{pot}^\text{initial}`.
1212
- 2) A random number is chosen, and depending on its value, either a new particle
13-
will tried to be inserted, or an existing particle will tried to be deleted.
14-
- 3) The energy of the system after the insersion/deletion,
13+
will try to be inserted, or an existing particle will try to be deleted.
14+
- 3) The energy of the system after the insertion/deletion,
1515
:math:`E_\text{pot}^\text{trial}`, is measured.
1616
- 4) We then decide to keep or reject the move by calculating
1717
the difference in energy between the trial and the initial configurations:
@@ -97,7 +97,7 @@ Then, let us write the *monte_carlo_insert()* method:
9797
trial_Epot = self.compute_potential()
9898
Lambda = self.calculate_Lambda(self.atom_mass[self.inserted_type])
9999
beta = 1/self.desired_temperature
100-
Nat = np.sum(self.number_atoms) # NUmber atoms, should it relly be N? of N (type) ?
100+
Nat = np.sum(self.number_atoms) # Number atoms, should it really be N? of N (type) ?
101101
Vol = np.prod(self.box_size[:3]) # box volume
102102
# dimension of 3 is enforced in the power of the Lambda
103103
self.acceptation_probability = np.min([1, Vol/(Lambda**3*Nat) \
@@ -129,7 +129,7 @@ Let us add the very similar *monte_carlo_delete()* method:
129129
trial_Epot = self.compute_potential()
130130
Lambda = self.calculate_Lambda(self.atom_mass[self.inserted_type])
131131
beta = 1/self.desired_temperature
132-
Nat = np.sum(self.number_atoms) # NUmber atoms, should it relly be N? of N (type) ?
132+
Nat = np.sum(self.number_atoms) # Number atoms, should it really be N? of N (type) ?
133133
Vol = np.prod(self.box_size[:3]) # box volume
134134
# dimension of 3 is enforced in the power of the Lambda
135135
self.acceptation_probability = np.min([1, (Lambda**3 *(Nat-1)/Vol) \
@@ -145,7 +145,7 @@ Complete the *__init__* method as follows:
145145

146146
.. code-block:: python
147147
148-
class MonteCarlo(Outputs):
148+
class MonteCarlo(Measurements):
149149
def __init__(self,
150150
(...)
151151
displace_mc = None,
@@ -160,7 +160,7 @@ and
160160

161161
.. code-block:: python
162162
163-
class MonteCarlo(Outputs):
163+
class MonteCarlo(Measurements):
164164
def __init__(self,
165165
(...)
166166
self.displace_mc = displace_mc
@@ -169,7 +169,7 @@ and
169169
170170
.. label:: end_MonteCarlo_class
171171

172-
Let us also normalised the "desired_mu":
172+
Let us also normalize the "desired_mu":
173173

174174
.. label:: start_MonteCarlo_class
175175

@@ -300,4 +300,4 @@ potential *desired_mu*:
300300
.. label:: end_test_9a_class
301301

302302
The evolution of the potential energy as a function of the
303-
number of steps are written in the *Outputs/Epot.dat*.
303+
number of steps is written in the *Outputs/Epot.dat*.

docs/source/projects/project1.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Within the Python script, write:
9898

9999
.. code-block:: python
100100
101-
epsilon = (119.76*ureg.kelvin*cst.Boltzmann*cst.N_A).to(ureg.kcal/ureg.mol)
101+
epsilon = (119.76*ureg.kelvin*kB*Na).to(ureg.kcal/ureg.mol)
102102
r_star = 3.822*ureg.angstrom
103103
sigma = r_star / 2**(1/6)
104104
m_argon = 39.948*ureg.gram/ureg.mol
@@ -161,17 +161,17 @@ statistical mechanics that describes how the state variables of a system, such a
161161
pressure :math:`p`, volume :math:`V`, and temperature :math:`T`, are interrelated.
162162
Here, let us extract the pressure of the fluid for different density values.
163163

164-
To easily launch multiple simulation in parallel, let us create a
164+
To easily launch multiple simulations in parallel, let us create a
165165
function called *launch_MC_code* that will be used to call
166166
our Monte Carlo script with a chosen value of :math:`\tau = v / v^*`.
167167

168-
Create a new function, so that the current script ressemble the following:
168+
Create a new function so that the current script resembles the following:
169169

170170
.. code-block:: python
171171
172172
def launch_MC_code(tau):
173173
174-
epsilon = (119.76*ureg.kelvin*cst.Boltzmann*cst.N_A).to(ureg.kcal/ureg.mol)
174+
epsilon = (119.76*ureg.kelvin*kB*Na).to(ureg.kcal/ureg.mol)
175175
r_star = 3.822*ureg.angstrom
176176
sigma = r_star / 2**(1/6)
177177
m_argon = 39.948*ureg.gram/ureg.mol
@@ -217,7 +217,7 @@ simulation with too much overlap between the atoms:
217217
)
218218
em.run()
219219
220-
Then, let us start the Monte carlo simulation. As initial positions for the atoms,
220+
Then, let us start the Monte Carlo simulation. For the initial positions of the atoms,
221221
let us use the last positions from the *em* run,
222222
i.e. *initial_positions = em.atoms_positions*em.reference_distance*:
223223

@@ -256,12 +256,12 @@ i.e. *initial_positions = em.atoms_positions*em.reference_distance*:
256256
mc.run()
257257
258258
Finally, it is possible to call the *launch_MC_code* function using
259-
*multiprocessing*, and perform the simulation for multiple value of :math:`\tau`
259+
*multiprocessing*, and perform the simulation for multiple values of :math:`\tau`
260260
at the same time (if your computer has enough CPU core, if not, perform these
261261
calculations in serial):
262262

263263
.. code-block:: python
264-
264+
A
265265
if __name__ == "__main__":
266266
tau_values = np.round(np.logspace(-0.126, 0.882, 10),2)
267267
pool = multiprocessing.Pool()
@@ -287,7 +287,7 @@ with those of Ref. :cite:`woodMonteCarloEquation1957`:
287287
:class: only-dark
288288

289289
Figure: Equation of state of the argon fluid as calculated using the Monte
290-
carlo code (disks), and compared with the results from Ref. :cite:`woodMonteCarloEquation1957`.
291-
Normalised pressure, :math:`p V / RT` as a function of the normalised volume,
290+
Carlo code (disks), and compared with the results from Ref. :cite:`woodMonteCarloEquation1957`.
291+
Normalized pressure, :math:`p V / RT` as a function of the normalized volume,
292292
:math:`V / V^*`, where :math:`V^*` is the molar volume. For benchmark purposes,
293293
the data obtained using LAMMPS were also added.

0 commit comments

Comments
 (0)