Stillinger-Weber silicon (1985) ------------------------------- ``StillingerWeberSi`` (``PotType::SWSi1985``) evaluates the silicon potential of F. H. Stillinger and T. A. Weber, Phys. Rev. B 31, 5262 (1985), https://doi.org/10.1103/PhysRevB.31.5262. The two-body and three-body parameters are equation (2.7). Sigma is 0.20951 nm. Epsilon is the value equation (2.9) prints, 3.4723e-12 erg per atom pair. With 1 erg = 1e-7 J and the CODATA electron-volt (1.602176634e-19 J) that is 2.16723920 eV. ``PotType::SWSi``, the Fortran ``SWPot`` kernel, is not this potential. It uses eOn's rescaled epsilon, 2.16826 × 1.06767385 = 2.3149945 eV. The ratio of that epsilon to the published value is 1.068176741337. The product is copied from ``client/potentials/SW/SWFortran.f90`` in TheochemUI/eOn. The file header says "Last change: AA 3 Apr 2002", and the same lines are present at tags ``svn-Dec16_2020`` and ``v2.8.0``: :: EPSILON = 2.16826D0 * 1.06767385d0, & !* 1.07d0 LAMBDA = 21.0d0, & !* 1.07d0 Lambda stays 21 and is not multiplied. Neither that file nor the rgpot port (commit 7a3b5016, per ``rgpot_sw.f90``) derives 1.06767385. The factor is untraced. Calls ~~~~~ Lengths are Angstrom and the energy is eV. The cell is periodic in each direction. ``forceImpl`` writes the force, which is minus the gradient. ``energyAndGradient`` writes the energy and dE/dx for one configuration. ``energyAndGradientBatch`` writes both for several configurations that share one cell and one species list, so a caller enters the library once per batch. The Python method ``energy_gradient`` accepts positions of shape ``(n_atoms, 3)`` or ``(n_config, n_atoms, 3)`` and uses that entry. Every call takes its pairs from the instance's shared neighbour layer (``nlist::updateCells``). The skin is that of a ``nlist::NeighborList`` passed to ``energyAndGradient`` when it is positive. Otherwise it is one fifth of the cutoff, or 0 under ``setNeighbourMode(nlist::Mode::Stream)``. The pairs are reused while every atom has moved by at most half the skin and the cell and the atom count are unchanged. With skin 0 they are reused only for identical coordinates. ``energyAndGradientBatch`` passes no ``nlist::NeighborList``. Stress ~~~~~~ ``forceImpl`` writes the Cauchy stress, sets ``has_stress``, and ``caps().stress`` is true. The convention is the one of ``LJPot``, ``MorsePot`` and ``ZBLPot``, set in ``stress.hpp``. The stress is sigma = dE/dε / V for the strain that sends every position and every cell row r to r (I + ε). It is row-major and symmetric, in eV/Angstrom\ :sup:`3`\. A compressed cell has negative diagonal entries, the sign ASE uses. For the LAMMPS virial W, sigma = -W / V. The virial adds d ⊗ g for the folded bond vector d of each pair term and for both bonds of each three-body term, where g is the energy gradient with respect to d. That sum is the many-body virial of Thompson, Plimpton and Mattson, J. Chem. Phys. 131, 154107 (2009), https://doi.org/10.1063/1.3245303. ``energyAndGradient`` and the batch call skip the virial. ``SWSiTest`` checks all nine entries against a fourth-order central difference of the energy in the strain, step 2e-4. The cells are compressed cubic diamond, a sheared diamond cell and a rattled cubic cell. The tolerance is 5e-10 eV/Angstrom\ :sup:`3`\. The Fortran ``SWPot`` writes the same stress from the folded vectors of its own neighbour table, and its ``caps().stress`` is true. Both kernels are linear in epsilon, so the ``SWPot`` stress is the ``StillingerWeberSi`` stress times 1.068176741337. ``FortranPotsTest`` checks that ratio to 1e-14 eV/Angstrom\ :sup:`3`\, and the strain difference to 5e-10, on a compressed cubic cell and a sheared, rattled cell. ``SWPot::forceBatch``, the call eOn's engine makes, skips the virial, and its outputs have ``has_stress`` 0 and a zero tensor. ``FortranPotsTest`` checks that its energies and forces equal those of ``forceImpl``. In Python, ``evaluate`` on ``StillingerWeberSi`` or ``SWPot`` returns the stress as a 3 × 3 array, and ``caps()`` reports it. ``RgpotCalculator`` then gives the ASE stress for either potential. Diamond energy ~~~~~~~~~~~~~~ At the tetrahedral angle the three-body term is zero, and the diamond minimum puts every nearest neighbour at the minimum of the pair term, where that term equals -1. Each atom then has two bonds, so the energy per atom is -2 epsilon. Equation (2.8) prints -1.999993 epsilon for the lattice sum at the density quoted there. ``SWSiTest`` checks both figures, and checks the analytic gradient against a finite difference.