Definitions and Units#
Notation#
The following conventions for mathematical typesetting are used throughout this document:
Item |
Notation |
Example |
---|---|---|
Vector |
Bold italic |
|
Vector Length |
Italic |
We define the lowercase subscripts
The force on particle
MD units#
GROMACS uses a consistent set of units that produce values in the vicinity of unity for most relevant molecular quantities. Let us call them MD units. The basic units in this system are nm, ps, K, electron charge (e) and atomic mass unit (u), see Table 2 The values used in GROMACS are taken from the CODATA Internationally recommended 2010 values of fundamental physical constants (see NIST homepage).
Quantity |
Symbol |
Unit |
---|---|---|
length |
r |
|
mass |
m |
u (unified atomic mass unit) =
|
time |
t |
|
charge |
q |
e = elementary charge =
|
temperature |
T |
K |
Consistent with these units are a set of derived units, given in Table 3
Quantity |
Symbol |
Unit |
---|---|---|
energy |
||
Force |
||
pressure |
bar |
|
velocity |
||
dipole moment |
||
electric potential |
||
electric field |
The electric conversion factor
Electric potentials
With these definitions,
Note that these units are mutually consistent; changing any of the
units is likely to produce inconsistencies and is therefore strongly
discouraged! In particular: if Å are used instead of nm, the unit of
time changes to 0.1 ps. If
In terms of the MD units, the usual physical constants take on different
values (see Table 4). All quantities are per
mol rather than per molecule. There is no distinction between
Boltzmann’s constant
Symbol |
Name |
Value |
---|---|---|
Avogadro’s number |
||
gas constant |
||
Boltzmann’s constant |
idem |
|
Planck’s constant |
||
Dirac’s constant |
||
velocity of light |
Reduced units#
When simulating Lennard-Jones (LJ) systems, it might be advantageous to
use reduced units (i.e., setting
In Table 5 quantities are given for LJ potentials:
Quantity |
Symbol |
Relation to SI |
---|---|---|
Length |
r |
r |
Mass |
m |
m M |
Time |
t |
t |
Temperature |
T |
k |
Energy |
E |
E |
Force |
F |
F |
Pressure |
P |
P |
Velocity |
v |
v |
Density |
N |
Mixed or Double precision#
GROMACS can be compiled in either mixed or double precision.
Documentation of previous GROMACS versions referred to single
precision, but the implementation has made selective use of double
precision for many years. Using single precision for all variables would
lead to a significant reduction in accuracy. Although in mixed
precision all state vectors, i.e. particle coordinates, velocities and
forces, are stored in single precision, critical variables are double
precision. A typical example of the latter is the virial, which is a sum
over all forces in the system, which have varying signs. In addition, in
many parts of the code we managed to avoid double precision for
arithmetic, by paying attention to summation order or reorganization of
mathematical expressions. The default configuration uses mixed
precision, but it is easy to turn on double precision by adding the
option -DGMX_DOUBLE=on
to cmake
. Double precision will be 20 to 100%
slower than mixed precision depending on the architecture you are
running on. Double precision will use somewhat more memory and run
input, energy and full-precision trajectory files will be almost twice
as large.
The energies in mixed precision are accurate up to the last decimal, the last one or two decimals of the forces are non-significant. The virial is less accurate than the forces, since the virial is only one order of magnitude larger than the size of each element in the sum over all atoms (sec. Virial and pressure). In most cases this is not really a problem, since the fluctuations in the virial can be two orders of magnitude larger than the average. Using cut-offs for the Coulomb interactions cause large errors in the energies, forces, and virial. Even when using a reaction-field or lattice sum method, the errors are larger than, or comparable to, the errors due to the partial use of single precision. Since MD is chaotic, trajectories with very similar starting conditions will diverge rapidly, the divergence is faster in mixed precision than in double precision.
For most simulations, mixed precision is accurate enough. In some cases double precision is required to get reasonable results:
normal mode analysis, for the conjugate gradient or l-bfgs minimization and the calculation and diagonalization of the Hessian
long-term energy conservation, especially for large systems