Spin FIRE
Syntax
For a Spin potential, use:
minimize spin_fire <tolerance> <maximal_number_of_steps> <variable_magnitude> [<fixed_atoms> [<box_change> [<hydrostatic_strain>]]]
variable_magnitude = 0preserves each atom’s initial spin magnitude;1optimizes all three Cartesian spin components. Zero spins remain zero in mode0and can grow in mode1.fixed_atomsdefaults to1: atomic positions and the cell stay fixed, and only spins are optimized. Set it to0to enable atomic relaxation.box_changedefaults to0(fixed cell). Set it to1to jointly optimize atoms, spins, and the cell; this requiresfixed_atoms = 0.hydrostatic_straindefaults to0(all nine deformation components). Set it to1to apply only isotropic scaling, preserving the cell shape. It requiresbox_change = 1. The two cell flags have the same meanings as in ordinary FIRE, and follow the spin-magnitude and fixed-atom flags here.Optional flags are positional:
fixed_atoms, thenbox_change, thenhydrostatic_strain. Supply preceding flags when setting a later one.tolerancemust be finite and positive. The maximum per-atom magnetic-force vector norm must be at most this value in eV/muB. Mode0tests only the component tangent to each constant-magnitude sphere; mode1tests the full magnetic force.When atoms are optimized, their largest absolute force component must also be at most
tolerancein eV/angstrom, as in ordinary FIRE. Thus one numeric tolerance is applied separately to atomic and magnetic forces, in their respective units.When the cell is optimized, the largest absolute virial stress component must additionally be at most
1e-4 GPa, the same zero-pressure target as ordinary FIRE. Withhydrostatic_strain = 1, only the mean normal stress is tested; shear and deviatoric stresses need not vanish.maximal_number_of_stepsis a positive iteration budget. All attempts count, including velocity resets and non-finite trial states.
Examples
Optimize only spin directions, keeping magnitudes, atoms, and the cell fixed:
minimize spin_fire 1.0e-4 10000 0
Optimize only spins, allowing their magnitudes to change:
minimize spin_fire 1.0e-4 10000 1
The same spin-only optimization with atoms explicitly fixed:
minimize spin_fire 1.0e-4 10000 1 1
Jointly optimize atoms and variable-magnitude spins at fixed cell:
minimize spin_fire 1.0e-4 20000 1 0
Jointly optimize atoms, variable-magnitude spins, and the cell:
minimize spin_fire 1.0e-4 20000 1 0 1
Keep spin magnitudes fixed during joint optimization:
minimize spin_fire 1.0e-4 20000 0 0 1
Allow only isotropic cell scaling during joint optimization:
minimize spin_fire 1.0e-4 20000 1 0 1 1
Write the optimized structure and magnetic moments using the same zero-time-step output procedure as ordinary FIRE:
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
Caveats
A Spin potential and
spin:R:3inmodel.xyzare required. Ordinaryminimize fireremains a lattice-only command and is not enabled for Spin potentials.Cell optimization requires periodic boundaries in all three directions. Joint optimization does not support
fixgroups and rejects them; in spin-only mode,fixdoes not select frozen spins.Atomic velocities and physical
spin_velare preserved. FIRE uses separate fictitious velocities. After joint optimization, positions, cell inverses, periodic images, and endpoint forces are updated for subsequent commands.External magnetic fields do not participate in Spin FIRE minimization.
add_mfieldapplies only to MD runs.Output reports energy, maximum magnetic-force residual, and (for joint runs) maximum atomic force and virial stress in GPa (mean normal stress in the hydrostatic case). At fixed cell, stress is reported but is not a stopping criterion. Only
convergedmeans all active criteria have been met.maximum_stepsandstalleddo not indicate convergence.Individual FIRE steps can increase the energy. Force convergence identifies a stationary point, not necessarily the global minimum or a particular phase. Variable-magnitude optimization requires a potential fitted over the relevant range of moments, atomic configurations, and cell deformations.
Algorithm and stagnation
The dot product of the generalized force and fictitious velocity controls FIRE’s step size and velocity resets. Energy is diagnostic; a constant energy offset does not change the optimization. Non-finite trials restore spins, positions, cell, and endpoint properties before retrying with a smaller step.
Fixed-magnitude spins use spherical updates with parallel transport of fictitious velocities; variable-magnitude spins use Cartesian updates. Each spin move is limited to 0.1 radians or 0.1 muB. Joint runs also limit each non-affine atomic move to 0.1 angstrom and the Frobenius norm of each cell deformation increment to 0.01. Cell coordinates use the initial cube-root volume as a length scale, as in ordinary cell FIRE. Cell deformation acts on both the cell and atomic positions; spins stay in laboratory Cartesian coordinates during this affine part of the update. The full virial transpose supplies the conjugate deformation force, including nonsymmetric components from spin-orbit interactions.
Stagnation is reported if the internal step drops below 1e-12, if 20 finite moves
produce no resolved update (8 double epsilons relative to the component scale
max(1, abs(old), abs(new))), or if 1000 attempts pass without a cumulative 1%
improvement in the largest residual divided by its convergence tolerance. Joint
runs include atomic, magnetic, and active stress residuals. The plateau detector
may stop very slow relaxation; inspect the residuals before restarting. None of
these conditions relaxes the requested convergence criteria. The internal FIRE
step is an optimization parameter, not the MD time_step.