spin_wall
This optional model nep_spin keyword penalizes magnetic moment magnitudes
below a lower threshold or above an upper threshold. Both walls are off by
default for new training.
Automatic thresholds
In training, either side can use auto <margin> <stiffness> in place of its
numeric pair. The margin is non-negative and in \(\mu_B\).
spin_wall auto 0.2 1.5 auto 0.5 2.0
For each selected element, the lower threshold is the smallest moment
magnitude in train.xyz minus the lower margin. The upper threshold is the
largest magnitude plus the upper margin. For a training range of 1.5 to
3.0 \(\mu_B\), the example gives thresholds of 1.3 and 3.5 \(\mu_B\).
An automatic wall is disabled if the element has no training atoms or the
calculated threshold is nonpositive. The threshold order is checked after
resolving the automatic values.
Per-element parameters
Give one group per element in type order. Each side can be numeric or
use auto. For an element excluded by spin_type, supply 0 0 0 0.
Use a single spin_wall line in nep.in.
type 3 Fe Co O
spin_type Fe Co
spin_wall auto 0.2 1.5 3.5 2.0 0 0 auto 0.5 1.0 0 0 0 0
Fe has an automatic lower wall and a numeric upper wall. Co has only an automatic upper wall. O has no walls.
Energy and magnetic force
For magnitude \(s = |\mathbf{S}|\), the energies are
Each energy is zero outside its stated interval. The corresponding magnetic forces are
Here \(\mathbf{F}_S=-\partial E/\partial\mathbf{S}\). The total wall energy and magnetic force are the sums of the enabled high and low terms. Both forces are purely longitudinal. At exactly zero moment, the lower-wall force is defined as zero. The walls do not directly contribute to atomic forces, virials, or spin torque. A wall is a soft energy penalty, not a hard bound or a thermostat.
Model files, prediction, and restart
When any wall is enabled, nep.txt stores one spin_wall line with four
numbers per element in type order, lower pair first. Disabled sides are
written as 0 0. MD uses the resolved values from the potential file.
Prediction uses the model values when spin_wall is omitted from
nep.in. A numeric spin_wall line overrides both sides. Use
spin_wall 0 0 0 0 to disable all walls for prediction.
Restart uses the resolved values saved in the model. An auto side with
positive stiffness reuses its saved values. Explicit numeric values and
disabled sides must agree with the saved model.