Tersoff silicon-carbon (1989) ----------------------------- ``TersoffSiC`` is the 1989 silicon, carbon, and silicon-carbide kernel of J. Tersoff, Phys. Rev. B 39, 5566 (1989), https://doi.org/10.1103/PhysRevB.39.5566. The erratum, Phys. Rev. B 41, 3248 (1990), https://doi.org/10.1103/PhysRevB.41.3248.2, sets carbon B to 346.74 eV and d to 4.3484. Carbon beta is 1.5724e-7 and is dimensionless. It is the Table I value in the NIST and LAMMPS transcriptions. The erratum does not print it. ``TersoffSiC`` and the Fortran ``TersoffPot`` both report ``PotType::TersoffSi``. There is no ``PotType::TersoffSiC``. The engine name ``tersoff`` builds ``TersoffPot``. In ``TersoffPot``, an all-silicon configuration and a null species pointer use the Fortran gather, and a call with any atomic number other than 14 uses this kernel. The ``pot_spec`` name ``TersoffSi`` builds ``TersoffSiC`` itself. Calling ``TersoffSiC`` directly always evaluates the 1989 form, including an all-silicon cell, whose silicon column matches that gather. Atomic number 14 is silicon and 6 is carbon. Any other species throws ``std::invalid_argument``. lambda3 is zero for both elements, so the factor exp(lambda3\ :sup:`m`\ (rij - rik)\ :sup:`m`\) is identically one and is not evaluated. The cross term uses chi = 0.9776. The lambdas are arithmetic means and the repulsive amplitude is a geometric mean. The attractive amplitude is chi times the geometric mean. The inner cutoffs and the outer cutoffs are each mixed as geometric means. 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``), searched to the silicon outer cutoff, 3.0 Angstrom, the longest in this set. The skin is that of a ``nlist::NeighborList`` passed to ``energyAndGradient`` when it is positive. Otherwise it is one fifth of that cutoff, 0.6 Angstrom, or 0 under ``setNeighbourMode(nlist::Mode::Stream)``. The pairs are reused while each 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``. Held list on the force path ~~~~~~~~~~~~~~~~~~~~~~~~~~~ By default (held skin 0) ``forceImpl`` keeps no ``nlist::NeighborList`` and uses the skin of the section above. ``setHeldSkin(skin)`` with a positive skin in Angstrom makes the instance keep one ``nlist::NeighborList`` across ``forceImpl`` calls, and that skin replaces the default. The list is rebuilt when any atom has moved by more than half the skin since the last build, or when the cell or the atom count changes. ``setHeldSkin(0)`` drops the list and goes back to the default. A negative or non-finite skin throws ``std::invalid_argument``. ``heldList()`` returns the list, so a caller can see when it was last built. The instance always reports ``Reentrancy::PerInstance``. With a positive held skin it also reports ``perImageInstances``, since a call writes the list. ``TersoffPot::setHeldSkin`` passes the skin to its own 1989 kernel. All-silicon calls through ``TersoffPot`` stay on the Fortran gather, which keeps its own neighbour table (``rgpot_neighbors``) with a skin of 0.3 Angstrom, a tenth of its 3.0 Angstrom cutoff. On the call that builds the list, and on a call with the coordinates of that build, a held list returns the same bits as an instance without one given the same calls. After a move inside the skin the bits also match while every atom stays in its cell of the cutoff-edged grid that orders the pairs. An atom that crosses a cell face keeps the pair order of the last build, so the bonds of a centre can be summed in another order. ``TersoffSiCTest`` bounds that difference by 1e-12 on 512 and 4096 atoms. ``tersoff_held_bench`` reports the largest difference it sees and the time per atom of a rebuild, a held list, and the Fortran gather. Stress ~~~~~~ ``TersoffSiC::forceImpl`` writes the Cauchy stress, sets ``has_stress``, and ``caps().stress`` is true, with or without a held list. 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 each folded bond vector d, where g is the energy gradient with respect to d. Each bond i-j adds its radial term, and each bond i-k in the bond order of i-j adds the angular and cutoff terms of both bonds. 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, and the energy and the forces keep their bits. ``TersoffSiCTest`` checks all nine entries against a fourth-order central difference of the energy in the strain, step 2e-4. The cells are compressed cubic silicon, a sheared silicon cell, and a sheared, rattled silicon carbide cell whose Si-Si pairs sit inside the cutoff taper. The tolerance is 5e-10 eV/Angstrom\ :sup:`3`\. ``TersoffPot`` keeps ``caps().stress`` false, since its all-silicon calls run the Fortran gather, which writes no stress. A call with any other species reaches this kernel, and ``TersoffPot`` then drops its stress. Every ``TersoffPot`` call leaves ``has_stress`` at 0 and the nine entries at zero, so a reused output keeps no tensor from an earlier call. Diamond energies ~~~~~~~~~~~~~~~~ At a0 = 5.432 Angstrom the silicon diamond energy is -4.629595 eV/atom. At a0 = 3.5656 Angstrom the carbon diamond energy is -7.370514 eV/atom. Those are the closed forms of this parameter set at the lattice constants that reproduce the fitted cohesive energies, 4.63 eV and 7.37 eV. ``TersoffSiCTest`` pins both and checks the analytic gradient against a finite difference.