<p>Style <em>table</em> creates interpolation tables from potential energy and
force values listed in a file(s) as a function of distance. When
performing dynamics or minimation, the interpolation tables are used
to evaluate energy and forces for pairwise interactions between
particles, similar to how analytic formulas are used for other pair
styles.</p>
<p>The interpolation tables are created as a pre-computation by fitting
cubic splines to the file values and interpolating energy and force
values at each of <em>N</em> distances. During a simulation, the tables are
used to interpolate energy and force values as needed for each pair of
particles separated by a distance <em>R</em>. The interpolation is done in
one of 4 styles: <em>lookup</em>, <em>linear</em>, <em>spline</em>, or <em>bitmap</em>.</p>
<p>For the <em>lookup</em> style, the distance <em>R</em> is used to find the nearest
table entry, which is the energy or force.</p>
<p>For the <em>linear</em> style, the distance <em>R</em> is used to find the 2
surrounding table values from which an energy or force is computed by
linear interpolation.</p>
<p>For the <em>spline</em> style, a cubic spline coefficients are computed and
stored for each of the <em>N</em> values in the table, one set of splines for
energy, another for force. Note that these splines are different than
the ones used to pre-compute the <em>N</em> values. Those splines were fit
to the <em>Nfile</em> values in the tabulated file, where often <em>Nfile</em><
<em>N</em>. The distance <em>R</em> is used to find the appropriate set of spline
coefficients which are used to evaluate a cubic polynomial which
computes the energy or force.</p>
<p>For the <em>bitmap</em> style, the specified <em>N</em> is used to create
interpolation tables that are 2^N in length. The distance <em>R</em> is used
to index into the table via a fast bit-mapping technique due to
<aclass="reference internal"href="pair_table_rx.html#wolff"><spanclass="std std-ref">(Wolff)</span></a>, and a linear interpolation is performed between
adjacent table values.</p>
<p>The following coefficients must be defined for each pair of atoms
types via the <aclass="reference internal"href="pair_coeff.html"><spanclass="doc">pair_coeff</span></a> command as in the examples
above.</p>
<ulclass="simple">
<li>filename</li>
<li>keyword</li>
<li>cutoff (distance units)</li>
</ul>
<p>The filename specifies a file containing tabulated energy and force
values. The keyword specifies a section of the file. The cutoff is
an optional coefficient. If not specified, the outer cutoff in the
table itself (see below) will be used to build an interpolation table
that extend to the largest tabulated distance. If specified, only
file values up to the cutoff are used to create the interpolation
table. The format of this file is described below.</p>
<p>If your tabulated potential(s) are designed to be used as the
short-range part of one of the long-range solvers specified by the
<aclass="reference internal"href="kspace_style.html"><spanclass="doc">kspace_style</span></a> command, then you must use one or
more of the optional keywords listed above for the pair_style command.
These are <em>ewald</em> or <em>pppm</em> or <em>msm</em> or <em>dispersion</em> or <em>tip4p</em>. This
is so LAMMPS can insure the short-range potential and long-range
solver are compatible with each other, as it does for other
short-range pair styles, such as <aclass="reference internal"href="pair_lj.html"><spanclass="doc">pair_style lj/cut/coul/long</span></a>. Note that it is up to you to insure
the tabulated values for each pair of atom types has the correct
functional form to be compatible with the matching long-range solver.</p>
<hrclass="docutils"/>
<p>Here are some guidelines for using the pair_style table command to
best effect:</p>
<ulclass="simple">
<li>Vary the number of table points; you may need to use more than you think
to get good resolution.</li>
<li>Always use the <aclass="reference internal"href="pair_write.html"><spanclass="doc">pair_write</span></a> command to produce a plot
of what the final interpolated potential looks like. This can show up
interpolation “features” you may not like.</li>
<li>Start with the linear style; it’s the style least likely to have problems.</li>
<li>Use <em>N</em> in the pair_style command equal to the “N” in the tabulation
file, and use the “RSQ” or “BITMAP” parameter, so additional interpolation
is not needed. See discussion below.</li>
<li>Make sure that your tabulated forces and tabulated energies are
consistent (dE/dr = -F) over the entire range of r values. LAMMPS
will warn if this is not the case.</li>
<li>Use as large an inner cutoff as possible. This avoids fitting splines
to very steep parts of the potential.</li>
</ul>
<hrclass="docutils"/>
<p>The format of a tabulated file is a series of one or more sections,
defined as follows (without the parenthesized comments):</p>
<divclass="highlight-default"><divclass="highlight"><pre><span></span><spanclass="c1"># Morse potential for Fe (one or more comment or blank lines)</span>
Built with <ahref="http://sphinx-doc.org/">Sphinx</a> using a <ahref="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <ahref="https://readthedocs.org">Read the Docs</a>.