<p>On the left, the red and blue chains have two monomers A1 and B1 close
to each other, which are currently bonded to monomers A2 and B2
respectively within their own chains. The bond swap operation will
attempt to delete the A1-A2 and B1-B2 bonds and replace them with
A1-B2 and B1-A2 bonds. If the swap is energetically favorable, the
two chains on the right are the result and each polymer chain has
undergone a dramatic conformational change. This reference,
<aclass="reference internal"href="#sides"><spanclass="std std-ref">(Sides)</span></a> provides more details on how the algorithm works and
its application:</p>
<p>The bond swapping operation is invoked every <em>Nevery</em> timesteps. If
any bond is swapped, a re-build of the neighbor lists is triggered,
since a swap alters the list of which neighbors are considered for
pairwise interaction. At each invocation, each processor considers a
random specified <em>fraction</em> of its atoms as potential swapping
monomers for this timestep. Choosing a small <em>fraction</em> value can
reduce the likelihood of a reverse swap occurring soon after an
initial swap.</p>
<p>For each monomer A1, its neighbors are examined to find a possible B1
monomer. Both A1 and B1 must be in the fix group, their separation
must be less than the specified <em>cutoff</em>, and the molecule IDs of A1
and B1 must be the same (see below). If a suitable partner is found,
the energy change due to swapping the 2 bonds is computed. This
includes changes in pairwise, bond, and angle energies due to the
altered connectivity of the 2 chains. Dihedral and improper
interactions are not allowed to be defined when this fix is used.</p>
<p>If the energy decreases due to the swap operation, the bond swap is
accepted. If the energy increases it is accepted with probability
exp(-delta/kT) where delta is the increase in energy, k is the
Boltzmann constant, and T is the current temperature of the system.
Whether the swap is accepted or rejected, no other swaps are attempted
by this processor on this timestep.</p>
<p>The criterion for matching molecule IDs is how bond swaps performed by
this fix conserve chain length. To use this features you must setup
the molecule IDs for your polymer chains in a certain way, typically
in the data file, read by the <aclass="reference internal"href="read_data.html"><spanclass="doc">read_data</span></a> comand.
Consider a system of 6-mer chains. You have 2 choices. If the
molecule IDs for monomers on each chain are set to 1,2,3,4,5,6 then
swaps will conserve chain length. For a particular momoner there will
be only one other monomer on another chain which is a potential swap
partner. If the molecule IDs for monomers on each chain are set to
1,2,3,3,2,1 then swaps will conserve chain length but swaps will be
able to occur at either end of a chain. Thus for a particular monomer
there will be 2 possible swap partners on another chain. In this
scenario, swaps can also occur within a single chain, i.e. the two
ends of a chain swap with each other.</p>
<divclass="admonition note">
<pclass="first admonition-title">Note</p>
<pclass="last">If your simulation uses molecule IDs in the usual way, where all
monomers on a single chain are assigned the same ID (different for
each chain), then swaps will only occur within the same chain. If you
assign the same molecule ID to all monomers in all chains then
inter-chain swaps will occur, but they will not conserve chain length.
Neither of these scenarios is probably what you want for this fix.</p>
</div>
<divclass="admonition note">
<pclass="first admonition-title">Note</p>
<pclass="last">When a bond swap occurs the image flags of monomers in the new
polymer chains can become inconsistent. See the <aclass="reference internal"href="dump.html"><spanclass="doc">dump</span></a>
command for a discussion of image flags. This is not an issue for
running dynamics, but can affect calculation of some diagnostic
quantities or the printing of unwrapped coordinates to a dump file.</p>
</div>
<hrclass="docutils"/>
<p>This fix computes a temperature each time it is invoked for use by the
Boltzmann criterion. To do this, the fix creates its own compute of
style <em>temp</em>, as if this command had been issued:</p>
<preclass="literal-block">
compute fix-ID_temp all temp
</pre>
<p>See the <aclass="reference internal"href="compute_temp.html"><spanclass="doc">compute temp</span></a> command for details. Note
that the ID of the new compute is the fix-ID with underscore + “temp”
appended and the group for the new compute is “all”, so that the
temperature of the entire system is used.</p>
<p>Note that this is NOT the compute used by thermodynamic output (see
the <aclass="reference internal"href="thermo_style.html"><spanclass="doc">thermo_style</span></a> command) with ID = <em>thermo_temp</em>.
This means you can change the attributes of this fix’s temperature
(e.g. its degrees-of-freedom) via the
<aclass="reference internal"href="compute_modify.html"><spanclass="doc">compute_modify</span></a> command or print this temperature
during thermodyanmic output via the <aclass="reference internal"href="thermo_style.html"><spanclass="doc">thermo_style custom</span></a> command using the appropriate compute-ID.
It also means that changing attributes of <em>thermo_temp</em> will have no
effect on this fix.</p>
<hrclass="docutils"/>
<p><strong>Restart, fix_modify, thermo output, run start/stop, minimize info:</strong></p>
<p>No information about this fix is written to <aclass="reference internal"href="restart.html"><spanclass="doc">binary restart files</span></a>. Because the state of the random number generator
is not saved in restart files, this means you cannot do “exact”
restarts with this fix, where the simulation continues on the same as
if no restart had taken place. However, in a statistical sense, a
restarted simulation should produce the same behavior. Also note that
each processor generates possible swaps independently of other
processors. Thus if you repeat the same simulation on a different number
of processors, the specific swaps performed will be different.</p>
<p>The <aclass="reference internal"href="fix_modify.html"><spanclass="doc">fix_modify</span></a><em>temp</em> option is supported by this
fix. You can use it to assign a <aclass="reference internal"href="compute.html"><spanclass="doc">compute</span></a> you have
defined to this fix which will be used to compute the temperature for
the Boltzmann criterion.</p>
<p>This fix computes two statistical quantities as a global 2-vector of
output, which can be accessed by various <aclass="reference internal"href="Section_howto.html#howto-15"><spanclass="std std-ref">output commands</span></a>. The first component of the
vector is the cummulative number of swaps performed by all processors.
The second component of the vector is the cummulative number of swaps
attempted (whether accepted or rejected). Note that a swap “attempt”
only occurs when swap partners meeting the criteria described above
are found on a particular timestep. The vector values calculated by
this fix are “intensive”.</p>
<p>No parameter of this fix can be used with the <em>start/stop</em> keywords of
the <aclass="reference internal"href="run.html"><spanclass="doc">run</span></a> command. This fix is not invoked during <aclass="reference internal"href="minimize.html"><spanclass="doc">energy minimization</span></a>.</p>
</div>
<divclass="section"id="restrictions">
<h2>Restrictions</h2>
<p>This fix is part of the MC package. It is only enabled if LAMMPS was
built with that package. See the <aclass="reference internal"href="Section_start.html#start-3"><spanclass="std std-ref">Making LAMMPS</span></a> section for more info.</p>
<p>The setings of the “special_bond” command must be 0,1,1 in order to
use this fix, which is typical of bead-spring chains with FENE or
harmonic bonds. This means that pairwise interactions between bonded
atoms are turned off, but are turned on between atoms two or three
hops away along the chain backbone.</p>
<p>Currently, energy changes in dihedral and improper interactions due to
a bond swap are not considered. Thus a simulation that uses this fix
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>.