Merge branch release-2016
[alexxy/gromacs.git] / docs / manual / special.tex
1 %
2 % This file is part of the GROMACS molecular simulation package.
3 %
4 % Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
5 % Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6 % and including many others, as listed in the AUTHORS file in the
7 % top-level source directory and at http://www.gromacs.org.
8 %
9 % GROMACS is free software; you can redistribute it and/or
10 % modify it under the terms of the GNU Lesser General Public License
11 % as published by the Free Software Foundation; either version 2.1
12 % of the License, or (at your option) any later version.
13 %
14 % GROMACS is distributed in the hope that it will be useful,
15 % but WITHOUT ANY WARRANTY; without even the implied warranty of
16 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 % Lesser General Public License for more details.
18 %
19 % You should have received a copy of the GNU Lesser General Public
20 % License along with GROMACS; if not, see
21 % http://www.gnu.org/licenses, or write to the Free Software Foundation,
22 % Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
23 %
24 % If you want to redistribute modifications to GROMACS, please
25 % consider that scientific software is very special. Version
26 % control is crucial - bugs must be traceable. We will be happy to
27 % consider code for inclusion in the official distribution, but
28 % derived work must not be called official GROMACS. Details are found
29 % in the README & COPYING files - if they are missing, get the
30 % official version at http://www.gromacs.org.
31 %
32 % To help us fund GROMACS development, we humbly ask that you cite
33 % the research papers on the package. Check out http://www.gromacs.org.
34
35 \chapter{Special Topics}
36 \label{ch:special}
37
38
39 \section{Free energy implementation}
40 \label{sec:dgimplement}
41 For free energy calculations, there are two things that must be
42 specified; the end states, and the pathway connecting the end states.
43 The end states can be specified in two ways.  The most straightforward
44 is through the specification of end states in the topology file.  Most
45 potential forms support both an $A$ state and a $B$ state. Whenever both
46 states are specified, then the $A$ state corresponds to the initial free
47 energy state, and the $B$ state corresponds to the final state.
48
49 In some cases, the end state can also be defined in some cases without
50 altering the topology, solely through the {\tt .mdp} file, through the use
51 of the {\tt couple-moltype},{\tt couple-lambda0}, {\tt couple-lambda1}, and
52 {\tt couple-intramol} mdp keywords.  Any molecule type selected in
53 {\tt couple-moltype} will automatically have a $B$ state implicitly
54 constructed (and the $A$ state redefined) according to the {\tt couple-lambda}
55 keywords. {\tt couple-lambda0} and {\tt couple-lambda1} define the non-bonded
56 parameters that are present in the $A$ state ({\tt couple-lambda0})
57 and the $B$ state ({\tt couple-lambda1}).  The choices are 'q','vdw', and
58 'vdw-q'; these indicate the Coulombic, van der Waals, or both parameters
59 that are turned on in the respective state.
60
61 Once the end states are defined, then the path between the end states
62 has to be defined. This path is defined solely in the .mdp file.
63 Starting in 4.6, $\lambda$ is a vector of components, with Coulombic,
64 van der Waals, bonded, restraint, and mass components all able to be
65 adjusted independently.  This makes it possible to turn off the
66 Coulombic term linearly, and then the van der Waals using soft core,
67 all in the same simulation.  This is especially useful for replica
68 exchange or expanded ensemble simulations, where it is important to
69 sample all the way from interacting to non-interacting states in the
70 same simulation to improve sampling.
71
72 {\tt fep-lambdas} is the default array of $\lambda$ values ranging
73 from 0 to 1.  All of the other lambda arrays use the values in this
74 array if they are not specified.  The previous behavior, where the
75 pathway is controlled by a single $\lambda$ variable, can be preserved
76 by using only {\tt fep-lambdas} to define the pathway.
77
78 For example, if you wanted to first to change the Coulombic terms,
79 then the van der Waals terms, changing bonded at the same time rate as
80 the van der Waals, but changing the restraints throughout the first
81 two-thirds of the simulation, then you could use this $\lambda$ vector:
82
83 \begin{verbatim}
84 coul-lambdas           = 0.0 0.2 0.5 1.0 1.0 1.0 1.0 1.0 1.0 1.0
85 vdw-lambdas            = 0.0 0.0 0.0 0.0 0.4 0.5 0.6 0.7 0.8 1.0
86 bonded-lambdas         = 0.0 0.0 0.0 0.0 0.4 0.5 0.6 0.7 0.8 1.0
87 restraint-lambdas      = 0.0 0.0 0.1 0.2 0.3 0.5 0.7 1.0 1.0 1.0
88 \end{verbatim}
89
90 This is also equivalent to:
91
92 \begin{verbatim}
93 fep-lambdas            = 0.0 0.0 0.0 0.0 0.4 0.5 0.6 0.7 0.8 1.0
94 coul-lambdas           = 0.0 0.2 0.5 1.0 1.0 1.0 1.0 1.0 1.0 1.0
95 restraint-lambdas      = 0.0 0.0 0.1 0.2 0.3 0.5 0.7 1.0 1.0 1.0
96 \end{verbatim}
97 The {\tt fep-lambda array}, in this case, is being used as the default to
98 fill in the bonded and van der Waals $\lambda$ arrays.  Usually, it's best to fill
99 in all arrays explicitly, just to make sure things are properly
100 assigned.
101
102 If you want to turn on only restraints going from $A$ to $B$, then it would be:
103 \begin{verbatim}
104 restraint-lambdas      = 0.0 0.1 0.2 0.4 0.6 1.0
105 \end{verbatim}
106 and all of the other components of the $\lambda$ vector would be left in the $A$ state.
107
108 To compute free energies with a vector $\lambda$ using
109 thermodynamic integration, then the TI equation becomes vector equation:
110 \beq
111 \Delta F = \int \langle \nabla H \rangle \cdot d\vec{\lambda}
112 \eeq
113 or for finite differences:
114 \beq
115 \Delta F \approx \int \sum \langle \nabla H \rangle \cdot \Delta\lambda
116 \eeq
117
118 The external {\tt pymbar} script downloaded from https://SimTK.org/home/pymbar can
119 compute this integral automatically from the {\gromacs} dhdl.xvg output.
120
121 \section{Potential of mean force}
122
123 A potential of mean force (PMF) is a potential that is obtained
124 by integrating the mean force from an ensemble of configurations.
125 In {\gromacs}, there are several different methods to calculate the mean force.
126 Each method has its limitations, which are listed below.
127 \begin{itemize}
128 \item{\bf pull code:} between the centers of mass of molecules or groups of molecules.
129 \item{\bf free-energy code with harmonic bonds or constraints:} between single atoms. 
130 \item{\bf free-energy code with position restraints:} changing the conformation of a relatively immobile group of atoms.
131 \item{\bf pull code in limited cases:} between groups of atoms that are
132 part of a larger molecule for which the bonds are constrained with
133 SHAKE or LINCS. If the pull group if relatively large,
134 the pull code can be used.
135 \end{itemize}
136 The pull and free-energy code a described in more detail
137 in the following two sections.
138
139 \subsubsection{Entropic effects}
140 When a distance between two atoms or the centers of mass of two groups
141 is constrained or restrained, there will be a purely entropic contribution
142 to the PMF due to the rotation of the two groups~\cite{RMNeumann1980a}.
143 For a system of two non-interacting masses the potential of mean force is:
144 \beq
145 V_{pmf}(r) = -(n_c - 1) k_B T \log(r)
146 \eeq
147 where $n_c$ is the number of dimensions in which the constraint works
148 (i.e. $n_c=3$ for a normal constraint and $n_c=1$ when only
149 the $z$-direction is constrained).
150 Whether one needs to correct for this contribution depends on what
151 the PMF should represent. When one wants to pull a substrate
152 into a protein, this entropic term indeed contributes to the work to
153 get the substrate into the protein. But when calculating a PMF
154 between two solutes in a solvent, for the purpose of simulating
155 without solvent, the entropic contribution should be removed.
156 {\bf Note} that this term can be significant; when at 300K the distance is halved,
157 the contribution is 3.5 kJ~mol$^{-1}$.
158
159 \section{Non-equilibrium pulling}
160 When the distance between two groups is changed continuously,
161 work is applied to the system, which means that the system is no longer
162 in equilibrium. Although in the limit of very slow pulling
163 the system is again in equilibrium, for many systems this limit
164 is not reachable within reasonable computational time.
165 However, one can use the Jarzynski relation~\cite{Jarzynski1997a}
166 to obtain the equilibrium free-energy difference $\Delta G$
167 between two distances from many non-equilibrium simulations:
168 \begin{equation}
169    \Delta G_{AB} = -k_BT \log \left\langle e^{-\beta W_{AB}} \right\rangle_A
170    \label{eq:Jarz}
171 \end{equation}
172 where $W_{AB}$ is the work performed to force the system along one path
173 from state A to B, the angular bracket denotes averaging over
174 a canonical ensemble of the initial state A and $\beta=1/k_B T$.
175
176
177 \section{The pull code}
178 \index{center-of-mass pulling}
179 \label{sec:pull}
180 The pull code applies forces or constraints between the centers
181 of mass of one or more pairs of groups of atoms.
182 Each pull reaction coordinate is called a ``coordinate'' and it operates
183 on usually two, but sometimes more, pull groups. A pull group can be part of one or more pull
184 coordinates. Furthermore, a coordinate can also operate on a single group
185 and an absolute reference position in space.
186 The distance between a pair of groups can be determined
187 in 1, 2 or 3 dimensions, or can be along a user-defined vector.
188 The reference distance can be constant or can change linearly with time.
189 Normally all atoms are weighted by their mass, but an additional
190 weighting factor can also be used.
191 \begin{figure}
192 \centerline{\includegraphics[width=6cm,angle=270]{plots/pull}}
193 \caption{Schematic picture of pulling a lipid out of a lipid bilayer
194 with umbrella pulling. $V_{rup}$ is the velocity at which the spring is
195 retracted, $Z_{link}$ is the atom to which the spring is attached and
196 $Z_{spring}$ is the location of the spring.}
197 \label{fig:pull} 
198 \end{figure}
199
200 Several different pull types, i.e. ways to apply the pull force, are supported,
201 and in all cases the reference distance can be constant
202 or linearly changing with time.
203 \begin{enumerate}
204 \item{\textbf{Umbrella pulling}\swapindexquiet{umbrella}{pulling}}
205 A harmonic potential is applied between
206 the centers of mass of two groups.
207 Thus, the force is proportional to the displacement.
208 \item{\textbf{Constraint pulling\swapindexquiet{constraint}{pulling}}}
209 The distance between the centers of mass of two groups is constrained.
210 The constraint force can be written to a file.
211 This method uses the SHAKE algorithm but only needs 1 iteration to be
212 exact if only two groups are constrained. 
213 \item{\textbf{Constant force pulling}}
214 A constant force is applied between the centers of mass of two groups.
215 Thus, the potential is linear.
216 In this case there is no reference distance of pull rate.
217 \item{\textbf{Flat bottom pulling}}
218 Like umbrella pulling, but the potential and force are zero for
219 coordinate values below ({\tt pull-coord?-type = flat-bottom}) or above
220 ({\tt pull-coord?-type = flat-bottom-high}) a reference value.
221 This is useful for restraining e.g. the distance
222 between two molecules to a certain region.
223 \end{enumerate}
224 In addition, there are different types of reaction coordinates, so-called pull geometries.
225 These are set with the {\tt .mdp} option {\tt pull-coord?-geometry}.
226
227 \subsubsection{Definition of the center of mass}
228
229 In {\gromacs}, there are three ways to define the center of mass of a group.
230 The standard way is a ``plain'' center of mass, possibly with additional
231 weighting factors. With periodic boundary conditions it is no longer
232 possible to uniquely define the center of mass of a group of atoms.
233 Therefore, a reference atom is used. For determining the center of mass,
234 for all other atoms in the group, the closest periodic image to the reference
235 atom is used. This uniquely defines the center of mass.
236 By default, the middle (determined by the order in the topology) atom
237 is used as a reference atom, but the user can also select any other atom
238 if it would be closer to center of the group.
239
240 For a layered system, for instance a lipid bilayer, it may be of interest
241 to calculate the PMF of a lipid as function of its distance
242 from the whole bilayer. The whole bilayer can be taken as reference
243 group in that case, but it might also be of interest to define the
244 reaction coordinate for the PMF more locally. The {\tt .mdp} option
245 {\tt pull-coord?-geometry = cylinder} does not
246 use all the atoms of the reference group, but instead dynamically only those
247 within a cylinder with radius {\tt pull-cylinder-r} around the pull vector going
248 through the pull group. This only
249 works for distances defined in one dimension, and the cylinder is
250 oriented with its long axis along this one dimension. To avoid jumps in
251 the pull force, contributions of atoms are weighted as a function of distance
252 (in addition to the mass weighting):
253 \bea
254 w(r < r_\mathrm{cyl}) & = &
255 1-2 \left(\frac{r}{r_\mathrm{cyl}}\right)^2 + \left(\frac{r}{r_\mathrm{cyl}}\right)^4 \\
256 w(r \geq r_\mathrm{cyl}) & = & 0
257 \eea
258 Note that the radial dependence on the weight causes a radial force on
259 both cylinder group and the other pull group. This is an undesirable,
260 but unavoidable effect. To minimize this effect, the cylinder radius should
261 be chosen sufficiently large. The effective mass is 0.47 times that of
262 a cylinder with uniform weights and equal to the mass of uniform cylinder
263 of 0.79 times the radius.
264
265 \begin{figure}
266 \centerline{\includegraphics[width=6cm]{plots/pullref}}
267 \caption{Comparison of a plain center of mass reference group versus a cylinder
268 reference group applied to interface systems. C is the reference group.
269 The circles represent the center of mass of two groups plus the reference group,
270 $d_c$ is the reference distance.}
271 \label{fig:pullref} 
272 \end{figure}   
273
274 For a group of molecules in a periodic system, a plain reference group
275 might not be well-defined. An example is a water slab that is connected
276 periodically in $x$ and $y$, but has two liquid-vapor interfaces along $z$.
277 In such a setup, water molecules can evaporate from the liquid and they
278 will move through the vapor, through the periodic boundary, to the other
279 interface. Such a system is inherently periodic and there is no proper way
280 of defining a ``plain'' center of mass along $z$. A proper solution is to using
281 a cosine shaped weighting profile for all atoms in the reference group.
282 The profile is a cosine with a single period in the unit cell. Its phase
283 is optimized to give the maximum sum of weights, including mass weighting.
284 This provides a unique and continuous reference position that is nearly
285 identical to the plain center of mass position in case all atoms are all
286 within a half of the unit-cell length. See ref \cite{Engin2010a} for details.
287
288 When relative weights $w_i$ are used during the calculations, either
289 by supplying weights in the input or due to cylinder geometry
290 or due to cosine weighting,
291 the weights need to be scaled to conserve momentum:
292 \beq
293 w'_i = w_i
294 \left. \sum_{j=1}^N w_j \, m_j \right/ \sum_{j=1}^N w_j^2 \, m_j
295 \eeq
296 where $m_j$ is the mass of atom $j$ of the group.
297 The mass of the group, required for calculating the constraint force, is:
298 \beq
299 M = \sum_{i=1}^N w'_i \, m_i
300 \eeq
301 The definition of the weighted center of mass is:
302 \beq
303 \ve{r}_{com} = \left. \sum_{i=1}^N w'_i \, m_i \, \ve{r}_i \right/ M
304 \eeq
305 From the centers of mass the AFM, constraint, or umbrella force $\ve{F}_{\!com}$
306 on each group can be calculated.
307 The force on the center of mass of a group is redistributed to the atoms
308 as follows:
309 \beq
310 \ve{F}_{\!i} = \frac{w'_i \, m_i}{M} \, \ve{F}_{\!com}
311 \eeq
312
313 \subsubsection{Definition of the pull direction}
314
315 The most common setup is to pull along the direction of the vector containing
316 the two pull groups, this is selected with
317 {\tt pull-coord?-geometry = distance}. You might want to pull along a certain
318 vector instead, which is selected with {\tt pull-coord?-geometry = direction}.
319 But this can cause unwanted torque forces in the system, unless you pull against a reference group with (nearly) fixed orientation, e.g. a membrane protein embedded in a membrane along x/y while pulling along z. If your reference group does not have a fixed orientation, you should probably use
320 {\tt pull-coord?-geometry = direction-relative}, see \figref{pulldirrel}.
321 Since the potential now depends on the coordinates of two additional groups defining the orientation, the torque forces will work on these two groups.
322
323 \begin{figure}
324 \centerline{\includegraphics[width=5cm]{plots/pulldirrel}}
325 \caption{The pull setup for geometry {\tt direction-relative}. The ``normal'' pull groups are 1 and 2. Groups 3 and 4 define the pull direction and thus the direction of the normal pull forces (red). This leads to reaction forces (blue) on groups 3 and 4, which are perpendicular to the pull direction. Their magnitude is given by the ``normal'' pull force times the ratio of $d_p$ and the distance between groups 3 and 4.}
326 \label{fig:pulldirrel} 
327 \end{figure}   
328
329 \subsubsection{Definition of the angle and dihedral pull geometries}
330 Four pull groups are required for {\tt pull-coord?-geometry = angle}. In the same way as for geometries with two groups, each consecutive pair of groups
331 $i$ and $i+1$ define a vector connecting the COMs of groups $i$ and $i+1$. The angle is defined as the angle between the two resulting vectors.
332 E.g., the {\tt .mdp} option {\tt pull-coord?-groups = 1 2 2 4} defines the angle between the vector from the COM of group 1 to the COM of group 2
333 and the vector from the COM of group 2 to the COM of group 4.
334 The angle takes values in the closed interval [0, 180] deg.
335 For {\tt pull-coord?-geometry = angle-axis} the angle is defined with respect to a reference axis given by {\tt pull-coord?-vec} and only two groups need to be given.
336 The dihedral geometry requires six pull groups. These pair up in the same way as described above and so define three vectors. The dihedral angle is defined as the angle between the two
337 planes spanned by the two first and the two last vectors. Equivalently, the dihedral angle can be seen as the angle between the first and the third
338 vector when these vectors are projected onto a plane normal to the second vector (the axis vector).
339 As an example, consider a dihedral angle involving four groups: 1, 5, 8 and 9. Here, the {\tt .mdp} option
340 {\tt pull-coord?-groups = 8 1 1 5 5 9} specifies the three vectors that define the dihedral angle:
341 the first vector is the COM distance vector from group 8 to 1, the second vector is the COM distance vector from group 1 to 5, and the third vector is the COM distance vector from group 5 to 9.
342 The dihedral angle takes values in the interval (-180, 180] deg and has periodic boundaries.
343
344 \subsubsection{Limitations}
345 There is one theoretical limitation:
346 strictly speaking, constraint forces can only be calculated between
347 groups that are not connected by constraints to the rest of the system.
348 If a group contains part of a molecule of which the bond lengths
349 are constrained, the pull constraint and LINCS or SHAKE bond constraint
350 algorithms should be iterated simultaneously. This is not done in {\gromacs}.
351 This means that for simulations with {\tt constraints = all-bonds}
352 in the {\tt .mdp} file pulling is, strictly speaking,
353 limited to whole molecules or groups of molecules.
354 In some cases this limitation can be avoided by using the free energy code,
355 see \secref{fepmf}.
356 In practice, the errors caused by not iterating the two constraint
357 algorithms can be negligible when the pull group consists of a large
358 amount of atoms and/or the pull force is small.
359 In such cases, the constraint correction displacement of the pull group
360 is small compared to the bond lengths.
361
362
363
364 \section{\normindex{Enforced Rotation}}
365 \index{rotational pulling|see{enforced rotation}}
366 \index{pulling, rotational|see{enforced rotation}}
367 \label{sec:rotation}
368
369 \mathchardef\mhyphen="2D
370 \newcommand{\rotiso     }{^\mathrm{iso}}
371 \newcommand{\rotisopf   }{^\mathrm{iso\mhyphen pf}}
372 \newcommand{\rotpm      }{^\mathrm{pm}}
373 \newcommand{\rotpmpf    }{^\mathrm{pm\mhyphen pf}}
374 \newcommand{\rotrm      }{^\mathrm{rm}}
375 \newcommand{\rotrmpf    }{^\mathrm{rm\mhyphen pf}}
376 \newcommand{\rotrmtwo   }{^\mathrm{rm2}}
377 \newcommand{\rotrmtwopf }{^\mathrm{rm2\mhyphen pf}}
378 \newcommand{\rotflex    }{^\mathrm{flex}}
379 \newcommand{\rotflext   }{^\mathrm{flex\mhyphen t}}
380 \newcommand{\rotflextwo }{^\mathrm{flex2}}
381 \newcommand{\rotflextwot}{^\mathrm{flex2\mhyphen t}}
382
383 This module can be used to enforce the rotation of a group of atoms, as {\eg}
384 a protein subunit. There are a variety of rotation potentials, among them
385 complex ones that allow flexible adaptations of both the rotated subunit as
386 well as the local rotation axis during the simulation. An example application 
387 can be found in ref. \cite{Kutzner2011}.
388
389 \begin{figure}
390 \centerline{\includegraphics[width=13cm]{plots/rotation.pdf}}
391 \caption[Fixed and flexible axis rotation]{Comparison of fixed and flexible axis
392 rotation. 
393 {\sf A:} Rotating the sketched shape inside the white tubular cavity can create
394 artifacts when a fixed rotation axis (dashed) is used. More realistically, the
395 shape would revolve like a flexible pipe-cleaner (dotted) inside the bearing (gray). 
396 {\sf B:} Fixed rotation around an axis \ve{v} with a pivot point
397 specified by the vector \ve{u}. 
398 {\sf C:} Subdividing the rotating fragment into slabs with separate rotation
399 axes ($\uparrow$) and pivot points ($\bullet$) for each slab allows for
400 flexibility. The distance between two slabs with indices $n$ and $n+1$ is $\Delta x$.}
401 \label{fig:rotation}
402 \end{figure}
403
404 \begin{figure}
405 \centerline{\includegraphics[width=13cm]{plots/equipotential.pdf}}
406 \caption{Selection of different rotation potentials and definition of notation.
407 All four potentials $V$ (color coded) are shown for a single atom at position
408 $\ve{x}_j(t)$.
409 {\sf A:} Isotropic potential $V\rotiso$,
410 {\sf B:} radial motion potential $V\rotrm$ and flexible potential
411 $V\rotflex$,
412 {\sf C--D:} radial motion\,2 potential $V\rotrmtwo$ and
413 flexible\,2 potential $V\rotflextwo$ for $\epsilon' = 0$\,nm$^2$ {\sf (C)}
414 and $\epsilon' = 0.01$\,nm$^2$ {\sf (D)}. The rotation axis is perpendicular to
415 the plane and marked by $\otimes$. The light gray contours indicate Boltzmann factors
416 $e^{-V/(k_B T)}$ in the $\ve{x}_j$-plane for $T=300$\,K and
417 $k=200$\,kJ/(mol$\cdot$nm$^2$). The green arrow shows the direction of the
418 force $\ve{F}_{\!j}$ acting on atom $j$; the blue dashed line indicates the
419 motion of the reference position.}
420 \label{fig:equipotential}
421 \end{figure}
422
423 \subsection{Fixed Axis Rotation}
424 \subsubsection{Stationary Axis with an Isotropic Potential}
425 In the fixed axis approach (see \figref{rotation}B), torque on a group of $N$
426 atoms with positions $\ve{x}_i$ (denoted ``rotation group'') is applied by
427 rotating a reference set of atomic positions -- usually their initial positions
428 $\ve{y}_i^0$ -- at a constant angular velocity $\omega$ around an axis
429 defined by a direction vector $\hat{\ve{v}}$ and a pivot point \ve{u}.
430 To that aim, each atom with position $\ve{x}_i$ is attracted by a
431 ``virtual spring'' potential to its moving reference position
432 $\ve{y}_i = \mathbf{\Omega}(t) (\ve{y}_i^0 - \ve{u})$,
433 where $\mathbf{\Omega}(t)$ is a matrix that describes the rotation around the
434 axis. In the simplest case, the ``springs'' are described by a harmonic
435 potential,
436 \beq
437 V\rotiso = \frac{k}{2} \sum_{i=1}^{N} w_i \left[ \mathbf{\Omega}(t)
438 (\ve{y}_i^0 - \ve{u}) - (\ve{x}_i - \ve{u})  \right]^2 ,
439 \label{eqn:potiso}
440 \eeq
441 with optional mass-weighted prefactors $w_i = N \, m_i/M$ with total mass
442 $M = \sum_{i=1}^N m_i$.
443 The rotation matrix $\mathbf{\Omega}(t)$ is 
444 \newcommand{\omcost}{\,\xi\,}   % abbreviation
445 \begin{displaymath}
446 \mathbf{\Omega}(t) =  
447 \left(   
448 \begin{array}{ccc}
449 \cos\omega t + v_x^2\omcost       & v_x v_y\omcost - v_z\sin\omega t  & v_x v_z\omcost + v_y\sin\omega t\\
450 v_x v_y\omcost + v_z\sin\omega t  & \cos\omega t + v_y^2\omcost       & v_y v_z\omcost - v_x\sin\omega t\\
451 v_x v_z\omcost - v_y\sin\omega t  & v_y v_z\omcost + v_x\sin\omega t  & \cos\omega t + v_z^2\omcost     \\
452 \end{array}
453 \right) ,
454 \end{displaymath}
455 where $v_x$, $v_y$, and $v_z$ are the components of the normalized rotation vector
456 $\hat{\ve{v}}$, and $\omcost := 1-\cos(\omega t)$. As illustrated in
457 \figref{equipotential}A for a single atom $j$, the
458 rotation matrix $\mathbf{\Omega}(t)$ operates on the initial reference positions
459 $\ve{y}_j^0 = \ve{x}_j(t_0)$ of atom $j$ at $t=t_0$. At a later
460 time $t$, the reference position has rotated away from its initial place
461 (along the blue dashed line), resulting in the force
462 \beq
463 \ve{F}_{\!j}\rotiso 
464 = -\nabla_{\!j} \, V\rotiso 
465 = k \, w_j \left[
466 \mathbf{\Omega}(t) (\ve{y}_j^0 - \ve{u}) - (\ve{x}_j - \ve{u} ) \right] ,
467 \label{eqn:force_fixed}
468 \eeq
469 which is directed towards the reference position.
470
471
472 \subsubsection{Pivot-Free Isotropic Potential}
473 Instead of a fixed pivot vector \ve{u} this potential uses the center of
474 mass $\ve{x}_c$ of the rotation group as pivot for the rotation axis,
475 \beq
476 \ve{x}_c   = \frac{1}{M} \sum_{i=1}^N m_i \ve{x}_i 
477 \label{eqn:com}
478 \mbox{\hspace{4ex}and\hspace{4ex}}
479 \ve{y}_c^0 = \frac{1}{M} \sum_{i=1}^N m_i \ve{y}_i^0 \ ,
480 \eeq
481 which yields the ``pivot-free'' isotropic potential
482 \beq
483 V\rotisopf = \frac{k}{2} \sum_{i=1}^{N} w_i \left[ \mathbf{\Omega}(t)
484 (\ve{y}_i^0 - \ve{y}_c^0) - (\ve{x}_i - \ve{x}_c) \right]^2 ,
485 \label{eqn:potisopf}
486 \eeq
487 with forces
488 \beq
489 \mathbf{F}_{\!j}\rotisopf = k \, w_j 
490 \left[ 
491 \mathbf{\Omega}(t) ( \ve{y}_j^0 - \ve{y}_c^0) 
492                  - ( \ve{x}_j   - \ve{x}_c )
493 \right] .
494 \label{eqn:force_isopf}
495 \eeq
496 Without mass-weighting, the pivot $\ve{x}_c$ is the geometrical center of
497 the group. 
498 \label{sec:fixed}
499
500 \subsubsection{Parallel Motion Potential Variant}
501 The forces generated by the isotropic potentials
502 (\eqnsref{potiso}{potisopf}) also contain components parallel
503 to the rotation axis and thereby restrain motions along the axis of either the
504 whole rotation group (in case of $V\rotiso$) or within
505 the rotation group (in case of $V\rotisopf$). For cases where
506 unrestrained motion along the axis is preferred, we have implemented a 
507 ``parallel motion'' variant by eliminating all components parallel to the
508 rotation axis for the potential. This is achieved by projecting the distance
509 vectors between reference and actual positions
510 \beq
511 \ve{r}_i = \mathbf{\Omega}(t) (\ve{y}_i^0 - \ve{u}) - (\ve{x}_i - \ve{u})
512 \eeq
513 onto the plane perpendicular to the rotation vector,
514 \beq
515 \label{eqn:project}
516 \ve{r}_i^\perp :=  \ve{r}_i - (\ve{r}_i \cdot \hat{\ve{v}})\hat{\ve{v}} \ ,
517 \eeq
518 yielding
519 \bea
520 \nonumber
521 V\rotpm &=& \frac{k}{2} \sum_{i=1}^{N} w_i ( \ve{r}_i^\perp )^2 \\
522         &=& \frac{k}{2} \sum_{i=1}^{N} w_i
523  \left\lbrace
524  \mathbf{\Omega}(t)
525    (\ve{y}_i^0 - \ve{u}) - (\ve{x}_i - \ve{u})  \right. \nonumber \\
526 && \left. - \left\lbrace
527 \left[ \mathbf{\Omega}(t)(\ve{y}_i^0 - \ve{u}) - (\ve{x}_i - \ve{u}) \right] \cdot\hat{\ve{v}}
528   \right\rbrace\hat{\ve{v}} \right\rbrace^2 ,
529 \label{eqn:potpm}
530 \eea
531 and similarly
532 \beq
533 \ve{F}_{\!j}\rotpm = k \, w_j \, \ve{r}_j^\perp .
534 \label{eqn:force_pm}
535 \eeq
536
537 \subsubsection{Pivot-Free Parallel Motion Potential}
538 Replacing in \eqnref{potpm} the fixed pivot \ve{u} by the center 
539 of mass $\ve{x_c}$ yields the pivot-free variant of the parallel motion
540 potential. With
541 \beq
542 \ve{s}_i = \mathbf{\Omega}(t) (\ve{y}_i^0 - \ve{y}_c^0) - (\ve{x}_i - \ve{x}_c)
543 \eeq
544 the respective potential and forces are
545 \bea
546 V\rotpmpf &=& \frac{k}{2} \sum_{i=1}^{N} w_i ( \ve{s}_i^\perp )^2 \ , \\
547 \label{eqn:potpmpf}
548 \ve{F}_{\!j}\rotpmpf &=& k \, w_j \, \ve{s}_j^\perp .
549 \label{eqn:force_pmpf}
550 \eea
551
552 \subsubsection{Radial Motion Potential}
553 In the above variants, the minimum of the rotation potential is either a single
554 point at the reference position $\ve{y}_i$ (for the isotropic potentials) or a
555 single line through $\ve{y}_i$ parallel to the rotation axis (for the
556 parallel motion potentials). As a result, radial forces restrict radial motions
557 of the atoms. The two subsequent types of rotation potentials, $V\rotrm$
558 and $V\rotrmtwo$, drastically reduce or even eliminate this effect. The first
559 variant, $V\rotrm$ (\figref{equipotential}B), eliminates all force
560 components parallel to the vector connecting the reference atom and the
561 rotation axis,
562 \beq
563 V\rotrm = \frac{k}{2} \sum_{i=1}^{N} w_i \left[
564 \ve{p}_i
565 \cdot(\ve{x}_i - \ve{u}) \right]^2 ,
566 \label{eqn:potrm}
567 \eeq
568 with
569 \beq
570 \ve{p}_i := 
571 \frac{\hat{\ve{v}}\times \mathbf{\Omega}(t) (\ve{y}_i^0 - \ve{u})} {\| \hat{\ve{v}}\times \mathbf{\Omega}(t) (\ve{y}_i^0 - \ve{u})\|} \ .
572 \eeq
573 This variant depends only on the distance $\ve{p}_i \cdot (\ve{x}_i -
574 \ve{u})$ of atom $i$ from the plane spanned by $\hat{\ve{v}}$ and
575 $\mathbf{\Omega}(t)(\ve{y}_i^0 - \ve{u})$. The resulting force is
576 \beq
577 \mathbf{F}_{\!j}\rotrm =
578  -k \, w_j \left[ \ve{p}_j\cdot(\ve{x}_j - \ve{u}) \right] \,\ve{p}_j \,  .
579 \label{eqn:potrm_force}
580 \eeq
581
582 \subsubsection{Pivot-Free Radial Motion Potential}
583 Proceeding similar to the pivot-free isotropic potential yields a pivot-free
584 version of the above potential. With
585 \beq
586 \ve{q}_i := 
587 \frac{\hat{\ve{v}}\times \mathbf{\Omega}(t) (\ve{y}_i^0 - \ve{y}_c^0)} {\| \hat{\ve{v}}\times \mathbf{\Omega}(t) (\ve{y}_i^0 - \ve{y}_c^0)\|} \, ,
588 \eeq
589 the potential and force for the pivot-free variant of the radial motion potential read
590 \bea
591 V\rotrmpf & = & \frac{k}{2} \sum_{i=1}^{N} w_i \left[
592 \ve{q}_i
593 \cdot(\ve{x}_i - \ve{x}_c)
594 \right]^2 \, , \\
595 \label{eqn:potrmpf}
596 \mathbf{F}_{\!j}\rotrmpf & = &
597  -k \, w_j \left[ \ve{q}_j\cdot(\ve{x}_j - \ve{x}_c) \right] \,\ve{q}_j 
598  + k   \frac{m_j}{M} \sum_{i=1}^{N} w_i \left[
599  \ve{q}_i\cdot(\ve{x}_i - \ve{x}_c) \right]\,\ve{q}_i \, .
600 \label{eqn:potrmpf_force}
601 \eea
602
603 \subsubsection{Radial Motion 2 Alternative Potential}
604 As seen in \figref{equipotential}B, the force resulting from
605 $V\rotrm$ still contains a small, second-order radial component. In most
606 cases, this perturbation is tolerable; if not, the following
607 alternative, $V\rotrmtwo$, fully eliminates the radial contribution to the
608 force, as depicted in \figref{equipotential}C,
609 \beq
610 V\rotrmtwo = 
611 \frac{k}{2} \sum_{i=1}^{N} w_i\, 
612 \frac{\left[ (\hat{\ve{v}} \times ( \ve{x}_i - \ve{u} ))
613 \cdot \mathbf{\Omega}(t)(\ve{y}_i^0 - \ve{u}) \right]^2}
614 {\| \hat{\ve{v}} \times (\ve{x}_i - \ve{u}) \|^2 +
615 \epsilon'} \, ,
616 \label{eqn:potrm2}
617 \eeq
618 where a small parameter $\epsilon'$ has been introduced to avoid singularities.
619 For $\epsilon'=0$\,nm$^2$, the equipotential planes are spanned by $\ve{x}_i -
620 \ve{u}$ and $\hat{\ve{v}}$, yielding a force 
621 perpendicular to $\ve{x}_i - \ve{u}$, thus not contracting or
622 expanding structural parts that moved away from or toward the rotation axis.
623
624 Choosing a small positive  $\epsilon'$ ({\eg},
625 $\epsilon'=0.01$\,nm$^2$, \figref{equipotential}D) in the denominator of
626 \eqnref{potrm2} yields a well-defined potential and continuous forces also 
627 close to the rotation axis, which is not the case for $\epsilon'=0$\,nm$^2$ 
628 (\figref{equipotential}C). With
629 \bea
630 \ve{r}_i & := & \mathbf{\Omega}(t)(\ve{y}_i^0 - \ve{u})\\
631 \ve{s}_i & := & \frac{\hat{\ve{v}} \times (\ve{x}_i -
632 \ve{u} ) }{ \| \hat{\ve{v}} \times (\ve{x}_i - \ve{u})
633 \| } \equiv \; \Psi_{i} \;\; {\hat{\ve{v}} \times
634 (\ve{x}_i-\ve{u} ) }\\
635 \Psi_i^{*}   & := & \frac{1}{ \| \hat{\ve{v}} \times
636 (\ve{x}_i-\ve{u}) \|^2 + \epsilon'}
637 \eea
638 the force on atom $j$ reads
639 \beq
640 \ve{F}_{\!j}\rotrmtwo  = 
641 - k\; 
642 \left\lbrace w_j\;
643 (\ve{s}_j\cdot\ve{r}_{\!j})\;
644 \left[ \frac{\Psi_{\!j}^*   }{\Psi_{\!j}  }  \ve{r}_{\!j} 
645      - \frac{\Psi_{\!j}^{*2}}{\Psi_{\!j}^3}
646      (\ve{s}_j\cdot\ve{r}_{\!j})\ve{s}_j \right]
647 \right\rbrace \times \hat{\ve{v}} .
648 \label{eqn:potrm2_force}
649 \eeq
650
651 \subsubsection{Pivot-Free Radial Motion 2 Potential}
652 The pivot-free variant of the above potential is
653 \beq
654 V\rotrmtwopf = 
655 \frac{k}{2} \sum_{i=1}^{N} w_i\, 
656 \frac{\left[ (\hat{\ve{v}} \times ( \ve{x}_i - \ve{x}_c ))
657 \cdot \mathbf{\Omega}(t)(\ve{y}_i^0 - \ve{y}_c) \right]^2}
658 {\| \hat{\ve{v}} \times (\ve{x}_i - \ve{x}_c) \|^2 +
659 \epsilon'} \, .
660 \label{eqn:potrm2pf}
661 \eeq
662 With
663 \bea
664 \ve{r}_i & := & \mathbf{\Omega}(t)(\ve{y}_i^0 - \ve{y}_c)\\
665 \ve{s}_i & := & \frac{\hat{\ve{v}} \times (\ve{x}_i -
666 \ve{x}_c ) }{ \| \hat{\ve{v}} \times (\ve{x}_i - \ve{x}_c)
667 \| } \equiv \; \Psi_{i} \;\; {\hat{\ve{v}} \times
668 (\ve{x}_i-\ve{x}_c ) }\\ \Psi_i^{*}   & := & \frac{1}{ \| \hat{\ve{v}} \times
669 (\ve{x}_i-\ve{x}_c) \|^2 + \epsilon'}
670 \eea
671 the force on atom $j$ reads
672 \bea
673 \nonumber
674 \ve{F}_{\!j}\rotrmtwopf & = &
675 - k\; 
676 \left\lbrace w_j\;
677 (\ve{s}_j\cdot\ve{r}_{\!j})\;
678 \left[ \frac{\Psi_{\!j}^*   }{\Psi_{\!j}  } \ve{r}_{\!j} 
679      - \frac{\Psi_{\!j}^{*2}}{\Psi_{\!j}^3}
680      (\ve{s}_j\cdot\ve{r}_{\!j})\ve{s}_j \right]
681 \right\rbrace \times \hat{\ve{v}}\\
682      & &
683 + k\;\frac{m_j}{M} \left\lbrace \sum_{i=1}^{N}
684 w_i\;(\ve{s}_i\cdot\ve{r}_i) \; 
685 \left[ \frac{\Psi_i^*   }{\Psi_i  }  \ve{r}_i
686      - \frac{\Psi_i^{*2}}{\Psi_i^3} (\ve{s}_i\cdot\ve{r}_i )\;
687      \ve{s}_i \right] \right\rbrace \times \hat{\ve{v}} \, .
688 \label{eqn:potrm2pf_force}
689 \eea
690
691 \subsection{Flexible Axis Rotation}
692 As sketched in \figref{rotation}A--B, the rigid body behavior of
693 the fixed axis rotation scheme is a drawback for many applications. In
694 particular, deformations of the rotation group are suppressed when the
695 equilibrium atom positions directly depend on the reference positions. 
696 To avoid this limitation, \eqnsref{potrmpf}{potrm2pf}
697 will now be generalized towards a ``flexible axis'' as sketched in
698 \figref{rotation}C. This will be achieved by subdividing the
699 rotation group into a set of equidistant slabs perpendicular to
700 the rotation vector, and by applying a separate rotation potential to each
701 of these slabs. \figref{rotation}C shows the midplanes of the slabs 
702 as dotted straight lines and the centers as thick black dots.
703
704 To avoid discontinuities in the potential and in the forces, we define
705 ``soft slabs'' by weighing the contributions of each
706 slab $n$ to the total potential function $V\rotflex$ by a Gaussian
707 function
708 \beq
709 \label{eqn:gaussian}
710 g_n(\ve{x}_i) = \Gamma \ \mbox{exp} \left(
711 -\frac{\beta_n^2(\ve{x}_i)}{2\sigma^2}  \right) ,
712 \eeq
713 centered at the midplane of the $n$th slab. Here $\sigma$ is the width
714 of the Gaussian function, $\Delta x$ the distance between adjacent slabs, and
715 \beq
716 \beta_n(\ve{x}_i) := \ve{x}_i \cdot \hat{\ve{v}} - n \, \Delta x \, .
717 \eeq
718 %
719 \begin{figure}
720 \centerline{\includegraphics[width=6.5cm]{plots/gaussians.pdf}}
721 \caption{Gaussian functions $g_n$ centered at $n \, \Delta x$ for a slab
722 distance $\Delta x = 1.5$ nm and $n \geq -2$. Gaussian function $g_0$ is
723 highlighted in bold; the dashed line depicts the sum of the shown Gaussian
724 functions.}
725 \label{fig:gaussians}
726 \end{figure}
727 %
728 A most convenient choice is $\sigma = 0.7 \Delta x$ and
729 \begin{displaymath}
730 1/\Gamma = \sum_{n \in Z}
731 \mbox{exp}
732 \left(-\frac{(n - \frac{1}{4})^2}{2\cdot 0.7^2}\right)
733 \approx 1.75464 \, ,
734 \end{displaymath}
735 which yields a nearly constant sum, essentially independent of $\ve{x}_i$
736 (dashed line in \figref{gaussians}), {\ie},
737 \beq
738 \sum_{n \in Z} g_n(\ve{x}_i) =  1 + \epsilon(\ve{x}_i) \, ,
739 \label{eqn:normal}
740 \eeq
741 with $ | \epsilon(\ve{x}_i) | < 1.3\cdot 10^{-4}$. This choice also
742 implies that the individual contributions to the force from the slabs add up to
743 unity such that no further normalization is required.
744
745 To each slab center $\ve{x}_c^n$, all atoms contribute by their
746 Gaussian-weighted (optionally also mass-weighted) position vectors 
747 $g_n(\ve{x}_i) \, \ve{x}_i$. The
748 instantaneous slab centers $\ve{x}_c^n$ are calculated from the
749 current positions $\ve{x}_i$,
750 \beq
751 \label{eqn:defx0} 
752 \ve{x}_c^n =
753 \frac{\sum_{i=1}^N g_n(\ve{x}_i) \, m_i \, \ve{x}_i}
754      {\sum_{i=1}^N g_n(\ve{x}_i) \, m_i} \, ,\\
755 \eeq
756 while the reference centers $\ve{y}_c^n$ are calculated from the reference 
757 positions $\ve{y}_i^0$,
758 \beq
759 \label{eqn:defy0}
760 \ve{y}_c^n =
761 \frac{\sum_{i=1}^N g_n(\ve{y}_i^0) \, m_i \, \ve{y}_i^0}
762      {\sum_{i=1}^N g_n(\ve{y}_i^0) \, m_i} \, .
763 \eeq
764 Due to the rapid decay of $g_n$, each slab
765 will essentially involve contributions from atoms located within $\approx
766 3\Delta x$ from the slab center only.
767
768 \subsubsection{Flexible Axis Potential}
769 We consider two flexible axis variants. For the first variant,
770 the slab segmentation procedure with Gaussian weighting is applied to the radial 
771 motion potential (\eqnref{potrmpf}\,/\,\figref{equipotential}B),
772 yielding as the contribution of slab $n$
773 \begin{displaymath}
774 V^n = 
775 \frac{k}{2} \sum_{i=1}^{N} w_i \, g_n(\ve{x}_i) 
776 \left[
777 \ve{q}_i^n
778 \cdot
779  (\ve{x}_i - \ve{x}_c^n) 
780 \right]^2  ,
781 \label{eqn:flexpot}
782 \end{displaymath}
783 and a total potential function
784 \beq 
785 V\rotflex = \sum_n V^n \, .
786 \label{eqn:potflex}
787 \eeq
788 Note that the global center of mass $\ve{x}_c$ used in
789 \eqnref{potrmpf} is now replaced by $\ve{x}_c^n$, the center of mass of
790 the slab. With
791 \bea
792 \ve{q}_i^n & := & \frac{\hat{\ve{v}} \times
793 \mathbf{\Omega}(t)(\ve{y}_i^0 - \ve{y}_c^n) }{ \| \hat{\ve{v}}
794 \times \mathbf{\Omega}(t)(\ve{y}_i^0 - \ve{y}_c^n) \| } \\
795 b_i^n         & := & \ve{q}_i^n \cdot (\ve{x}_i - \ve{x}_c^n) \, ,
796 \eea
797 the resulting force on atom $j$ reads
798 \bea
799 \nonumber\hspace{-15mm}
800 \ve{F}_{\!j}\rotflex &=&
801 - \, k \, w_j \sum_n g_n(\ve{x}_j) \, b_j^n \left\lbrace  \ve{q}_j^n -
802 b_j^n \frac{\beta_n(\ve{x}_j)}{2\sigma^2} \hat{\ve{v}} \right\rbrace \\ & &
803 + \, k \, m_j \sum_n \frac{g_n(\ve{x}_j)}{\sum_h g_n(\ve{x}_h)}
804 \sum_{i=1}^{N} w_i \, g_n(\ve{x}_i) \, b_i^n \left\lbrace 
805 \ve{q}_i^n -\frac{\beta_n(\ve{x}_j)}{\sigma^2}
806 \left[ \ve{q}_i^n \cdot (\ve{x}_j - \ve{x}_c^n )\right]
807 \hat{\ve{v}} \right\rbrace .
808 \label{eqn:potflex_force}
809 \eea
810 %
811 Note that for $V\rotflex$, as defined, the slabs are fixed in space and so
812 are the reference centers $\ve{y}_c^n$. If during the simulation the
813 rotation group moves too far in $\ve{v}$ direction, it may enter a
814 region where -- due to the lack of nearby reference positions -- no reference
815 slab centers are defined, rendering the potential evaluation impossible. 
816 We therefore have included a slightly modified version of this potential that
817 avoids this problem by attaching the midplane of slab $n=0$ to the center of mass 
818 of the rotation group, yielding slabs that move with the rotation group. 
819 This is achieved by subtracting the center of mass $\ve{x}_c$ of the
820 group from the positions, 
821 \beq
822 \tilde{\ve{x}}_i = \ve{x}_i - \ve{x}_c \, , \mbox{\ \ \ and \ \ } 
823 \tilde{\ve{y}}_i^0 = \ve{y}_i^0 - \ve{y}_c^0 \, ,
824 \label{eqn:trafo} 
825 \eeq
826 such that
827 \bea
828 V\rotflext 
829   & = & \frac{k}{2} \sum_n \sum_{i=1}^{N} w_i \, g_n(\tilde{\ve{x}}_i)
830   \left[ \frac{\hat{\ve{v}} \times \mathbf{\Omega}(t)(\tilde{\ve{y}}_i^0
831   - \tilde{\ve{y}}_c^n) }{ \| \hat{\ve{v}} \times
832 \mathbf{\Omega}(t)(\tilde{\ve{y}}_i^0 -
833 \tilde{\ve{y}}_c^n) \| }
834 \cdot
835  (\tilde{\ve{x}}_i - \tilde{\ve{x}}_c^n) 
836 \right]^2 .
837 \label{eqn:potflext}
838 \eea
839 To simplify the force derivation, and for efficiency reasons, we here assume
840 $\ve{x}_c$ to be constant, and thus $\partial \ve{x}_c / \partial x =
841 \partial \ve{x}_c / \partial y = \partial \ve{x}_c / \partial z = 0$. The
842 resulting force error is small (of order $O(1/N)$ or $O(m_j/M)$ if
843 mass-weighting is applied) and can therefore be tolerated. With this assumption,
844 the forces $\ve{F}\rotflext$ have the same form as
845 \eqnref{potflex_force}.
846
847 \subsubsection{Flexible Axis 2 Alternative Potential}
848 In this second variant, slab segmentation is applied to $V\rotrmtwo$
849 (\eqnref{potrm2pf}), resulting in a flexible axis potential without radial
850 force contributions (\figref{equipotential}C),
851 \beq
852 V\rotflextwo = 
853 \frac{k}{2} \sum_{i=1}^{N} \sum_n w_i\,g_n(\ve{x}_i) 
854 \frac{\left[ (\hat{\ve{v}} \times ( \ve{x}_i - \ve{x}_c^n ))
855 \cdot \mathbf{\Omega}(t)(\ve{y}_i^0 - \ve{y}_c^n) \right]^2}
856 {\| \hat{\ve{v}} \times (\ve{x}_i - \ve{x}_c^n) \|^2 +
857 \epsilon'} \, .
858 \label{eqn:potflex2}
859 \eeq
860 With
861 \bea
862 \ve{r}_i^n & := & \mathbf{\Omega}(t)(\ve{y}_i^0 - \ve{y}_c^n)\\
863 \ve{s}_i^n & := & \frac{\hat{\ve{v}} \times (\ve{x}_i -
864 \ve{x}_c^n ) }{ \| \hat{\ve{v}} \times (\ve{x}_i - \ve{x}_c^n)
865 \| } \equiv \; \psi_{i} \;\; {\hat{\ve{v}} \times (\ve{x}_i-\ve{x}_c^n ) }\\
866 \psi_i^{*}     & := & \frac{1}{ \| \hat{\ve{v}} \times (\ve{x}_i-\ve{x}_c^n) \|^2 + \epsilon'}\\ 
867 W_j^n          & := & \frac{g_n(\ve{x}_j)\,m_j}{\sum_h g_n(\ve{x}_h)\,m_h}\\
868 \ve{S}^n   & := & 
869 \sum_{i=1}^{N} w_i\;g_n(\ve{x}_i)
870 \; (\ve{s}_i^n\cdot\ve{r}_i^n)
871 \left[ \frac{\psi_i^*   }{\psi_i  }  \ve{r}_i^n
872      - \frac{\psi_i^{*2}}{\psi_i^3} (\ve{s}_i^n\cdot\ve{r}_i^n )\;
873      \ve{s}_i^n \right] \label{eqn:Sn}
874 \eea
875 the force on atom $j$ reads
876 \bea
877 \nonumber
878 \ve{F}_{\!j}\rotflextwo & = &
879 - k\; 
880 \left\lbrace \sum_n w_j\;g_n(\ve{x}_j)\;
881 (\ve{s}_j^n\cdot\ve{r}_{\!j}^n)\;
882 \left[ \frac{\psi_j^*   }{\psi_j  }  \ve{r}_{\!j}^n 
883      - \frac{\psi_j^{*2}}{\psi_j^3} (\ve{s}_j^n\cdot\ve{r}_{\!j}^n)\;
884      \ve{s}_{\!j}^n \right] \right\rbrace \times \hat{\ve{v}} \\
885 \nonumber
886 & &
887 + k \left\lbrace \sum_n W_{\!j}^n \, \ve{S}^n \right\rbrace \times
888 \hat{\ve{v}}
889 - k \left\lbrace \sum_n W_{\!j}^n \; \frac{\beta_n(\ve{x}_j)}{\sigma^2} \frac{1}{\psi_j}\;\; 
890 \ve{s}_j^n \cdot 
891 \ve{S}^n \right\rbrace \hat{\ve{v}}\\ 
892 & & 
893 + \frac{k}{2} \left\lbrace \sum_n w_j\;g_n(\ve{x}_j)
894 \frac{\beta_n(\ve{x}_j)}{\sigma^2} 
895 \frac{\psi_j^*}{\psi_j^2}( \ve{s}_j^n \cdot \ve{r}_{\!j}^n )^2 \right\rbrace
896 \hat{\ve{v}} .
897 \label{eqn:potflex2_force}
898 \eea
899
900 Applying transformation (\ref{eqn:trafo}) yields a ``translation-tolerant''
901 version of the flexible\,2 potential, $V\rotflextwot$. Again,
902 assuming that $\partial \ve{x}_c / \partial x$,  $\partial \ve{x}_c /
903 \partial y$, $\partial \ve{x}_c / \partial z$ are small, the
904 resulting equations for $V\rotflextwot$ and $\ve{F}\rotflextwot$ are
905 similar to those of $V\rotflextwo$ and $\ve{F}\rotflextwo$.
906
907 \subsection{Usage}
908 To apply enforced rotation, the particles $i$ that are to
909 be subjected to one of the rotation potentials are defined via index groups
910 {\tt rot-group0}, {\tt rot-group1}, etc., in the {\tt .mdp} input file. 
911 The reference positions $\ve{y}_i^0$ are
912 read from a special {\tt .trr} file provided to {\tt grompp}. If no such file is found,
913 $\ve{x}_i(t=0)$ are used as reference positions and written to {\tt .trr} such
914 that they can be used for subsequent setups. All parameters of the potentials
915 such as $k$, $\epsilon'$, etc. (\tabref{vars}) are provided as {\tt .mdp}
916 parameters; {\tt rot-type} selects the type of the potential. 
917 The option {\tt rot-massw} allows to choose whether or not to use
918 mass-weighted averaging. 
919 For the flexible potentials, a cutoff value $g_n^\mathrm{min}$ 
920 (typically  $g_n^\mathrm{min}=0.001$) makes shure that only
921 significant contributions to $V$ and \ve{F} are evaluated, {\ie} terms with 
922 $g_n(\ve{x}) < g_n^\mathrm{min}$ are omitted.
923 \tabref{quantities} summarizes observables that are written
924 to additional output files and which are described below.
925
926
927 \begin{table}[tbp]
928 \caption{Parameters used by the various rotation potentials.
929 {\sf x}'s indicate which parameter is actually used for a given potential.}
930 %\small
931
932 \newcommand{\kunit}{$\frac{\mathrm{kJ}}{\mathrm{mol} \cdot \mathrm{nm}^2}$}
933 \newcommand{\smtt}[1]{{\hspace{-0.5ex}\small #1\hspace{-0.5ex}}}
934 \label{tab:vars}
935 \begin{center}
936 \begin{tabular}{l>{$}l<{$}rccccccc}
937 \hline
938 parameter           &               &                      & $k$      & $\hat{\ve{v}}$ & $\ve{u}$     & $\omega$    & $\epsilon'$ & $\Delta x$        & $g_n^\mathrm{min}$ \\
939 \multicolumn{3}{l}{{\tt .mdp} input variable name}         & \smtt{k} & \smtt{vec}     & \smtt{pivot} & \smtt{rate} & \smtt{eps}  & \smtt{slab-dist}  & \smtt{min-gauss}   \\
940 unit                &               &                      & \kunit   & -              & nm           & $^\circ$/ps & nm$^2$      & nm                & \,-\,              \\[1mm]
941 \hline \multicolumn{2}{l}{fixed axis potentials:} & eqn.\\
942 isotropic           & V\rotiso      & (\ref{eqn:potiso})   & {\sf x}  & {\sf x}        & {\sf x}      & {\sf x}     & -           & -                 &  -                 \\
943 --- pivot-free      & V\rotisopf    & (\ref{eqn:potisopf}) & {\sf x}  & {\sf x}        & -            & {\sf x}     & -           & -                 &  -                 \\
944 parallel motion     & V\rotpm       & (\ref{eqn:potpm})    & {\sf x}  & {\sf x}        & {\sf x}      & {\sf x}     & -           & -                 &  -                 \\
945 --- pivot-free      & V\rotpmpf     & (\ref{eqn:potpmpf})  & {\sf x}  & {\sf x}        & -            & {\sf x}     & -           & -                 &  -                 \\
946 radial motion       & V\rotrm       & (\ref{eqn:potrm})    & {\sf x}  & {\sf x}        & {\sf x}      & {\sf x}     & -           & -                 &  -                 \\
947 --- pivot-free      & V\rotrmpf     & (\ref{eqn:potrmpf})  & {\sf x}  & {\sf x}        & -            & {\sf x}     & -           & -                 &  -                 \\
948 radial motion\,2    & V\rotrmtwo    & (\ref{eqn:potrm2})   & {\sf x}  & {\sf x}        & {\sf x}      & {\sf x}     & {\sf x}     & -                 &  -                 \\
949 --- pivot-free      & V\rotrmtwopf  & (\ref{eqn:potrm2pf}) & {\sf x}  & {\sf x}        & -            & {\sf x}     & {\sf x}     & -                 &  -                 \\ \hline
950 \multicolumn{2}{l}{flexible axis potentials:}  & eqn.\\
951 flexible            & V\rotflex     & (\ref{eqn:potflex})  & {\sf x}  & {\sf x}        & -            & {\sf x}     & -           & {\sf x}           &  {\sf x}           \\
952 --- transl. tol.    & V\rotflext    & (\ref{eqn:potflext}) & {\sf x}  & {\sf x}        & -            & {\sf x}     & -           & {\sf x}           &  {\sf x}           \\
953 flexible\,2         & V\rotflextwo  & (\ref{eqn:potflex2}) & {\sf x}  & {\sf x}        & -            & {\sf x}     & {\sf x}     & {\sf x}           &  {\sf x}           \\
954 --- transl. tol.    & V\rotflextwot &  -                   & {\sf x}  & {\sf x}        & -            & {\sf x}     & {\sf x}     & {\sf x}           &  {\sf x}           \\
955 \hline
956 \end{tabular}
957 \end{center}
958 \end{table}
959
960 \begin{table}
961 \caption{Quantities recorded in output files during enforced rotation simulations.
962 All slab-wise data is written every {\tt nstsout} steps, other rotation data every {\tt nstrout} steps.}
963 \label{tab:quantities}
964 \begin{center}
965 \begin{tabular}{llllcc}
966 \hline
967 quantity                                             & unit    & equation                          & output file     & fixed   & flexible\\ \hline
968 $V(t)$                                               & kJ/mol  & see \ref{tab:vars}                & {\tt rotation}  & {\sf x} & {\sf x} \\
969 $\theta_\mathrm{ref}(t)$                             & degrees & $\theta_\mathrm{ref}(t)=\omega t$ & {\tt rotation}  & {\sf x} & {\sf x} \\
970 $\theta_\mathrm{av}(t)$                              & degrees & (\ref{eqn:avangle})               & {\tt rotation}  & {\sf x} & -       \\
971 $\theta_\mathrm{fit}(t)$, $\theta_\mathrm{fit}(t,n)$ & degrees & (\ref{eqn:rmsdfit})               & {\tt rotangles} & -       & {\sf x} \\
972 $\ve{y}_0(n)$, $\ve{x}_0(t,n)$                       & nm      & (\ref{eqn:defx0}, \ref{eqn:defy0})& {\tt rotslabs}  & -       & {\sf x} \\
973 $\tau(t)$                                            & kJ/mol  & (\ref{eqn:torque})                & {\tt rotation}  & {\sf x} & -       \\
974 $\tau(t,n)$                                          & kJ/mol  & (\ref{eqn:torque})                & {\tt rottorque} & -       & {\sf x} \\ \hline
975 \end{tabular}
976 \end{center}
977 \end{table}
978
979
980 \subsubsection*{Angle of Rotation Groups: Fixed Axis}
981 For fixed axis rotation, the average angle $\theta_\mathrm{av}(t)$ of the 
982 group relative to the reference group is determined via the distance-weighted
983 angular deviation of all rotation group atoms from their reference positions,
984 \beq
985 \theta_\mathrm{av} = \left. \sum_{i=1}^{N} r_i \ \theta_i \right/ \sum_{i=1}^N r_i \ .
986 \label{eqn:avangle}
987 \eeq
988 Here, $r_i$ is the distance of the reference position to the rotation axis, and
989 the difference angles $\theta_i$ are determined from the atomic positions, 
990 projected onto a plane perpendicular to the rotation axis through pivot point
991 $\ve{u}$ (see \eqnref{project} for the definition of $\perp$),
992 \beq
993 \cos \theta_i = 
994 \frac{(\ve{y}_i-\ve{u})^\perp \cdot (\ve{x}_i-\ve{u})^\perp}
995      { \| (\ve{y}_i-\ve{u})^\perp \cdot (\ve{x}_i-\ve{u})^\perp
996      \| } \ .
997 \eeq
998 %
999 The sign of $\theta_\mathrm{av}$ is chosen such that
1000 $\theta_\mathrm{av} > 0$ if the actual structure rotates ahead of the reference.
1001
1002 \subsubsection*{Angle of Rotation Groups: Flexible Axis}
1003 For flexible axis rotation, two outputs are provided, the angle of the
1004 entire rotation group, and separate angles for the segments in the slabs.
1005 The angle of the entire rotation group is determined by an RMSD fit 
1006 of $\ve{x}_i$
1007 to the reference positions $\ve{y}_i^0$ at $t=0$, yielding $\theta_\mathrm{fit}$
1008 as the angle by which the reference has to be rotated around $\hat{\ve{v}}$ 
1009 for the optimal fit,
1010 \beq
1011 \mathrm{RMSD} \big( \ve{x}_i,\ \mathbf{\Omega}(\theta_\mathrm{fit})
1012 \ve{y}_i^0 \big) \stackrel{!}{=} \mathrm{min} \, .
1013 \label{eqn:rmsdfit}
1014 \eeq
1015 To determine the local angle for each slab $n$, both reference and actual
1016 positions are weighted with the Gaussian function of slab $n$, and 
1017 $\theta_\mathrm{fit}(t,n)$ is calculated as in \eqnref{rmsdfit}) from the
1018 Gaussian-weighted positions.
1019
1020 For all angles, the {\tt .mdp} input option {\tt rot-fit-method} controls
1021 whether a normal RMSD fit is performed or whether for the fit each
1022 position $\ve{x}_i$ is put at the same distance to the rotation axis as its
1023 reference counterpart $\ve{y}_i^0$. In the latter case, the RMSD
1024 measures only angular differences, not radial ones.
1025
1026
1027 \subsubsection*{Angle Determination by Searching the Energy Minimum}
1028 Alternatively, for {\tt rot-fit-method = potential}, the angle of the rotation 
1029 group is determined as the angle for which the rotation potential energy is minimal.
1030 Therefore, the used rotation potential is additionally evaluated for a set of angles
1031 around the current reference angle. In this case, the {\tt rotangles.log} output file
1032 contains the values of the rotation potential at the chosen set of angles, while 
1033 {\tt rotation.xvg} lists the angle with minimal potential energy.
1034
1035
1036 \subsubsection*{Torque}
1037 \label{torque}
1038 The torque $\ve{\tau}(t)$ exerted by the rotation potential is calculated for fixed
1039 axis rotation via
1040 \beq
1041 \ve{\tau}(t) = \sum_{i=1}^{N} \ve{r}_i(t) \times \ve{f}_{\!i}^\perp(t) ,
1042 \label{eqn:torque}
1043 \eeq
1044 where $\ve{r}_i(t)$ is the distance vector from the rotation axis to
1045 $\ve{x}_i(t)$ and $\ve{f}_{\!i}^\perp(t)$ is the force component
1046 perpendicular to $\ve{r}_i(t)$ and $\hat{\ve{v}}$. For flexible axis
1047 rotation, torques $\ve{\tau}_{\!n}$ are calculated for each slab using the
1048 local rotation axis of the slab and the Gaussian-weighted positions.
1049
1050
1051 \section{\normindex{Electric fields}}
1052 A pulsed and oscillating electric field can be applied according to:
1053 \begin{equation}
1054 E(t) = E_0 \exp\left[-\frac{(t-t_0)^2}{2\sigma^2}\right]\cos\left[\omega (t-t_0)\right]
1055 \label{eq_efield}
1056 \end{equation}
1057 where $E_0$ is the field strength, the angular frequency \mbox{$\omega = 2\pi c/\lambda$}, $t_0$ is
1058 the time at of the peak in the field strength and $\sigma$ is the with
1059 of the pulse. Special cases occur when $\sigma$ = 0 (non-pulsed field)
1060 and for $\omega$ is 0 (static field).
1061
1062 This simulated \normindex{laser}-pulse was applied to
1063 simulations of melting ice~\cite{Caleman2008a}. A pulsed electric field may
1064 look ike Fig.~\ref{fig:field}. In the supporting
1065 information of that paper the impact of an applied electric field on a
1066 system under periodic boundary conditions is analyzed. It is described
1067 that the effective electric field under PBC is larger than the applied
1068 field, by a factor depending on the size of the box and the dielectric
1069 properties of molecules in the box. For a system with static dielectric
1070 properties this factor can be corrected for. But for a system where
1071 the dielectric varies over time, for example a membrane protein with
1072 a pore that opens and closes during the simulatippn, this way of applying
1073 an electric field is not useful. In such cases one can use the computational
1074 electrophysiology protocol described in the next section (\secref{compel}).
1075 \begin{figure}[ht]
1076 \centerline{\includegraphics[width=8cm]{plots/field}}
1077 \caption {A simulated laser pulse in GROMACS.}
1078 \label{fig:field}
1079 \end{figure}
1080
1081 Electric fields are applied when the following options are specified
1082 in the {\tt grompp.mdp} file. You specify, in order, $E_0$, $\omega$,
1083 $t_0$ and $\sigma$:
1084 \begin{verbatim}
1085 ElectricField-x = 0.04 0       0     0
1086 \end{verbatim}
1087 yields a static field with $E_0$ = 0.04 V/nm in the X-direction. In contrast,
1088 \begin{verbatim}
1089 ElectricField-x = 2.0  150     5     0
1090 \end{verbatim}
1091 yields an oscillating electric field with $E_0$ = 2 V/nm, $\omega$ = 150/ps and
1092 $t_0$ = 5 ps. Finally 
1093 \begin{verbatim}
1094 ElectricField-x = 2.0  150     5     1
1095 \end{verbatim}
1096 yields an pulsed-oscillating electric field with $E_0$ = 2 V/nm, $\omega$ = 150/ps and
1097 $t_0$ = 5 ps and $\sigma$ = 1 ps. Read more in ref.~\cite{Caleman2008a}.
1098 Note that the input file format is changed from the undocumented older
1099 version. A figure like Fig.~\ref{fig:field} may be produced by passing
1100 the {\tt -field} option to {\tt gmx mdrun}.
1101
1102
1103 \section{\normindex{Computational Electrophysiology}}
1104 \label{sec:compel}
1105
1106 The Computational Electrophysiology (CompEL) protocol \cite{Kutzner2011b} allows the simulation of
1107 ion flux through membrane channels, driven by transmembrane potentials or ion
1108 concentration gradients. Just as in real cells, CompEL establishes transmembrane
1109 potentials by sustaining a small imbalance of charges $\Delta q$ across the membrane,
1110 which gives rise to a potential difference $\Delta U$ according to the membrane capacitance:
1111 \beq
1112 \Delta U = \Delta q / C_{membrane}
1113 \eeq
1114 The transmembrane electric field and concentration gradients are controlled by
1115 {\tt .mdp} options, which allow the user to set reference counts for the ions on either side
1116 of the membrane. If a difference between the actual and the reference numbers persists
1117 over a certain time span, specified by the user, a number of ion/water pairs are
1118 exchanged between the compartments until the reference numbers are restored.
1119 Alongside the calculation of channel conductance and ion selectivity, CompEL simulations also
1120 enable determination of the channel reversal potential, an important
1121 characteristic obtained in electrophysiology experiments.
1122
1123 In a CompEL setup, the simulation system is divided into two compartments {\bf A} and {\bf B}
1124 with independent ion concentrations. This is best achieved by using double bilayer systems with
1125 a copy (or copies) of the channel/pore of interest in each bilayer (\figref{compelsetup} A, B).
1126 If the channel axes point in the same direction, channel flux is observed
1127 simultaneously at positive and negative potentials in this way, which is for instance
1128 important for studying channel rectification.
1129
1130 \begin{figure}
1131 \centerline{\includegraphics[width=13.5cm]{plots/compelsetup.pdf}}
1132 \caption{Typical double-membrane setup for CompEL simulations (A, B).
1133 Ion\,/\,water molecule exchanges will be performed as needed
1134 between the two light blue volumes around the dotted black lines (A).
1135 Plot (C) shows the potential difference $\Delta U$ resulting
1136 from the selected charge imbalance $\Delta q_{ref}$ between the compartments.}
1137 \label{fig:compelsetup}
1138 \end{figure}
1139
1140 The potential difference $\Delta U$ across the membrane is easily calculated with the
1141 {\tt gmx potential} utility. By this, the potential drop along $z$ or the
1142 pore axis is exactly known in each time interval of the simulation (\figref{compelsetup} C).
1143 Type and number of ions $n_i$ of charge $q_i$, traversing the channel in the simulation,
1144 are written to the {\tt swapions.xvg} output file, from which the average channel
1145 conductance $G$ in each interval $\Delta t$ is determined by:
1146 \beq
1147 G = \frac{\sum_{i} n_{i}q_{i}}{\Delta t \, \Delta U} \, .
1148 \eeq
1149 The ion selectivity is calculated as the number flux ratio of different species.
1150 Best results are obtained by averaging these values over several overlapping time intervals.
1151
1152 The calculation of reversal potentials is best achieved using a small set of simulations in which a given
1153 transmembrane concentration gradient is complemented with small ion imbalances of varying magnitude. For
1154 example, if one compartment contains 1\,M salt and the other 0.1\,M, and given charge neutrality otherwise,
1155 a set of simulations with $\Delta q = 0\,e$, $\Delta q = 2\,e$, $\Delta q = 4\,e$ could
1156 be used. Fitting a straight line through the current-voltage relationship of all obtained
1157 $I$-$U$ pairs near zero current will then yield $U_{rev}$.
1158
1159 \subsection{Usage}
1160 The following {\tt .mdp} options control the CompEL protocol:
1161 {\small
1162 \begin{verbatim}
1163 swapcoords     = Z        ; Swap positions: no, X, Y, Z
1164 swap-frequency = 100      ; Swap attempt frequency
1165 \end{verbatim}}
1166 Choose {\tt Z} if your membrane is in the $xy$-plane (\figref{compelsetup}).
1167 Ions will be exchanged between compartments depending on their $z$-positions alone.
1168 {\tt swap-frequency} determines how often a swap attempt will be made.
1169 This step requires that the positions of the split groups, the ions, and possibly the solvent molecules are
1170 communicated between the parallel processes, so if chosen too small it can decrease the simulation
1171 performance. The {\tt Position swapping} entry in the cycle and time accounting
1172 table at the end of the {\tt md.log} file summarizes the amount of runtime spent
1173 in the swap module.
1174 {\small
1175 \begin{verbatim}
1176 split-group0   = channel0 ; Defines compartment boundary
1177 split-group1   = channel1 ; Defines other compartment boundary
1178 massw-split0   = no       ; use mass-weighted center?
1179 massw-split1   = no
1180 \end{verbatim}}
1181 {\tt split-group0} and {\tt split-group1} are two index groups that define the boundaries
1182 between the two compartments, which are usually the centers of the channels.
1183 If {\tt massw-split0} or {\tt massw-split1} are set to {\tt yes}, the center of mass
1184 of each index group is used as boundary, here in $z$-direction. Otherwise, the
1185 geometrical centers will be used ($\times$ in \figref{compelsetup} A). If, such as here, a membrane
1186 channel is selected as split group, the center of the channel will define the dividing
1187 plane between the compartments (dashed horizontal lines). All index groups
1188 must be defined in the index file.
1189
1190 If, to restore the requested ion counts, an ion from one compartment has to be exchanged
1191 with a water molecule from the other compartment, then those molecules are swapped
1192 which have the largest distance to the compartment-defining boundaries
1193 (dashed horizontal lines). Depending on the ion concentration,
1194 this effectively results in exchanges of molecules between the light blue volumes.
1195 If a channel is very asymmetric in $z$-direction and would extend into one of the
1196 swap volumes, one can offset the swap exchange plane with the {\tt bulk-offset}
1197 parameter. A value of 0.0 means no offset $b$, values $-1.0 < b < 0$ move the
1198 swap exchange plane closer to the lower, values $0 < b < 1.0$ closer to the upper
1199 membrane. \figref{compelsetup} A (left) depicts that for the {\bf A} compartment.
1200
1201 {\small
1202 \begin{verbatim}
1203 solvent-group  = SOL      ; Group containing the solvent molecules
1204 iontypes       = 3        ; Number of different ion types to control
1205 iontype0-name  = NA       ; Group name of the ion type
1206 iontype0-in-A  = 51       ; Reference count of ions of type 0 in A
1207 iontype0-in-B  = 35       ; Reference count of ions of type 0 in B
1208 iontype1-name  = K
1209 iontype1-in-A  = 10
1210 iontype1-in-B  = 38
1211 iontype2-name  = CL
1212 iontype2-in-A  = -1
1213 iontype2-in-B  = -1
1214 \end{verbatim}}
1215 The group name of solvent molecules acting as exchange partners for the ions
1216 has to be set with {\tt solvent-group}. The number of different ionic species under
1217 control of the CompEL protocol is given by the {\tt iontypes} parameter,
1218 while {\tt iontype0-name} gives the name of the index group containing the
1219 atoms of this ionic species. The reference number of ions of this type 
1220 can be set with the {\tt iontype0-in-A} and {\tt iontype0-in-B} options
1221 for compartments {\bf A} and {\bf B}, respectively. Obviously,
1222 the sum of {\tt iontype0-in-A} and {\tt iontype0-in-B} needs to equal the number
1223 of ions in the group defined by {\tt iontype0-name}.
1224 A reference number of {\tt -1} means: use the number of ions as found at the beginning
1225 of the simulation as the reference value.
1226
1227 {\small
1228 \begin{verbatim}
1229 coupl-steps    = 10       ; Average over these many swap steps
1230 threshold      = 1        ; Do not swap if < threshold
1231 \end{verbatim}}
1232 If {\tt coupl-steps} is set to 1, then the momentary ion distribution determines
1233 whether ions are exchanged. {\tt coupl-steps} \textgreater\ 1 will use the time-average
1234 of ion distributions over the selected number of attempt steps instead. This can be useful, for example,
1235 when ions diffuse near compartment boundaries, which would lead to numerous unproductive
1236 ion exchanges. A {\tt threshold} of 1 means that a swap is performed if the average ion
1237 count in a compartment differs by at least 1 from the requested values. Higher thresholds
1238 will lead to toleration of larger differences. Ions are exchanged until the requested
1239 number $\pm$ the threshold is reached.
1240
1241 {\small
1242 \begin{verbatim}
1243 cyl0-r         = 5.0      ; Split cylinder 0 radius (nm)
1244 cyl0-up        = 0.75     ; Split cylinder 0 upper extension (nm)
1245 cyl0-down      = 0.75     ; Split cylinder 0 lower extension (nm)
1246 cyl1-r         = 5.0      ; same for other channel
1247 cyl1-up        = 0.75
1248 cyl1-down      = 0.75
1249 \end{verbatim}}
1250 The cylinder options are used to define virtual geometric cylinders around the
1251 channel's pore to track how many ions of which type have passed each channel.
1252 Ions will be counted as having traveled through a channel
1253 according to the definition of the channel's cylinder radius, upper and lower extension,
1254 relative to the location of the respective split group. This will not affect the actual
1255 flux or exchange, but will provide you with the ion permeation numbers across
1256 each of the channels. Note that an ion can only be counted as passing through a particular
1257 channel if it is detected \emph{within} the defined split cylinder in a swap step.
1258 If {\tt swap-frequency} is chosen too high, a particular ion may be detected in compartment {\bf A}
1259 in one swap step, and in compartment {\bf B} in the following swap step, so it will be unclear
1260 through which of the channels it has passed.
1261
1262 A double-layered system for CompEL simulations can be easily prepared by
1263 duplicating an existing membrane/channel MD system in the direction of the membrane
1264 normal (typically $z$) with {\tt gmx editconf -translate 0 0 <l_z>}, where {\tt l_z}
1265 is the box length in that direction. If you have already defined index groups for
1266 the channel for the single-layered system, {\tt gmx make_ndx -n index.ndx -twin} will
1267 provide you with the groups for the double-layered system.
1268
1269 To suppress large fluctuations of the membranes along the swap direction,
1270 it may be useful to apply a harmonic potential (acting only in the swap dimension)
1271 between each of the two channel and/or bilayer centers using umbrella pulling
1272 (see section~\ref{sec:pull}).
1273
1274 \subsection*{Multimeric channels}
1275 If a split group consists of more than one molecule, the correct PBC image of all molecules
1276 with respect to each other has to be chosen such that the channel center can be correctly
1277 determined. \gromacs\ assumes that the starting structure in the {\tt .tpr}
1278 file has the correct PBC representation. Set the following environment variable
1279 to check whether that is the case:
1280 \begin{itemize}
1281 \item   {\tt GMX_COMPELDUMP}: output the starting structure after it has been made whole to
1282         {\tt .pdb} file.
1283 \end{itemize}
1284
1285
1286 \section{Calculating a PMF using the free-energy code}
1287 \label{sec:fepmf}
1288 \index{potentials of mean force}
1289 \index{free energy calculations}
1290 The free-energy coupling-parameter approach (see~\secref{fecalc})
1291 provides several ways to calculate potentials of mean force.
1292 A potential of mean force between two atoms can be calculated
1293 by connecting them with a harmonic potential or a constraint.
1294 For this purpose there are special potentials that avoid the generation of
1295 extra exclusions, see~\secref{excl}.
1296 When the position of the minimum or the constraint length is 1 nm more
1297 in state B than in state A, the restraint or constraint force is given
1298 by $\partial H/\partial \lambda$.
1299 The distance between the atoms can be changed as a function of $\lambda$
1300 and time by setting {\tt delta-lambda} in the {\tt .mdp} file.
1301 The results should be identical (although not numerically
1302 due to the different implementations) to the results of the pull code
1303 with umbrella sampling and constraint pulling.
1304 Unlike the pull code, the free energy code can also handle atoms that
1305 are connected by constraints.
1306
1307 Potentials of mean force can also be calculated using position restraints.
1308 With position restraints, atoms can be linked to a position in space
1309 with a harmonic potential (see \ssecref{positionrestraint}).
1310 These positions can be made a function of the coupling parameter $\lambda$.
1311 The positions for the A and the B states are supplied to {\tt grompp} with
1312 the {\tt -r} and {\tt -rb} options, respectively.
1313 One could use this approach to do \normindex{targeted MD};
1314 note that we do not encourage the use of targeted MD for proteins.
1315 A protein can be forced from one conformation to another by using
1316 these conformations as position restraint coordinates for state A and B.
1317 One can then slowly change $\lambda$ from 0 to 1.
1318 The main drawback of this approach is that the conformational freedom
1319 of the protein is severely limited by the position restraints,
1320 independent of the change from state A to B.
1321 Also, the protein is forced from state A to B in an almost straight line,
1322 whereas the real pathway might be very different.
1323 An example of a more fruitful application is a solid system or a liquid
1324 confined between walls where one wants to measure the force required
1325 to change the separation between the boundaries or walls.
1326 Because the boundaries (or walls) already need to be fixed,
1327 the position restraints do not limit the system in its sampling.
1328
1329 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1330 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1331 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1332 \newcommand{\amine}{\sf -NH$_2$}
1333 \newcommand{\amines}{\sf -NH-}
1334 \newcommand{\aminep}{\sf -NH$_3^+$}
1335 \section{Removing fastest \swapindex{degrees of}{freedom}}
1336 \label{sec:rmfast}
1337 The maximum time step in MD simulations is limited by the smallest
1338 oscillation period that can be found in the simulated
1339 system. Bond-stretching vibrations are in their quantum-mechanical
1340 ground state and are therefore better represented by a constraint 
1341 instead of a harmonic potential.
1342
1343 For the remaining degrees of freedom, the shortest oscillation period
1344 (as measured from a simulation) is 13~fs for bond-angle vibrations
1345 involving hydrogen atoms. Taking as a guideline that with a Verlet
1346 (leap-frog) integration scheme a minimum of 5 numerical integration
1347 steps should be performed per period of a harmonic oscillation in
1348 order to integrate it with reasonable accuracy, the maximum time step
1349 will be about 3~fs. Disregarding these very fast oscillations of
1350 period 13~fs, the next shortest periods are around 20~fs, which will
1351 allow a maximum time step of about 4~fs.
1352
1353 Removing the bond-angle degrees of freedom from hydrogen atoms can
1354 best be done by defining them as \normindex{virtual interaction sites}
1355 instead of normal atoms. Whereas a normal atom is connected to the molecule
1356 with bonds, angles and dihedrals, a virtual site's position is calculated
1357 from the position of three nearby heavy atoms in a predefined manner
1358 (see also \secref{virtual_sites}). For the hydrogens in water and in
1359 hydroxyl, sulfhydryl, or amine groups, no degrees of freedom can be
1360 removed, because rotational freedom should be preserved. The only
1361 other option available to slow down these motions is to increase the
1362 mass of the hydrogen atoms at the expense of the mass of the connected
1363 heavy atom. This will increase the moment of inertia of the water
1364 molecules and the hydroxyl, sulfhydryl, or amine groups, without
1365 affecting the equilibrium properties of the system and without
1366 affecting the dynamical properties too much. These constructions will
1367 shortly be described in \secref{vsitehydro} and have previously
1368 been described in full detail~\cite{feenstra99}.
1369
1370 Using both virtual sites and \swapindex{modified}{mass}es, the next
1371 bottleneck is likely to be formed by the improper dihedrals (which are
1372 used to preserve planarity or chirality of molecular groups) and the
1373 peptide dihedrals. The peptide dihedral cannot be changed without
1374 affecting the physical behavior of the protein. The improper dihedrals
1375 that preserve planarity mostly deal with aromatic residues. Bonds,
1376 angles, and dihedrals in these residues can also be replaced with
1377 somewhat elaborate virtual site constructions.
1378
1379 All modifications described in this section can be performed using the
1380 {\gromacs} topology building tool {\tt \normindex{pdb2gmx}}. Separate
1381 options exist to increase hydrogen masses, virtualize all hydrogen atoms,
1382 or also virtualize all aromatic residues. {\bf Note} that when all hydrogen
1383 atoms are virtualized, those inside the aromatic residues will be
1384 virtualized as well, {\ie} hydrogens in the aromatic residues are treated
1385 differently depending on the treatment of the aromatic residues.
1386
1387 Parameters for the virtual site constructions for the hydrogen atoms are
1388 inferred from the force-field parameters ({\em vis}. bond lengths and
1389 angles) directly by {\tt \normindex{grompp}} while processing the
1390 topology file.  The constructions for the aromatic residues are based
1391 on the bond lengths and angles for the geometry as described in the
1392 force fields, but these parameters are hard-coded into {\tt
1393 \normindex{pdb2gmx}} due to the complex nature of the construction
1394 needed for a whole aromatic group.
1395
1396 \subsection{Hydrogen bond-angle vibrations}
1397 \label{sec:vsitehydro}
1398 \subsubsection{Construction of virtual sites} %%%%%%%%%%%%%%%%%%%%%%%%%
1399 \begin{figure}
1400 \centerline{\includegraphics[width=11cm]{plots/dumtypes}}
1401 \caption[Virtual site constructions for hydrogen atoms.]{The different
1402 types of virtual site constructions used for hydrogen atoms. The atoms
1403 used in the construction of the virtual site(s) are depicted as black
1404 circles, virtual sites as gray ones. Hydrogens are smaller than heavy
1405 atoms. {\sf A}: fixed bond angle, note that here the hydrogen is not a
1406 virtual site; {\sf B}: in the plane of three atoms, with fixed distance;
1407 {\sf C}: in the plane of three atoms, with fixed angle and distance;
1408 {\sf D}: construction for amine groups ({\amine} or {\aminep}), see
1409 text for details.}
1410 \label{fig:vsitehydro}
1411 \end{figure}
1412
1413 The goal of defining hydrogen atoms as virtual sites is to remove all
1414 high-frequency degrees of freedom from them. In some cases, not all
1415 degrees of freedom of a hydrogen atom should be removed, {\eg} in the
1416 case of hydroxyl or amine groups the rotational freedom of the
1417 hydrogen atom(s) should be preserved. Care should be taken that no
1418 unwanted correlations are introduced by the construction of virtual
1419 sites, {\eg} bond-angle vibration between the constructing atoms could
1420 translate into hydrogen bond-length vibration. Additionally, since
1421 virtual sites are by definition massless, in order to preserve total
1422 system mass, the mass of each hydrogen atom that is treated as virtual
1423 site should be added to the bonded heavy atom.
1424
1425 Taking into account these considerations, the hydrogen atoms in a
1426 protein naturally fall into several categories, each requiring a
1427 different approach (see also \figref{vsitehydro}).
1428
1429 \begin{itemize}
1430
1431 \item{\em hydroxyl ({\sf -OH}) or sulfhydryl ({\sf -SH})
1432 hydrogen:\/} The only internal degree of freedom in a hydroxyl group
1433 that can be constrained is the bending of the {\sf C-O-H} angle. This
1434 angle is fixed by defining an additional bond of appropriate length,
1435 see \figref{vsitehydro}A. Doing so removes the high-frequency angle bending,
1436 but leaves the dihedral rotational freedom. The same goes for a
1437 sulfhydryl group. {\bf Note} that in these cases the hydrogen is not treated
1438 as a virtual site.
1439
1440 \item{\em single amine or amide ({\amines}) and aromatic hydrogens
1441 ({\sf -CH-}):\/} The position of these hydrogens cannot be constructed
1442 from a linear combination of bond vectors, because of the flexibility
1443 of the angle between the heavy atoms. Instead, the hydrogen atom is
1444 positioned at a fixed distance from the bonded heavy atom on a line
1445 going through the bonded heavy atom and a point on the line through
1446 both second bonded atoms, see \figref{vsitehydro}B.
1447
1448 \item{\em planar amine ({\amine}) hydrogens:\/} The method used for
1449 the single amide hydrogen is not well suited for planar amine groups,
1450 because no suitable two heavy atoms can be found to define the
1451 direction of the hydrogen atoms. Instead, the hydrogen is constructed
1452 at a fixed distance from the nitrogen atom, with a fixed angle to the
1453 carbon atom, in the plane defined by one of the other heavy atoms, see
1454 \figref{vsitehydro}C.
1455
1456 \item{\em amine group (umbrella {\amine} or {\aminep}) hydrogens:\/}
1457 Amine hydrogens with rotational freedom cannot be constructed as virtual
1458 sites from the heavy atoms they are connected to, since this would
1459 result in loss of the rotational freedom of the amine group. To
1460 preserve the rotational freedom while removing the hydrogen bond-angle
1461 degrees of freedom, two ``dummy masses'' are constructed with the same
1462 total mass, moment of inertia (for rotation around the {\sf C-N} bond)
1463 and center of mass as the amine group. These dummy masses have no
1464 interaction with any other atom, except for the fact that they are
1465 connected to the carbon and to each other, resulting in a rigid
1466 triangle. From these three particles, the positions of the nitrogen and
1467 hydrogen atoms are constructed as linear combinations of the two
1468 carbon-mass vectors and their outer product, resulting in an amine
1469 group with rotational freedom intact, but without other internal
1470 degrees of freedom. See \figref{vsitehydro}D.
1471
1472 \end{itemize}
1473
1474 \begin{figure}
1475 \centerline{\includegraphics[width=15cm]{plots/dumaro}}
1476 \caption[Virtual site constructions for aromatic residues.]{The
1477 different types of virtual site constructions used for aromatic
1478 residues. The atoms used in the construction of the virtual site(s) are
1479 depicted as black circles, virtual sites as gray ones. Hydrogens are
1480 smaller than heavy atoms. {\sf A}: phenylalanine; {\sf B}: tyrosine
1481 (note that the hydroxyl hydrogen is {\em not} a virtual site); {\sf C}:
1482 tryptophan; {\sf D}: histidine.}
1483 \label{fig:vistearo}
1484 \end{figure}
1485
1486 \subsection{Out-of-plane vibrations in aromatic groups}
1487 \label{sec:vsitearo}
1488 The planar arrangements in the side chains of the aromatic residues
1489 lends itself perfectly to a virtual-site construction, giving a
1490 perfectly planar group without the inherently unstable constraints
1491 that are necessary to keep normal atoms in a plane. The basic approach
1492 is to define three atoms or dummy masses with constraints between them
1493 to fix the geometry and create the rest of the atoms as simple virtual
1494 sites type (see \secref{virtual_sites}) from these three. Each of
1495 the aromatic residues require a different approach:
1496
1497 \begin{itemize}
1498
1499 \item{\em Phenylalanine:\/} {\sf C}$_\gamma$, {\sf C}$_{{\epsilon}1}$,
1500 and {\sf C}$_{{\epsilon}2}$ are kept as normal atoms, but with each a
1501 mass of one third the total mass of the phenyl group. See
1502 \figref{vsitehydro}A.
1503
1504 \item{\em Tyrosine:\/} The ring is treated identically to the
1505 phenylalanine ring. Additionally, constraints are defined between {\sf
1506 C}$_{{\epsilon}1}$, {\sf C}$_{{\epsilon}2}$, and {\sf O}$_{\eta}$.
1507 The original improper dihedral angles will keep both triangles (one
1508 for the ring and one with {\sf O}$_{\eta}$) in a plane, but due to the
1509 larger moments of inertia this construction will be much more
1510 stable. The bond-angle in the hydroxyl group will be constrained by a
1511 constraint between {\sf C}$_\gamma$ and {\sf H}$_{\eta}$. {\bf Note} that
1512 the hydrogen is not treated as a virtual site. See
1513 \figref{vsitehydro}B.
1514
1515 \item{\em Tryptophan:\/} {\sf C}$_\beta$ is kept as a normal atom
1516 and two dummy masses are created at the center of mass of each of the
1517 rings, each with a mass equal to the total mass of the respective ring
1518 ({\sf C}$_{{\delta}2}$ and {\sf C}$_{{\epsilon}2}$ are each
1519 counted half for each ring). This keeps the overall center of mass and
1520 the moment of inertia almost (but not quite) equal to what it was. See
1521 \figref{vsitehydro}C.
1522
1523 \item{\em Histidine:\/} {\sf C}$_\gamma$, {\sf C}$_{{\epsilon}1}$
1524 and {\sf N}$_{{\epsilon}2}$ are kept as normal atoms, but with masses
1525 redistributed such that the center of mass of the ring is
1526 preserved. See \figref{vsitehydro}D.
1527
1528 \end{itemize}
1529
1530 \section{Viscosity calculation\index{viscosity}}
1531
1532 The shear viscosity is a property of liquids that can be determined easily  
1533 by experiment. It is useful for parameterizing a force field
1534 because it is a kinetic property, while most other properties
1535 which are used for parameterization are thermodynamic.
1536 The viscosity is also an important property, since it influences
1537 the rates of conformational changes of molecules solvated in the liquid.
1538
1539 The viscosity can be calculated from an equilibrium simulation using
1540 an Einstein relation:
1541 \beq
1542 \eta = \frac{1}{2}\frac{V}{k_B T} \lim_{t \rightarrow \infty}
1543 \frac{\mbox{d}}{\mbox{d} t} \left\langle 
1544 \left( \int_{t_0}^{{t_0}+t} P_{xz}(t') \mbox{d} t' \right)^2
1545 \right\rangle_{t_0}
1546 \eeq
1547 This can be done with {\tt gmx energy}.
1548 This method converges very slowly~\cite{Hess2002a}, and as such
1549 a nanosecond simulation might not
1550 be long enough for an accurate determination of the viscosity.
1551 The result is very dependent on the treatment of the electrostatics.
1552 Using a (short) cut-off results in large noise on the off-diagonal
1553 pressure elements, which can increase the calculated viscosity by an order
1554 of magnitude.
1555
1556 {\gromacs} also has a non-equilibrium method for determining
1557 the viscosity~\cite{Hess2002a}.
1558 This makes use of the fact that energy, which is fed into system by
1559 external forces, is dissipated through viscous friction. The generated heat
1560 is removed by coupling to a heat bath. For a Newtonian liquid adding a 
1561 small force will result in a velocity gradient according to the following
1562 equation:
1563 \beq
1564 a_x(z) + \frac{\eta}{\rho} \frac{\partial^2 v_x(z)}{\partial z^2} = 0
1565 \eeq
1566 Here we have applied an acceleration $a_x(z)$ in the $x$-direction, which
1567 is a function of the $z$-coordinate.
1568 In {\gromacs} the acceleration profile is:
1569 \beq
1570 a_x(z) = A \cos\left(\frac{2\pi z}{l_z}\right)
1571 \eeq
1572 where $l_z$ is the height of the box. The generated velocity profile is:
1573 \beq
1574 v_x(z) = V \cos\left(\frac{2\pi z}{l_z}\right)
1575 \eeq
1576 \beq
1577 V = A \frac{\rho}{\eta}\left(\frac{l_z}{2\pi}\right)^2
1578 \eeq
1579 The viscosity can be calculated from $A$ and $V$:
1580 \beq
1581 \label{visc}
1582 \eta = \frac{A}{V}\rho \left(\frac{l_z}{2\pi}\right)^2
1583 \eeq
1584
1585 In the simulation $V$ is defined as:
1586 \beq
1587 V = \frac{\displaystyle \sum_{i=1}^N m_i v_{i,x} 2 \cos\left(\frac{2\pi z}{l_z}\right)}
1588          {\displaystyle \sum_{i=1}^N m_i}
1589 \eeq
1590 The generated velocity profile is not coupled to the heat bath. Moreover,
1591 the velocity profile is excluded from the kinetic energy.
1592 One would like $V$ to be as large as possible to get good statistics.
1593 However, the shear rate should not be so high that the system gets too far
1594 from equilibrium. The maximum shear rate occurs where the cosine is zero,
1595 the rate being:
1596 \beq
1597 \mbox{sh}_{\max} =  \max_z \left| \frac{\partial v_x(z)}{\partial z} \right|
1598 = A \frac{\rho}{\eta} \frac{l_z}{2\pi}
1599 \eeq
1600 For a simulation with: $\eta=10^{-3}$ [kg\,m$^{-1}$\,s$^{-1}$],
1601 $\rho=10^3$\,[kg\,m$^{-3}$] and $l_z=2\pi$\,[nm],
1602 $\mbox{sh}_{\max}=1$\,[ps\,nm$^{-1}$] $A$.
1603 This shear rate should be smaller than one over the longest
1604 correlation time in the system. For most liquids, this will be the rotation
1605 correlation time, which is around 10 ps. In this case, $A$ should
1606 be smaller than 0.1\,[nm\,ps$^{-2}$].
1607 When the shear rate is too high, the observed viscosity will be too low.
1608 Because $V$ is proportional to the square of the box height,
1609 the optimal box is elongated in the $z$-direction.
1610 In general, a simulation length of 100 ps is enough to obtain an
1611 accurate value for the viscosity.
1612
1613 The heat generated by the viscous friction is removed by coupling to a heat
1614 bath. Because this coupling is not instantaneous the real temperature of the
1615 liquid will be slightly lower than the observed temperature.
1616 Berendsen derived this temperature shift~\cite{Berendsen91}, which can
1617 be written in terms of the shear rate as:
1618 \beq
1619 T_s = \frac{\eta\,\tau}{2 \rho\,C_v} \mbox{sh}_{\max}^2
1620 \eeq
1621 where $\tau$ is the coupling time for the Berendsen thermostat and
1622 $C_v$ is the heat capacity. Using the values of the example above,
1623 $\tau=10^{-13}$ [s] and $C_v=2 \cdot 10^3$\,[J kg$^{-1}$\,K$^{-1}$], we
1624 get: $T_s=25$\,[K\,ps$^{-2}$]\,sh$_{\max}^2$. When we want the shear
1625 rate to be smaller than $1/10$\,[ps$^{-1}$], $T_s$ is smaller than
1626 0.25\,[K], which is negligible.
1627
1628 {\bf Note} that the system has to build up the velocity profile when starting
1629 from an equilibrium state. This build-up time is of the order of the
1630 correlation time of the liquid.
1631
1632 Two quantities are written to the energy file, along with their averages
1633 and fluctuations: $V$ and $1/\eta$, as obtained from (\ref{visc}).
1634
1635 \section{Tabulated interaction functions\index{tabulated interaction functions}}
1636 \subsection{Cubic splines for potentials}
1637 \label{subsec:cubicspline}
1638 In some of the inner loops of {\gromacs}, look-up tables are used 
1639 for computation of potential and forces. 
1640 The tables are interpolated using a cubic
1641 spline algorithm. 
1642 There are separate tables for electrostatic, dispersion, and repulsion
1643 interactions,
1644 but for the sake of caching performance these have been combined
1645 into a single array. 
1646 The cubic spline interpolation for $x_i \leq x < x_{i+1}$ looks like this:
1647 \beq
1648 V_s(x) = A_0 + A_1 \,\epsilon + A_2 \,\epsilon^2 + A_3 \,\epsilon^3
1649 \label{eqn:spline}
1650 \eeq
1651 where the table spacing $h$ and fraction $\epsilon$ are given by:
1652 \bea
1653 h       &=&     x_{i+1} - x_i   \\
1654 \epsilon&=&     (x - x_i)/h
1655 \eea
1656 so that $0 \le \epsilon < 1$.
1657 From this, we can calculate the derivative in order to determine the forces:
1658 \beq
1659 -V_s'(x) ~=~ 
1660 -\frac{{\rm d}V_s(x)}{{\rm d}\epsilon}\frac{{\rm d}\epsilon}{{\rm d}x} ~=~
1661 -(A_1 + 2 A_2 \,\epsilon + 3 A_3 \,\epsilon^2)/h
1662 \eeq
1663 The four coefficients are determined from the four conditions
1664 that $V_s$ and $-V_s'$ at both ends of each interval should match
1665 the exact potential $V$ and force $-V'$.
1666 This results in the following errors for each interval:
1667 \bea
1668 |V_s  - V  |_{max} &=& V'''' \frac{h^4}{384} + O(h^5) \\
1669 |V_s' - V' |_{max} &=& V'''' \frac{h^3}{72\sqrt{3}} + O(h^4) \\
1670 |V_s''- V''|_{max} &=& V'''' \frac{h^2}{12}  + O(h^3)
1671 \eea
1672 V and V' are continuous, while V'' is the first discontinuous
1673 derivative.
1674 The number of points per nanometer is 500 and 2000
1675 for mixed- and double-precision versions of {\gromacs}, respectively.
1676 This means that the errors in the potential and force will usually
1677 be smaller than the mixed precision accuracy.
1678
1679 {\gromacs} stores $A_0$, $A_1$, $A_2$ and $A_3$.
1680 The force routines get a table with these four parameters and
1681 a scaling factor $s$ that is equal to the number of points per nm.
1682 ({\bf Note} that $h$ is $s^{-1}$).
1683 The algorithm goes a little something like this:
1684 \begin{enumerate}
1685 \item   Calculate distance vector (\ve{r}$_{ij}$) and distance r$_{ij}$
1686 \item   Multiply r$_{ij}$ by $s$ and truncate to an integer value $n_0$
1687         to get a table index
1688 \item   Calculate fractional component ($\epsilon$ = $s$r$_{ij} - n_0$) 
1689         and $\epsilon^2$ 
1690 \item   Do the interpolation to calculate the potential $V$ and the scalar force $f$
1691 \item   Calculate the vector force \ve{F} by multiplying $f$ with \ve{r}$_{ij}$
1692 \end{enumerate}
1693
1694 {\bf Note} that table look-up is significantly {\em
1695 slower} than computation of the most simple Lennard-Jones and Coulomb
1696 interaction. However, it is much faster than the shifted Coulomb
1697 function used in conjunction with the PPPM method. Finally, it is much
1698 easier to modify a table for the potential (and get a graphical
1699 representation of it) than to modify the inner loops of the MD
1700 program.
1701
1702 \subsection{User-specified potential functions}
1703 \label{subsec:userpot}
1704 You can also use your own potential functions\index{potential function} without 
1705 editing the {\gromacs} code.  The potential function should be according to the 
1706 following equation
1707 \beq
1708 V(r_{ij}) ~=~ \frac{q_i q_j}{4 \pi\epsilon_0} f(r_{ij}) + C_6 \,g(r_{ij}) + C_{12} \,h(r_{ij})
1709 \eeq
1710 where $f$, $g$, and $h$ are user defined functions. {\bf Note} that if $g(r)$ represents a
1711 normal dispersion interaction, $g(r)$ should be $<$ 0. C$_6$, C$_{12}$
1712 and the charges are read from the topology. Also note that combination
1713 rules are only supported for Lennard-Jones and Buckingham, and that
1714 your tables should match the parameters in the binary topology.
1715
1716 When you add the following lines in your {\tt .mdp} file:
1717
1718 {\small
1719 \begin{verbatim}
1720 rlist           = 1.0
1721 coulombtype     = User
1722 rcoulomb        = 1.0
1723 vdwtype         = User
1724 rvdw            = 1.0
1725 \end{verbatim}}
1726
1727 {\tt mdrun} will read a single non-bonded table file,
1728 or multiple when {\tt energygrp-table} is set (see below).
1729 The name of the file(s) can be set with the {\tt mdrun} option {\tt -table}.
1730 The table file should contain seven columns of table look-up data in the
1731 order: $x$, $f(x)$, $-f'(x)$, $g(x)$, $-g'(x)$, $h(x)$, $-h'(x)$.
1732 The $x$ should run from 0 to $r_c+1$ (the value of {\tt table_extension} can be
1733 changed in the {\tt .mdp} file).
1734 You can choose the spacing you like; for the standard tables {\gromacs}
1735 uses a spacing of 0.002 and 0.0005 nm when you run in mixed
1736 and double precision, respectively.  In this
1737 context, $r_c$ denotes the maximum of the two cut-offs {\tt rvdw} and
1738 {\tt rcoulomb} (see above). These variables need not be the same (and
1739 need not be 1.0 either).  Some functions used for potentials contain a
1740 singularity at $x = 0$, but since atoms are normally not closer to each
1741 other than 0.1 nm, the function value at $x = 0$ is not important.
1742 Finally, it is also
1743 possible to combine a standard Coulomb with a modified LJ potential
1744 (or vice versa). One then specifies {\eg} {\tt coulombtype = Cut-off} or
1745 {\tt coulombtype = PME}, combined with {\tt vdwtype = User}.  The table file must
1746 always contain the 7 columns however, and meaningful data (i.e. not
1747 zeroes) must be entered in all columns.  A number of pre-built table
1748 files can be found in the {\tt GMXLIB} directory for 6-8, 6-9, 6-10, 6-11, and 6-12
1749 Lennard-Jones potentials combined with a normal Coulomb.
1750
1751 If you want to have different functional forms between different
1752 groups of atoms, this can be set through energy groups.
1753 Different tables can be used for non-bonded interactions between
1754 different energy groups pairs through the {\tt .mdp} option {\tt energygrp-table}
1755 (see details in the User Guide).
1756 Atoms that should interact with a different potential should
1757 be put into different energy groups.
1758 Between group pairs which are not listed in {\tt energygrp-table},
1759 the normal user tables will be used. This makes it easy to use
1760 a different functional form between a few types of atoms.
1761
1762 \section{Mixed Quantum-Classical simulation techniques}
1763
1764 In a molecular mechanics (MM) force field, the influence of electrons
1765 is expressed by empirical parameters that are assigned on the basis of
1766 experimental data, or on the basis of results from high-level quantum
1767 chemistry calculations. These are valid for the ground state of a
1768 given covalent structure, and the MM approximation is usually
1769 sufficiently accurate for ground-state processes in which the overall
1770 connectivity between the atoms in the system remains
1771 unchanged. However, for processes in which the connectivity does
1772 change, such as chemical reactions, or processes that involve multiple
1773 electronic states, such as photochemical conversions, electrons can no
1774 longer be ignored, and a quantum mechanical description is required
1775 for at least those parts of the system in which the reaction takes
1776 place.
1777
1778 One approach to the simulation of chemical reactions in solution, or
1779 in enzymes, is to use a combination of quantum mechanics (QM) and
1780 molecular mechanics (MM). The reacting parts of the system are treated
1781 quantum mechanically, with the remainder being modeled using the
1782 force field. The current version of {\gromacs} provides interfaces to
1783 several popular Quantum Chemistry packages (MOPAC~\cite{mopac},
1784 GAMESS-UK~\cite{gamess-uk}, Gaussian~\cite{g03} and CPMD~\cite{Car85a}).
1785
1786 {\gromacs} interactions between the two subsystems are
1787 either handled as described by Field {\em et al.}~\cite{Field90a} or
1788 within the ONIOM approach by Morokuma and coworkers~\cite{Maseras96a,
1789 Svensson96a}.
1790
1791 \subsection{Overview}
1792
1793 Two approaches for describing the interactions between the QM and MM
1794 subsystems are supported in this version:
1795
1796 \begin{enumerate}
1797 \item{\textbf{Electronic Embedding}} The electrostatic interactions
1798 between the electrons of the QM region and the MM atoms and between
1799 the QM nuclei and the MM atoms are included in the Hamiltonian for
1800 the QM subsystem: \beq H^{QM/MM} =
1801 H^{QM}_e-\sum_i^n\sum_J^M\frac{e^2Q_J}{4\pi\epsilon_0r_{iJ}}+\sum_A^N\sum_J^M\frac{e^2Z_AQ_J}{e\pi\epsilon_0R_{AJ}},
1802 \eeq where $n$ and $N$ are the number of electrons and nuclei in the
1803 QM region, respectively, and $M$ is the number of charged MM
1804 atoms. The first term on the right hand side is the original
1805 electronic Hamiltonian of an isolated QM system. The first of the
1806 double sums is the total electrostatic interaction between the QM
1807 electrons and the MM atoms. The total electrostatic interaction of the
1808 QM nuclei with the MM atoms is given by the second double sum. Bonded
1809 interactions between QM and MM atoms are described at the MM level by
1810 the appropriate force-field terms. Chemical bonds that connect the two
1811 subsystems are capped by a hydrogen atom to complete the valence of
1812 the QM region. The force on this atom, which is present in the QM
1813 region only, is distributed over the two atoms of the bond. The cap
1814 atom is usually referred to as a link atom.
1815
1816 \item{\textbf{ONIOM}} In the ONIOM approach, the energy and gradients
1817 are first evaluated for the isolated QM subsystem at the desired level
1818 of {\it{ab initio}} theory. Subsequently, the energy and gradients of
1819 the total system, including the QM region, are computed using the
1820 molecular mechanics force field and added to the energy and gradients
1821 calculated for the isolated QM subsystem. Finally, in order to correct
1822 for counting the interactions inside the QM region twice, a molecular
1823 mechanics calculation is performed on the isolated QM subsystem and
1824 the energy and gradients are subtracted. This leads to the following
1825 expression for the total QM/MM energy (and gradients likewise): \beq
1826 E_{tot} = E_{I}^{QM}
1827 +E_{I+II}^{MM}-E_{I}^{MM}, \eeq where the
1828 subscripts I and II refer to the QM and MM subsystems,
1829 respectively. The superscripts indicate at what level of theory the
1830 energies are computed. The ONIOM scheme has the
1831 advantage that it is not restricted to a two-layer QM/MM description,
1832 but can easily handle more than two layers, with each layer described
1833 at a different level of theory.
1834 \end{enumerate}
1835
1836 \subsection{Usage}
1837
1838 To make use of the QM/MM functionality in {\gromacs}, one needs to:
1839
1840 \begin{enumerate}
1841 \item introduce link atoms at the QM/MM boundary, if needed;
1842 \item specify which atoms are to be treated at a QM level;
1843 \item specify the QM level, basis set, type of QM/MM interface and so on. 
1844 \end{enumerate}
1845
1846 \subsubsection{Adding link atoms}
1847
1848 At the bond that connects the QM and MM subsystems, a link atoms is
1849 introduced.  In {\gromacs} the link atom has special atomtype, called
1850 LA. This atomtype is treated as a hydrogen atom in the QM calculation,
1851 and as a virtual site in the force-field calculation. The link atoms, if
1852 any, are part of the system, but have no interaction with any other
1853 atom, except that the QM force working on it is distributed over the
1854 two atoms of the bond. In the topology, the link atom (LA), therefore,
1855 is defined as a virtual site atom:
1856
1857 {\small
1858 \begin{verbatim}
1859 [ virtual_sites2 ]
1860 LA QMatom MMatom 1 0.65
1861 \end{verbatim}}
1862
1863 See~\secref{vsitetop} for more details on how virtual sites are
1864 treated. The link atom is replaced at every step of the simulation.
1865
1866 In addition, the bond itself is replaced by a constraint:
1867
1868 {\small
1869 \begin{verbatim}
1870 [ constraints ]
1871 QMatom MMatom 2 0.153
1872 \end{verbatim}}
1873
1874 {\bf Note} that, because in our system the QM/MM bond is a carbon-carbon
1875 bond (0.153 nm), we use a constraint length of 0.153 nm, and dummy
1876 position of 0.65. The latter is the ratio between the ideal C-H
1877 bond length and the ideal C-C bond length. With this ratio, the link
1878 atom is always 0.1 nm away from the {\tt QMatom}, consistent with the
1879 carbon-hydrogen bond length. If the QM and MM subsystems are connected
1880 by a different kind of bond, a different constraint and a different
1881 dummy position, appropriate for that bond type, are required.
1882
1883 \subsubsection{Specifying the QM atoms}
1884
1885 Atoms that should be treated at a QM level of theory, including the
1886 link atoms, are added to the index file. In addition, the chemical
1887 bonds between the atoms in the QM region are to be defined as
1888 connect bonds (bond type 5) in the topology file:
1889
1890 {\small
1891 \begin{verbatim}
1892 [ bonds ]
1893 QMatom1 QMatom2 5
1894 QMatom2 QMatom3 5
1895 \end{verbatim}}
1896
1897 \subsubsection{Specifying the QM/MM simulation parameters}
1898
1899 In the {\tt .mdp} file, the following parameters control a QM/MM simulation.
1900
1901 \begin{description}
1902
1903 \item[\tt QMMM = no]\mbox{}\\ If this is set to {\tt yes}, a QM/MM
1904 simulation is requested. Several groups of atoms can be described at
1905 different QM levels separately. These are specified in the QMMM-grps
1906 field separated by spaces. The level of {\it{ab initio}} theory at which the
1907 groups are described is specified by {\tt QMmethod} and {\tt QMbasis}
1908 Fields. Describing the groups at different levels of theory is only
1909 possible with the ONIOM QM/MM scheme, specified by {\tt QMMMscheme}.
1910
1911 \item[\tt QMMM-grps =]\mbox{}\\groups to be described at the QM level
1912
1913 \item[\tt QMMMscheme = normal]\mbox{}\\Options are {\tt normal} and
1914 {\tt ONIOM}. This selects the QM/MM interface. {\tt normal} implies
1915 that the QM subsystem is electronically embedded in the MM
1916 subsystem. There can only be one {\tt QMMM-grps} that is modeled at
1917 the {\tt QMmethod} and {\tt QMbasis} level of {\it{ ab initio}}
1918 theory. The rest of the system is described at the MM level. The QM
1919 and MM subsystems interact as follows: MM point charges are included
1920 in the QM one-electron Hamiltonian and all Lennard-Jones interactions
1921 are described at the MM level. If {\tt ONIOM} is selected, the
1922 interaction between the subsystem is described using the ONIOM method
1923 by Morokuma and co-workers. There can be more than one QMMM-grps each
1924 modeled at a different level of QM theory (QMmethod and QMbasis).
1925
1926 \item[\tt QMmethod = ]\mbox{}\\Method used to compute the energy
1927 and gradients on the QM atoms. Available methods are AM1, PM3, RHF,
1928 UHF, DFT, B3LYP, MP2, CASSCF, MMVB and CPMD. For CASSCF, the number of
1929 electrons and orbitals included in the active space is specified by
1930 {\tt CASelectrons} and {\tt CASorbitals}. For CPMD, the plane-wave
1931 cut-off is specified by the {\tt planewavecutoff} keyword.
1932
1933 \item[\tt QMbasis = ]\mbox{}\\Gaussian basis set used to expand the
1934 electronic wave-function. Only Gaussian basis sets are currently
1935 available, i.e. STO-3G, 3-21G, 3-21G*, 3-21+G*, 6-21G, 6-31G, 6-31G*,
1936 6-31+G*, and 6-311G. For CPMD, which uses plane wave expansion rather
1937 than atom-centered basis functions, the {\tt planewavecutoff} keyword
1938 controls the plane wave expansion.
1939
1940 \item[\tt QMcharge = ]\mbox{}\\The total charge in {\it{e}} of the {\tt
1941 QMMM-grps}. In case there are more than one {\tt QMMM-grps}, the total
1942 charge of each ONIOM layer needs to be specified separately.
1943
1944 \item[\tt QMmult = ]\mbox{}\\The multiplicity of the {\tt
1945 QMMM-grps}. In case there are more than one {\tt QMMM-grps}, the
1946 multiplicity of each ONIOM layer needs to be specified separately.
1947
1948 \item[\tt CASorbitals = ]\mbox{}\\The number of orbitals to be
1949 included in the active space when doing a CASSCF computation.
1950
1951 \item[\tt CASelectrons = ]\mbox{}\\The number of electrons to be
1952 included in the active space when doing a CASSCF computation.
1953
1954 \item[\tt SH = no]\mbox{}\\If this is set to yes, a QM/MM MD
1955 simulation on the excited state-potential energy surface and enforce a
1956 diabatic hop to the ground-state when the system hits the conical
1957 intersection hyperline in the course the simulation. This option only
1958 works in combination with the CASSCF method.
1959
1960 \end{description}
1961
1962 \subsection{Output}
1963
1964 The energies and gradients computed in the QM calculation are added to
1965 those computed by {\gromacs}. In the {\tt .edr} file there is a section
1966 for the total QM energy.
1967
1968 \subsection{Future developments}
1969
1970 Several features are currently under development to increase the
1971 accuracy of the QM/MM interface. One useful feature is the use of
1972 delocalized MM charges in the QM computations. The most important
1973 benefit of using such smeared-out charges is that the Coulombic
1974 potential has a finite value at interatomic distances. In the point
1975 charge representation, the partially-charged MM atoms close to the QM
1976 region tend to ``over-polarize'' the QM system, which leads to artifacts
1977 in the calculation.
1978
1979 What is needed as well is a transition state optimizer.
1980
1981 \section{Using VMD plug-ins for trajectory file I/O}
1982 \index{VMD plug-ins}\index{trajectory file}{\gromacs} tools are able
1983 to use the plug-ins found in an existing installation of
1984 \href{http://www.ks.uiuc.edu/Research/vmd}{VMD} in order to read and
1985 write trajectory files in formats that are not native to
1986 {\gromacs}. You will be able to supply an AMBER DCD-format trajectory
1987 filename directly to {\gromacs} tools, for example.
1988
1989 This requires a VMD installation not older than version 1.8, that your
1990 system provides the dlopen function so that programs can determine at
1991 run time what plug-ins exist, and that you build shared libraries when
1992 building {\gromacs}. CMake will find the vmd executable in your path, and
1993 from it, or the environment variable {\tt VMDDIR} at configuration or
1994 run time, locate the plug-ins. Alternatively, the {\tt VMD_PLUGIN_PATH}
1995 can be used at run time to specify a path where these plug-ins can be
1996 found. Note that these plug-ins are in a binary format, and that format
1997 must match the architecture of the machine attempting to use them.
1998
1999
2000 \section{\normindex{Interactive Molecular Dynamics}}
2001 {\gromacs} supports the interactive molecular dynamics (IMD) protocol as implemented
2002 by \href{http://www.ks.uiuc.edu/Research/vmd}{VMD} to control a running simulation
2003 in NAMD. IMD allows to monitor a running {\gromacs} simulation from a VMD client.
2004 In addition, the user can interact with the simulation by pulling on atoms, residues
2005 or fragments with a mouse or a force-feedback device. Additional information about
2006 the {\gromacs} implementation and an exemplary {\gromacs} IMD system can be found
2007 \href{http://www.mpibpc.mpg.de/grubmueller/interactivemd}{on this homepage}.
2008
2009 \subsection{Simulation input preparation}
2010 The {\gromacs} implementation allows transmission and interaction with a part of the
2011 running simulation only, e.g.\ in cases where no water molecules should be transmitted
2012 or pulled. The group is specified via the {\tt .mdp} option {\tt IMD-group}. When
2013 {\tt IMD-group} is empty, the IMD protocol is disabled and cannot be enabled via the
2014 switches in {\tt mdrun}. To interact with the entire system, {\tt IMD-group} can
2015 be set to {\tt System}. When using {\tt grompp}, a {\tt .gro} file
2016 to be used as VMD input is written out ({\tt -imd} switch of {\tt grompp}).
2017
2018 \subsection{Starting the simulation}
2019 Communication between VMD and {\gromacs} is achieved via TCP sockets and thus enables
2020 controlling an {\tt mdrun} running locally or on a remote cluster. The port for the
2021 connection can be specified with the {\tt -imdport} switch of {\tt mdrun}, 8888 is
2022 the default. If a port number of 0 or smaller is provided, {\gromacs} automatically
2023 assigns a free port to use with IMD.
2024
2025 Every $N$ steps, the {\tt mdrun} client receives the applied forces from VMD and sends the new
2026 positions to the client. VMD permits increasing or decreasing the communication frequency
2027 interactively.
2028 By default, the simulation starts and runs even if no IMD client is connected. This
2029 behavior is changed by the {\tt -imdwait} switch of {\tt mdrun}. After startup and
2030 whenever the client has disconnected, the integration stops until reconnection of
2031 the client.
2032 When the {\tt -imdterm} switch is used, the simulation can be terminated by pressing
2033 the stop button in VMD. This is disabled by default.
2034 Finally, to allow interacting with the simulation (i.e. pulling from VMD) the {\tt -imdpull}
2035 switch has to be used.
2036 Therefore, a simulation can only be monitored but not influenced from the VMD client
2037 when none of {\tt -imdwait}, {\tt -imdterm} or {\tt -imdpull} are set. However, since
2038 the IMD protocol requires no authentication, it is not advisable to run simulations on
2039 a host directly reachable from an insecure environment. Secure shell forwarding of TCP
2040 can be used to connect to running simulations not directly reachable from the interacting host.
2041 Note that the IMD command line switches of {\tt mdrun} are hidden by default and show
2042 up in the help text only with {\tt gmx mdrun -h -hidden}.
2043
2044 \subsection{Connecting from VMD}
2045 In VMD, first the structure corresponding to the IMD group has to be loaded ({\it File
2046 $\rightarrow$ New Molecule}). Then the IMD connection window has to be used
2047 ({\it Extensions $\rightarrow$ Simulation $\rightarrow$ IMD Connect (NAMD)}). In the IMD
2048 connection window, hostname and port have to be specified and followed by pressing
2049 {\it Connect}. {\it Detach Sim} allows disconnecting without terminating the simulation, while
2050 {\it Stop Sim} ends the simulation on the next neighbor searching step (if allowed by
2051 {\tt -imdterm}).
2052
2053 The timestep transfer rate allows adjusting the communication frequency between simulation
2054 and IMD client. Setting the keep rate loads every $N^\mathrm{th}$ frame into VMD instead
2055 of discarding them when a new one is received. The displayed energies are in SI units
2056 in contrast to energies displayed from NAMD simulations.
2057
2058 \section{\normindex{Embedding proteins into the membranes}}
2059 \label{sec:membed}
2060
2061 GROMACS is capable of inserting the protein into pre-equilibrated
2062 lipid bilayers with minimal perturbation of the lipids using the
2063 method, which was initially described as a ProtSqueeze
2064 technique,\cite{Yesylevskyy2007} and later implemented as g\_membed
2065 tool.\cite{Wolf2010} Currently the functionality of g\_membed is
2066 available in mdrun as described in the user guide.
2067
2068 This method works by first artificially shrinking the protein in the
2069 $xy$-plane, then it removes lipids that overlap with that much smaller
2070 core. Then the protein atoms are gradually resized back to their
2071 initial configuration, using normal dynamics for the rest of the
2072 system, so the lipids adapt to the protein. Further lipids are removed
2073 as required.
2074
2075
2076 % LocalWords:  PMF pmf kJ mol Jarzynski BT bilayer rup mdp AFM fepmf fecalc rb
2077 % LocalWords:  posre grompp fs Verlet dihedrals hydrogens hydroxyl sulfhydryl
2078 % LocalWords:  vsitehydro planarity chirality pdb gmx virtualize virtualized xz
2079 % LocalWords:  vis massless tryptophan histidine phenyl parameterizing ij PPPM
2080 % LocalWords:  parameterization Berendsen rlist coulombtype rcoulomb vdwtype LJ
2081 % LocalWords:  rvdw energygrp mdrun pre GMXLIB MOPAC GAMESS CPMD ONIOM
2082 % LocalWords:  Morokuma iJ AQ AJ initio atomtype QMatom MMatom QMMM grps et al
2083 % LocalWords:  QMmethod QMbasis QMMMscheme RHF DFT LYP CASSCF MMVB CASelectrons
2084 % LocalWords:  CASorbitals planewavecutoff STO QMcharge QMmult diabatic edr
2085 % LocalWords:  hyperline delocalized Coulombic indices nm ccc th ps
2086 % LocalWords:  GTX CPUs GHz md sd bd vv avek tcoupl andersen tc OPLSAA GROMOS
2087 % LocalWords:  OBC obc CCMA tol pbc xyz barostat pcoupl acc gpu PLUGIN Cmake GX
2088 % LocalWords:  MSVC gcc installpath cmake DGMX DCMAKE functionalities GPGPU GTS
2089 % LocalWords:  OpenCL DeviceID gromacs gpus html GeForce Quadro FX Plex CX GF
2090 % LocalWords:  VMD DCD GROningen MAchine BIOSON Groningen der Spoel Drunen Comp
2091 % LocalWords:  Phys Comm moltype intramol vdw Waals fep multivector pf
2092 % LocalWords:  pymbar dhdl xvg LINCS Entropic entropic solutes ref com iso pm
2093 % LocalWords:  rm prefactors equipotential potiso potisopf potpm trr
2094 % LocalWords:  potrm potrmpf midplanes midplane gaussians potflex vars massw av
2095 % LocalWords:  shure observables rccccccc vec eps dist min eqn transl nstsout
2096 % LocalWords:  nstrout rotangles rotslabs rottorque RMSD rmsdfit excl NH amine
2097 % LocalWords:  positionrestraint es SH phenylalanine solvated sh nanometer QM
2098 % LocalWords:  Lennard Buckingham UK Svensson ab vsitetop co UHF MP interatomic
2099 % LocalWords:  cg grp coords SPC userpot
2100 % LocalWords:  itp sitesn atomtypes ff csg ndx Tesla CHARMM AA gauss
2101 % LocalWords:  CMAP nocmap fators Monte performant lib LD DIR llllcc
2102 % LocalWords:  CMake homepage DEV overclocking GT dlopen vmd VMDDIR
2103 % LocalWords:  versa PME atomperatom graining forcefields hy spc OPLS
2104 % LocalWords:  topol multi