commands. The replica-specific names of these files can be specified
as in the discussion above for the <em>each</em> file-style. Also see the
section below for how a NEB calculation can produce restart files, so
that a long calculation can be restarted if needed.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">None of the <em>file-style</em> settings change the initial
configuration of any atom in the first replica. The first replica
must thus be in the correct initial configuration at the time the neb
command is issued.</p>
</div>
<hr class="docutils" />
<p>A NEB calculation proceeds in two stages, each of which is a
minimization procedure, performed via damped dynamics. To enable
this, you must first define a damped dynamics
<a class="reference internal" href="min_style.html"><span class="doc">min_style</span></a>, such as <em>quickmin</em> or <em>fire</em>. The <em>cg</em>,
<em>sd</em>, and <em>hftn</em> styles cannot be used, since they perform iterative
line searches in their inner loop, which cannot be easily synchronized
across multiple replicas.</p>
<p>The minimizer tolerances for energy and force are set by <em>etol</em> and
<em>ftol</em>, the same as for the <a class="reference internal" href="minimize.html"><span class="doc">minimize</span></a> command.</p>
<p>A non-zero <em>etol</em> means that the NEB calculation will terminate if the
energy criterion is met by every replica. The energies being compared
to <em>etol</em> do not include any contribution from the inter-replica
forces, since these are non-conservative. A non-zero <em>ftol</em> means
that the NEB calculation will terminate if the force criterion is met
by every replica. The forces being compared to <em>ftol</em> include the
inter-replica forces between an atom and its images in adjacent
replicas.</p>
<p>The maximum number of iterations in each stage is set by <em>N1</em> and
<em>N2</em>. These are effectively timestep counts since each iteration of
damped dynamics is like a single timestep in a dynamics
<a class="reference internal" href="run.html"><span class="doc">run</span></a>. During both stages, the potential energy of each
replica and its normalized distance along the reaction path (reaction
coordinate RD) will be printed to the screen and log file every
<em>Nevery</em> timesteps. The RD is 0 and 1 for the first and last replica.
For intermediate replicas, it is the cumulative distance (normalized
by the total cumulative distance) between adjacent replicas, where
“distance” is defined as the length of the 3N-vector of differences in
atomic coordinates, where N is the number of NEB atoms involved in the
transition. These outputs allow you to monitor NEB’s progress in
finding a good energy barrier. <em>N1</em> and <em>N2</em> must both be multiples
of <em>Nevery</em>.</p>
<p>In the first stage of NEB, the set of replicas should converge toward
the minimum energy path (MEP) of conformational states that transition
over the barrier. The MEP for a barrier is defined as a sequence of
3N-dimensional states that cross the barrier at its saddle point, each
of which has a potential energy gradient parallel to the MEP itself.
The replica states will also be roughly equally spaced along the MEP
due to the inter-replica spring force added by the <a class="reference internal" href="fix_neb.html"><span class="doc">fix neb</span></a> command.</p>
<p>In the second stage of NEB, the replica with the highest energy
is selected and the inter-replica forces on it are converted to a
force that drives its atom coordinates to the top or saddle point of
the barrier, via the barrier-climbing calculation described in
<a class="reference internal" href="#henkelman2"><span class="std std-ref">(Henkelman2)</span></a>. As before, the other replicas rearrange
themselves along the MEP so as to be roughly equally spaced.</p>
<p>When both stages are complete, if the NEB calculation was successful,
one of the replicas should be an atomic configuration at the top or
saddle point of the barrier, the potential energies for the set of
replicas should represent the energy profile of the barrier along the
MEP, and the configurations of the replicas should be a sequence of
configurations along the MEP.</p>
<hr class="docutils" />
<p>A few other settings in your input script are required or advised to
perform a NEB calculation. See the NOTE about the choice of timestep
at the beginning of this doc page.</p>
<p>An atom map must be defined which it is not by default for <a class="reference internal" href="atom_style.html"><span class="doc">atom_style atomic</span></a> problems. The <a class="reference internal" href="atom_modify.html"><span class="doc">atom_modify map</span></a> command can be used to do this.</p>
<p>The “atom_modify sort 0 0.0” command should be used to turn off atom
sorting.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This sorting restriction will be removed in a future version of
NEB in LAMMPS.</p>
</div>
<p>The minimizers in LAMMPS operate on all atoms in your system, even
non-NEB atoms, as defined above. To prevent non-NEB atoms from moving
during the minimization, you should use the <a class="reference internal" href="fix_setforce.html"><span class="doc">fix setforce</span></a> command to set the force on each of those
atoms to 0.0. This is not required, and may not even be desired in
some cases, but if those atoms move too far (e.g. because the initial
state of your system was not well-minimized), it can cause problems
for the NEB procedure.</p>
<p>The damped dynamics <a class="reference internal" href="min_style.html"><span class="doc">minimizers</span></a>, such as <em>quickmin</em>
and <em>fire</em>), adjust the position and velocity of the atoms via an
Euler integration step. Thus you must define an appropriate
<a class="reference internal" href="timestep.html"><span class="doc">timestep</span></a> to use with NEB. As mentioned above, NEB
will often converge more quickly if you use a timestep about 10x
larger than you would normally use for dynamics simulations.</p>
<hr class="docutils" />
<p>Each file read by the neb command containing atomic coordinates used
to initialize one or more replicas must be formatted as follows.</p>
<p>The file can be ASCII text or a gzipped text file (detected by a .gz
suffix). The file can contain initial blank lines or comment lines
starting with “#” which are ignored. The first non-blank, non-comment
line should list N = the number of lines to follow. The N successive
<p>The fields are the the atom ID, followed by the x,y,z coordinates.
The lines can be listed in any order. Additional trailing information
on the line is OK, such as a comment.</p>
<p>Note that for a typical NEB calculation you do not need to specify
initial coordinates for very many atoms to produce differing starting
and final replicas whose intermediate replicas will converge to the
energy barrier. Typically only new coordinates for atoms
geometrically near the barrier need be specified.</p>
<p>Also note there is no requirement that the atoms in the file
correspond to the NEB atoms in the group defined by the <a class="reference internal" href="fix_neb.html"><span class="doc">fix neb</span></a> command. Not every NEB atom need be in the file,
and non-NEB atoms can be listed in the file.</p>
<hr class="docutils" />
<p>Four kinds of output can be generated during a NEB calculation: energy
barrier statistics, thermodynamic output by each replica, dump files,
and restart files.</p>
<p>When running with multiple partitions (each of which is a replica in
this case), the print-out to the screen and master log.lammps file
contains a line of output, printed once every <em>Nevery</em> timesteps. It
contains the timestep, the maximum force per replica, the maximum
force per atom (in any replica), potential gradients in the initial,</p>
<blockquote>
<div>final, and climbing replicas,</div></blockquote>
<p>the forward and backward energy barriers,
the total reaction coordinate (RDT), and
the normalized reaction coordinate and potential energy of each replica.</p>
<p>The “maximum force per replica” is
the two-norm of the 3N-length force vector for the atoms in each
replica, maximized across replicas, which is what the <em>ftol</em> setting
is checking against. In this case, N is all the atoms in each
replica. The “maximum force per atom” is the maximum force component
of any atom in any replica. The potential gradients are the two-norm
of the 3N-length force vector solely due to the interaction potential i.e.
without adding in inter-replica forces. Note that inter-replica forces
are zero in the initial and final replicas, and only affect
the direction in the climbing replica. For this reason, the “maximum
force per replica” is often equal to the potential gradient in the
climbing replica. In the first stage of NEB, there is no climbing
replica, and so the potential gradient in the highest energy replica
is reported, since this replica will become the climbing replica
in the second stage of NEB.</p>
<p>The “reaction coordinate” (RD) for each
replica is the two-norm of the 3N-length vector of distances between
its atoms and the preceding replica’s atoms, added to the RD of the
preceding replica. The RD of the first replica RD1 = 0.0;
the RD of the final replica RDN = RDT, the total reaction coordinate.
The normalized RDs are divided by RDT,
so that they form a monotonically increasing sequence
from zero to one. When computing RD, N only includes the atoms
being operated on by the fix neb command.</p>
<p>The forward (reverse) energy barrier is the potential energy of the highest
replica minus the energy of the first (last) replica.</p>
<p>When running on multiple partitions, LAMMPS produces additional log
files for each partition, e.g. log.lammps.0, log.lammps.1, etc. For a
NEB calculation, these contain the thermodynamic output for each
replica.</p>
<p>If <a class="reference internal" href="dump.html"><span class="doc">dump</span></a> commands in the input script define a filename
that includes a <em>universe</em> or <em>uloop</em> style <a class="reference internal" href="variable.html"><span class="doc">variable</span></a>,
then one dump file (per dump command) will be created for each
replica. At the end of the NEB calculation, the final snapshot in
each file will contain the sequence of snapshots that transition the
system over the energy barrier. Earlier snapshots will show the
convergence of the replicas to the MEP.</p>
<p>Likewise, <a class="reference internal" href="restart.html"><span class="doc">restart</span></a> filenames can be specified with a
<em>universe</em> or <em>uloop</em> style <a class="reference internal" href="variable.html"><span class="doc">variable</span></a>, to generate
restart files for each replica. These may be useful if the NEB
calculation fails to converge properly to the MEP, and you wish to
restart the calculation from an intermediate point with altered
parameters.</p>
<p>There are 2 Python scripts provided in the tools/python directory,
neb_combine.py and neb_final.py, which are useful in analyzing output
from a NEB calculation. Assume a NEB simulation with M replicas, and
the NEB atoms labelled with a specific atom type.</p>
<p>The neb_combine.py script extracts atom coords for the NEB atoms from
all M dump files and creates a single dump file where each snapshot
contains the NEB atoms from all the replicas and one copy of non-NEB
atoms from the first replica (presumed to be identical in other
replicas). This can be visualized/animated to see how the NEB atoms
relax as the NEB calculation proceeds.</p>
<p>The neb_final.py script extracts the final snapshot from each of the M
dump files to create a single dump file with M snapshots. This can be
visualized to watch the system make its transition over the energy
barrier.</p>
<p>To illustrate, here are images from the final snapshot produced by the
neb_combine.py script run on the dump files produced by the two
example input scripts in examples/neb. Click on them to see a larger
image.</p>
<a class=""
data-lightbox="group-default"
href="_images/hop1.jpg"
title=""
data-title=""
><img src="_images/hop1.jpg"
class=""
width="25%"
height="auto"
alt=""/>
</a><a class=""
data-lightbox="group-default"
href="_images/hop2.jpg"
title=""
data-title=""
><img src="_images/hop2.jpg"
class=""
width="25%"
height="auto"
alt=""/>
</a></div>
<hr class="docutils" />
<div class="section" id="restrictions">
<h2>Restrictions</h2>
<p>This command can only be used if LAMMPS was built with the REPLICA
package. See the <a class="reference internal" href="Section_start.html#start-3"><span class="std std-ref">Making LAMMPS</span></a> section
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.