minimize (Spin FIRE)
Relax magnetic moments using FIRE minimization, optionally together with atomic
positions and the cell. A Spin potential and spin:R:3 in model.xyz are
required.
Syntax
minimize spin_fire <tolerance> <maximal_number_of_steps> <variable_magnitude> [<fixed_atoms> [<box_change> [<hydrostatic_strain>]]]
Parameters
toleranceRequired finite positive force tolerance. The maximum per-atom magnetic-force vector norm must not exceed it, in eV/muB. With fixed spin magnitudes, only the tangent component is tested; with variable magnitudes, the full magnetic force is tested.
maximal_number_of_stepsRequired positive integer iteration budget. Attempts that reset velocities or reject nonfinite trial states also count toward this budget.
variable_magnitudeRequired integer flag,
0or1.0preserves each initial spin magnitude and optimizes directions; zero moments remain zero.1allows both directions and magnitudes to change, including growth from zero.fixed_atomsInteger flag,
0or1; default1.1fixes atoms and the cell.0enables atomic relaxation. The largest absolute atomic-force component must then also be at mosttolerance, in eV/angstrom. The same numerical tolerance is applied separately in the two force units.box_changeInteger flag,
0or1; default0.1enables zero-pressure cell relaxation and requiresfixed_atoms = 0and periodic boundaries in all three directions. The largest absolute active virial-stress component must additionally be at most1e-4 GPa.hydrostatic_strainInteger flag,
0or1; default0.0allows general cell deformation.1allows only isotropic scaling, preserving the cell shape, and requiresbox_change = 1. In this mode, the stress convergence test uses the mean normal stress; shear and deviatoric stresses need not vanish.
The optional flags are positional. Supply preceding flags when setting a later one. The three required parameters have no defaults.
Output
The log reports progress using spin_fire step, including energy in eV,
max_mforce in eV/muB and the internal FIRE step dt. For joint relaxation,
it also reports max_force in eV/angstrom and max_stress_GPa. Stress is
reported at fixed cell but is not a convergence criterion there. FIRE’s dt
is an optimization parameter and is unrelated to the MD time_step.
The final Spin FIRE finished: line reports one of these states:
convergedEvery active magnetic-force, atomic-force and cell-stress criterion has been satisfied. Inspect the final residuals to confirm the requested accuracy.
maximum_stepsThe iteration budget was exhausted before convergence. Inspect the residuals and, if they are still improving, increase the budget or continue from the resulting configuration. This state does not mean convergence.
stalledThe optimizer could no longer make resolved progress. The
stagnationfield identifies a step-size floor, unresolved updates or lack of residual improvement. Check the residuals, the initial configuration and the model’s force precision. Increasing the iteration budget alone may not help; change the starting state or revise tolerances only if the intended physical accuracy permits it. This state does not mean convergence.
The final line also counts velocity resets (power_resets) and rejected
nonfinite trials (nonfinite_retries). A nonfinite initial state is an error.
Nonfinite trial states are rejected and retried with a smaller optimization
step.
Examples
Optimize spin directions with fixed magnitudes and fixed atoms:
minimize spin_fire 1.0e-4 10000 0
Optimize directions and magnitudes with fixed atoms:
minimize spin_fire 1.0e-4 10000 1
Relax atoms and variable-magnitude spins at fixed cell:
minimize spin_fire 1.0e-4 20000 1 0
Relax atoms, variable-magnitude spins and the cell:
minimize spin_fire 1.0e-4 20000 1 0 1
Allow only isotropic cell scaling during joint relaxation:
minimize spin_fire 1.0e-4 20000 1 0 1 1
Write the optimized configuration and magnetic moments:
potential nep.txt
minimize spin_fire 1.0e-4 20000 1 0 1
ensemble nve
time_step 0
dump_xyz 1 relaxed.xyz precision double force spin mforce virial
run 1
Notes
Individual steps may increase the energy. Force convergence identifies a stationary point, not necessarily the global minimum or a particular phase.
Variable-magnitude and joint relaxation require a potential fitted over the relevant moments, atomic configurations and cell deformations.
Atomic velocities and physical spin velocities (
spin_vel) are preserved.Joint relaxation does not support
fixgroups. In spin-only mode,fixdoes not select frozen spins.External fields from
add_mfieldapply to MD runs and do not participate in Spin FIRE minimization.Ordinary
minimize fireis a lattice-only command for non-Spin potentials.