WorksPhysics and Astronomy
MagPot: A magnetoelastic potential generator for molecular dynamics simulations
Abstract
Magnetoelastic phenomena originate from the coupling between atomic displacements and magnetic degrees of freedom, and their atomistic simulation requires interatomic models in which magnetic interactions depend explicitly on interatomic distance. This paper presents MagPot, a Python program that generates Bethe-Slater parameter sets for spin-lattice molecular dynamics simulations using the SPIN package of the Large-scale Atomic/Molecular Massively Parallel Simulator (LAMMPS). From a compact set of material properties, the program determines the radial functions describing Heisenberg exchange and the dipole and quadrupole contributions of the two-ion Néel interaction. Version 1.0 supports simple-cubic, body-centred-cubic and face-centred-cubic lattices with ferromagnetic and antiferromagnetic configurations. A central feature of MagPot is its modular architecture, which allows the magnetic contribution it generates to be combined additively with a broad range of compatible non-magnetic interatomic potentials. The parameterisation workflow is assessed through equation-of-state, Curie-temperature, volume-magnetostriction, pressure-dependent magnetocrystalline-anisotropy and anisotropic-magnetoelastic tests. By automating the construction of the magnetic contribution to the interatomic model, MagPot offers a straightforward and reproducible route from material properties to LAMMPS-ready magnetic interactions, facilitating large-scale atomistic simulations of magnetoelasticity and magnetostriction, as well as physical phenomena associated with magnon-phonon coupling.
*Corresponding author(s). E-mail(s): [email protected]; Keywords: Spin-lattice dynamics; Magnetoelasticity; Bethe-Slater function; Néel model; Molecular dynamics; LAMMPS
Article Highlights
MaGPoT converts material properties into magnetic interaction parameters ready for LAMMPS simulations.
Its modular output can be combined with a wide range of different types of potentials.
Version 1.0 covers three cubic lattices and selected ferromagnetic and antiferromagnetic orders.
Introduction
Magnetoelasticity describes the coupling between the magnetic and mechanical degrees of freedom of a solid. In a magnetic material, changes in the atomic positions modify the interactions between magnetic moments, while changes in the magnetic state can induce lattice deformations. This mutual coupling is at the origin of a broad range of phenomena, including magnetostriction, magnetically induced changes in the elastic response, magnetovolume effects and the coupling between magnons and phonons [1, 2]. These effects are relevant both to fundamental studies of magnetic materials and to applications involving magnetic sensors, actuators, transducers and energy conversion [3]. They can also have a substantial influence on thermomechanical properties, for example through changes in thermal expansion and phonon transport near magnetic phase transitions [4].
Conventional molecular dynamics (MD) describes the motion of the atoms but generally does not include the dynamical evolution of their magnetic moments. Conversely, atomistic spin dynamics describes the magnetic degrees of freedom while the atomic positions are usually fixed or their motion is neglected [5]. These separate descriptions are insufficient for studying magnetoelastic phenomena in which atomic positions and magnetic moments are strongly coupled. Spin–lattice dynamics combines molecular dynamics and atomistic spin dynamics, allowing the atomic positions and magnetic moments to evolve simultaneously [6]. In this framework, the dependence of the magnetic interactions on interatomic distance provides a direct mechanism for coupling the two subsystems. Such an approach is particularly useful for investigating magnetoelastic and magnetocaloric processes over length and time scales that are difficult to access using first-principles molecular dynamics alone.
A practical spin–lattice model must describe not only the non-magnetic interatomic interactions, but also the magnetic interactions and their dependence on the atomic configuration. For cubic crystals, Nieves et al. developed a parametrization based on the Heisenberg exchange interaction and the two-ion Néel model [7]. In that formulation, the distance dependence of the magnetic interactions is represented by Bethe–Slater functions. The exchange function controls the isotropic magnetic interaction and can be parametrized in relation to the magnetic transition temperature and the spontaneous volume magnetostriction. The dipolar and quadrupolar Néel functions, and , describe the magnetoelastic and magnetocrystalline-anisotropy contributions associated with spin–orbit coupling. Analytical relations were derived to connect the values and first derivatives of these functions at the equilibrium neighbour distance to material properties, including the magnetoelastic constants and the magnetocrystalline anisotropy constant. The procedure was originally demonstrated for cubic ferromagnetic systems [7], and more recently has been extended to antiferromagnets [8, 9]. The modularity of this approach has also been demonstrated in previous spin-lattice studies employing different reference potentials, including modified embedded atom method (MEAM) [7], Buckingham [8], Lennard–Jones [9], reference-free MEAM [8], and spectral neighbor analysis potential (SNAP) [10].
Although these analytical relations provide a systematic route for constructing spin–lattice models, applying them requires selecting the appropriate expressions for the crystal structure and magnetic order, handling the unit conversions, and translating the resulting parameters into the input format required by a simulation package. The purpose of the present work is to facilitate this procedure through MagPot, a Python-based generator of magnetic interaction parameters for spin–lattice simulations with the SPIN package of LAMMPS [6, 11, 12]. Starting from a compact input file containing structural, elastic and magnetic properties, MagPot evaluates the required values and radial derivatives of , and , converts them into Bethe–Slater parameters, and writes the corresponding LAMMPS commands. The first release focuses on simple-cubic (SC), body-centred-cubic (BCC) and face-centred-cubic (FCC) lattices, considering the ferromagnetic and antiferromagnetic configurations.
MagPot is complementary to the MAELAS software suite [13]. MAELAS was developed to automate first-principles calculations of magnetocrystalline anisotropy, anisotropic magnetostriction and magnetoelastic constants, using density functional theory (DFT) calculations [13, 14]. Subsequent developments extended the methodology to the calculation of exchange magnetostriction and related isotropic magnetoelastic properties [15]. These capabilities make MAELAS a possible source of several material-specific quantities required to construct a spin–lattice model, such as , its pressure dependence, and the anisotropic magnetoelastic constants. Other required input quantities, including the equilibrium distance and bulk modulus, can be obtained from an equation-of-state calculation, while magnetic transition temperatures may be taken from experiment or first-principles calculations. MagPot uses these quantities to construct the distance-dependent interactions required by the atomistic model.
The combination of first-principles calculations interfaced with MAELAS and MagPot therefore provides a possible multiscale workflow, see Figure 1. First-principles calculations supply material-specific magnetic and magnetoelastic information; MagPot translates this information into the parameters of the magnetic Hamiltonian in order to generate the required magnetoelastic potential to perform spin–lattice molecular dynamics in substantially larger systems and over longer times than are generally accessible to direct first-principles molecular dynamics. In this sense, the two software tools address complementary stages of the modelling process: MAELAS helps determine the material properties, whereas MagPot constructs the magnetic interaction functions used in the atomistic simulations.

Figure 1. Connection between the MAELAS and MagPot codes. MAELAS is interfaced with first-principles calculations codes like the Vienna Ab initio Simulation Package (VASP) [16, 17] to compute magnetoelastic constants () and the pressure dependence of magnetocrystalline anisotropy () which are used as input parameters for MagPot to generate the magnetoelastic potential suitable for large-scale spin-lattice molecular dynamics simulations with the software LAMMPS [6, 11].
The remainder of this paper is organised as follows. § 2 describes the implementation of MagPot, the magnetic Hamiltonian and the workflow used to obtain its input parameters. § 3 presents representative examples and tests of the generated interactions against the target magnetic and magnetoelastic properties. Finally, § 4 summarises the capabilities of the current version and discusses possible future developments.
Methods
Program overview, input and output
MagPot is a lightweight program written in Python 3 that generates the magnetic pair-interaction coefficients required to perform spin–lattice molecular dynamics simulations with the SPIN package of LAMMPS [6, 11]. The source files of the program MagPot are available in the GitHub repository https://github.com/pnieves2019/magpot. Version 1.0 uses NumPy to read the input data and perform the numerical operations. The program does not generate the spin-independent reference potential; this contribution must be supplied separately (e.g., using embedded-atom method (EAM) or MEAM potentials, pairwise models such as Lennard–Jones or Buckingham, or suitable machine-learning interatomic potentials (MLIPs) such as SNAP) and combined additively with the magnetic interactions in LAMMPS through the hybrid/overlay pair style.
The calculation in MaGPoT is controlled by a plain-text file named input.dat. Lines beginning with the character # are comments and are ignored when the file is read. The remaining entries must be supplied in the prescribed order. The first three entries select the output format, crystal structure and magnetic order; the following eight entries are numerical material parameters. Table 1 summarises the input variables and their units.
| Entry | Description | Unit / values |
| Output format | lmp | |
| Crystal structure | sc, bcc, fcc | |
| Magnetic order | fm, afm | |
| First-nearest-neighbour distance at the equilibrium volume of the non-magnetic reference system | Å | |
| Bulk modulus of the non-magnetic reference system | GPa | |
| Curie temperature () for FM order or Néel temperature () for AFM order | K | |
| Spontaneous volume magnetostriction at zero temperature | dimensionless | |
| First magnetocrystalline-anisotropy constant at zero temperature | J m | |
| Relative pressure derivative of , defined as | GPa | |
| First anisotropic magnetoelastic constant | MPa | |
| Second anisotropic magnetoelastic constant | MPa |
Table 1. Input parameters read by MaGPoT version 1.0. The entries must appear in the order shown in the input.dat file.
The distance in the input file is always the first-neighbour distance of the underlying magnetic cubic sublattice. The distance at which the magnetic functions are evaluated is denoted by in § 2.2. For SC, BCC and FCC ferromagnets, and for SC and BCC antiferromagnets, . For the FCC type-II antiferromagnetic model, only second-neighbour interactions are retained and therefore , where is the conventional cubic lattice parameter [8]. This distinction is handled internally by the program. Table 2 lists the supported systems in version 1.0 and the neighbour shell used to parameterise the magnetic interactions. The corresponding unit cells of these systems are shown in Figure 2.
| Lattice | Order | Shell | Assumption | |
| SC | FM | 6 first neighbours | All first-neighbour moments are parallel. | |
| SC | AFM | 6 first neighbours | All first-neighbour moments are antiparallel. | |
| BCC | FM | 8 first neighbours | All first-neighbour moments are parallel. | |
| BCC | AFM (type G) | 8 first neighbours | All eight first-neighbour moments are antiparallel. | |
| FCC | FM | 12 first neighbours | All first-neighbour moments are parallel. | |
| FCC | AFM (type II) | 6 second neighbours | The 12 first neighbours comprise six parallel and six antiparallel pairs and are neglected. The six second neighbours are antiparallel and form the nearest-neighbour shell of each of the four interpenetrating SC networks. |
Table 2. Crystal structures and collinear magnetic configurations implemented in MagPot v1.0.

Figure 2. Unit cells of the crystal structures and magnetic configurations implemented in MagPot v1.0.
The FCC-AFM type-II configuration requires special treatment because a collinear FCC lattice cannot have all twelve first neighbours antiparallel due to geometrical frustration. In this configuration, the six second neighbours are antiparallel and form the nearest-neighbour shell of each of the four interpenetrating simple-cubic (SC) networks. Following the approach adopted for NiO [8], version 1.0 retains these second-neighbour interactions while neglecting both parallel and antiparallel first-neighbour interactions and interactions between different SC networks. Accordingly, the SC-AFM expressions are applied independently to each network. In LAMMPS, four atom types are used to identify the four SC networks, and non-zero magnetic coefficients are assigned only to pairs belonging to the same network; interactions between different networks are set to zero. The atom types therefore identify the crystallographic networks rather than the spin directions, which are specified independently by the spin vectors. In the NiO-like magnetic cell, each network contains two magnetic sublattices, giving eight magnetic sublattices in total. The user must assign the atom types in the LAMMPS structure consistently with this convention. The conventional FCC cell contains four magnetic atoms.
After reading the input file, MagPot prints the calculated Bethe–Slater parameters and the corresponding LAMMPS pair_coeff commands. The output can be redirected to a file, for example,
python3 magpot.py > results.dat
For the exchange interaction, the generated command has the form
pair_coeff * * spin/exchange exchange Rc alphaJ gammaJ deltaJ offset no
whereas the Neel contribution is written as
pair_coeff * * spin/neel neel Rc alphaI gammaI deltaI alphaq gammaq deltaq
The parameters , and correspond to the Bethe–Slater functions , respectively. The cutoff is printed in Å; the energy parameters are expressed in eV when used with the LAMMPS metal unit convention, and the dimensionless shape parameters are unitless. The cutoff must also be specified in the corresponding pair_style declaration. A typical magnetic pair-style definition is
pair_style hybrid/overlay eam/alloy spin/exchange Rc spin/neel Rc
with an appropriate EAM/MEAM coefficient supplied separately. Simulations using the SPIN pair styles require a spin-capable atom style (atom_style spin).
Magnetic Hamiltonian and Bethe–Slater parametrisation
The total potential energy of the spin–lattice model is decomposed into a spin-independent reference contribution and a magnetic contribution:
where describes the underlying atomic interactions and is provided by an independently selected interatomic potential, while contains the magnetic interactions generated by MagPot. This additive decomposition makes the approach modular, allowing the magnetic contribution to be combined with different compatible interatomic potentials through the hybrid/overlay functionality of LAMMPS. In the present implementation, the magnetic contribution consists of a Heisenberg exchange term and a two-ion Néel interaction:
The exchange contribution is
where and is the unit vector describing the direction of the magnetic moment at site . With this sign convention, positive favours parallel alignment, whereas negative favours antiparallel alignment.
The Néel interaction introduces the dependence of the magnetic energy on the orientation of the spin moments relative to the interatomic bond direction. Defining , and , the two-ion Néel Hamiltonian can be written as [1]
where the radial functions , and are related to the dipolar and quadrupolar functions and through
For collinear spin configurations, the Néel energy reduces to different angular expressions depending on whether the pair is parallel or antiparallel. For parallel pairs (),
whereas for antiparallel pairs (),
The dipolar function determines the leading anisotropic magnetoelastic contribution, while the quadrupolar function controls the cubic magnetocrystalline anisotropy. The relations used to connect and its derivative to and neglect the quadrupolar contribution to the magnetoelastic energy, following the approximation adopted in the cubic spin–lattice parametrisation of Nieves et al. [7, 18, 19]. The function is then determined independently from and its pressure dependence.
The distance dependence of the three magnetic functions is represented by the Bethe–Slater form used in the LAMMPS SPIN package [6]:
where , is the Heaviside step function and is the cutoff radius. For each function, the analytical parametrisation requires its value and first radial derivative at the reference interaction distance . We define
The three Bethe–Slater parameters are then [7]
The cutoff is selected halfway between the interaction shell at and the next shell of the corresponding interaction network, so that no additional neighbour shell is included. In version 1.0, the same geometrical cutoff is used for , and for each selected lattice/order combination.
The values of and are obtained by relating the exchange energy to the Curie or Néel temperature and the spontaneous volume magnetostriction. The values of and follow from the cubic magnetoelastic energy and the constants and . Finally, and are determined by matching the Néel energy to the first cubic magnetocrystalline-anisotropy constant and its pressure dependence. The following notation is used in the expressions implemented in the code:
where is the conventional cubic-cell volume and is the number of atoms in that cell (, 2 and 4 for SC, BCC and FCC, respectively). The sign of must follow the convention used to obtain the material input; the signs in Table 3 are those implemented for the FM and AFM definitions adopted in Refs. [7, 8]. For a cubic crystal, , so the combination of elastic constants appearing in the exchange-magnetostriction expressions can be replaced by . This is why MagPot requires only the bulk modulus, rather than the individual elastic constants and . In the derivative of , the numerical value of is in GPa and that of is in . Internally, distances are converted from Å to metres, from GPa to Pa, and from MPa to Pa. Energy-valued quantities are finally converted from joules to eV using .
| Model | Term | ||
| SC–FM | |||
| SC–FM | |||
| SC–FM | |||
| SC–AFM | |||
| SC–AFM | |||
| SC–AFM | |||
| BCC–FM | |||
| BCC–FM | |||
| BCC–FM | |||
| BCC–AFM (G) | |||
| BCC–AFM (G) | |||
| BCC–AFM (G) | |||
| FCC–FM | |||
| FCC–FM | |||
| FCC–FM | |||
| FCC–AFM (II) | |||
| FCC–AFM (II) | |||
| FCC–AFM (II) |
Table 3. Reference values and scaled radial derivatives used by MagPot version 1.0. The derivative is defined as . In the quadrupolar rows, , with in GPa and in GPa.
Table 3 collects the values and radial derivatives implemented in version 1.0. For the BCC type-G antiferromagnet, all eight first neighbours are antiparallel, see Figure 2. The quadrupolar prefactor in Table 3 is obtained by summing the AFM angular expression in Eq. (7) over the eight BCC bond directions and matching the energy difference between the [110] and [100] spin orientations to the cubic anisotropy energy . For FCC type-II AFM, the SC-AFM expressions are used for each of the four interpenetrating SC networks; the cell volume and atom count correspond to the conventional FCC cell (), and is the FCC second-neighbour distance. These assumptions are part of the model definition and should be retained when constructing the LAMMPS structure and atom types.
Parameterisation workflow
The workflow used to generate a magnetic potential with MagPot is divided into two stages. First, the equilibrium geometry and bulk modulus are determined for the non-magnetic reference system. Second, the magnetic and magnetoelastic material properties are combined with these structural quantities in input.dat to obtain the Bethe–Slater parameters.
Non-magnetic equation of state.
An interatomic potential describing the non-magnetic lattice contribution (for example, EAM, MEAM, Lennard–Jones, Buckingham, SNAP, etc.) is selected first. The magnetic exchange and Néel interactions are disabled, and the total energy is calculated for a set of volumes around the equilibrium volume. The resulting energy–volume data are fitted to an equation of state (EOS), such as the Vinet [20] or Murnaghan [21] form, to obtain the equilibrium conventional-cell volume and bulk modulus . The equilibrium lattice parameter is then for the conventional cubic cell, and the first-neighbour distance supplied to MagPot is obtained from
The FCC-AFM type-II branch subsequently converts this input first-neighbour distance to the second-neighbour interaction distance . In the distributed BCC-Fe example, the non-magnetic EOS is fitted to the energy–volume data generated with LAMMPS; the example script uses a Vinet EOS fit to obtain and , see § 3.1.
Magnetic and magnetoelastic input properties.
The remaining material properties can be obtained from experiment or from first-principles calculations. The transition temperature or and the spontaneous volume magnetostriction may be taken from experimental measurements or suitable theoretical calculations [9]. The magnetocrystalline anisotropy can be evaluated from spin–orbit-coupled DFT total energies for different magnetisation directions. Its pressure derivative is obtained by repeating the calculation at several volumes or pressures and fitting the resulting dependence. The anisotropic magnetoelastic constants and can be obtained from strain-dependent energy calculations; the corresponding DFT workflows are available in MAELAS and can be carried out using VASP as the electronic-structure engine [13, 14, 15]. Experimental values may be used instead whenever available and consistent with the definitions adopted by the model.
Once these quantities have been collected and converted to the units specified in Table 1, they are written to input.dat. Running magpot.py produces the Bethe–Slater parameters and LAMMPS coefficient commands. These magnetic terms are then combined with the non-magnetic interatomic potential in a spin–lattice simulation. The separation between the non-magnetic EOS calculation and the subsequent magnetic parameterisation is intentional: the input values and describe the reference lattice potential without magnetic interactions, while , , , , and determine the magnetic part of the model.
Examples and tests
The examples distributed with MagPot version 1.0 are based on body-centred cubic (BCC) iron. They illustrate the complete parameterisation workflow and test whether the generated spin–lattice potential reproduces the material properties used as input. In this test, the non-magnetic interactions were described using the EAM potential for Fe developed by Chamati et al. [22], whereas the magnetic contribution is given by the exchange and Néel terms generated by MagPot. The calculations are carried out with LAMMPS and its SPIN package [6, 11]. In the first step, the EOS of the spin-independent reference potential is analysed to determine the required input parameters, and . These structural quantities are then combined with the target magnetic and magnetoelastic properties to generate the magnetic contribution to the spin–lattice potential using MagPot. In the next step, we assess whether the resulting spin–lattice model reproduces the target properties, including the Curie temperature, spontaneous volume magnetostriction, pressure dependence of the magnetocrystalline anisotropy, and anisotropic magnetoelastic constants. Similar tests for the other supported symmetries are discussed in § 3.7.
Step 1: Non-magnetic equation of state
The first calculation establishes the equilibrium structural parameters required by MagPot. A set of seven BCC Fe conventional-cell volumes is evaluated using the EAM/alloy potential without the magnetic exchange and Néel interactions (which have not yet been determined at this stage). The calculated energy–volume data are fitted to a Vinet equation of state. The fit gives an equilibrium conventional-cell volume of and a bulk modulus of . Since the conventional BCC cell contains two atoms, the corresponding lattice parameter is , and the nearest-neighbour distance is . These values are the structural inputs used in the BCC Fe input.dat file.
Step 2: input data and generated Bethe–Slater parameters
Next, we fill in the input.dat file for the ferromagnetic BCC Fe example. The first-neighbour distance () and bulk modulus () were obtained in the preliminary non-magnetic EOS calculation (§ 3.1). The remaining entries (, , , , and ) are the target magnetic and magnetoelastic properties used to generate the potential, which are taken from literature. The input data are listed in Table 4. The corresponding input.dat file and the LAMMPS input files are included in the Examples/ directory of the code distribution.
Table 4. BCC Fe parameters supplied in the input.dat file of MagPot v1.0 example. The data for and are obtained from the EOS analysis using the non-magnetic potential (§ 3.1), while the other data are taken from literature.
Using these inputs, MagPot generates the Bethe–Slater parameters collected in Table 5. The three functions share the same cutoff and reference distance in this example. The values of are given in eV, as required by the LAMMPS metal unit system; is dimensionless and and are given in Å. The resulting exchange and Néel coefficients are used together with the separately specified EAM/alloy coefficient through the LAMMPS hybrid/overlay pair style. Table 6 compares the target values entered in input.dat with the properties recovered from the corresponding LAMMPS tests, finding good agreement for all quantities.
| Function | (eV) | (Å) | (Å) | |
| 2.4370721 | 2.4824584 | 2.6744773 | ||
| 0.8405797 | 2.4824584 | 2.6744773 | ||
| 1.0498146 | 2.4824584 | 2.6744773 |
Table 5. Bethe–Slater parameters generated by MagPot version 1.0 for BCC ferromagnetic Fe. The cutoff is common to the three magnetic functions in this example.
| Property | Input target | Model result | Unit |
| 1043 | 900 | K | |
| 0.01160 | 0.011441 | – | |
| 55.000 | 55.070 | ||
| MPa | |||
| 10.50 | 10.283 | MPa |
Table 6. Comparison between the target material parameters supplied to MagPot and the values recovered from the LAMMPS validation tests for BCC Fe.

Figure 3. Energy–volume data for non-magnetic BCC Fe and the Vinet EOS fit used to determine the equilibrium volume and bulk modulus.
Curie-temperature test
The Curie temperature is tested by applying a Langevin thermostat [6] on the spin system at a sequence of temperatures and monitoring the normalised magnetisation. The resulting data are fitted to the critical-law expression
where both and the exponent are fitting parameters, as shown in Figure 4. The fit reported in the example gives K and . The target Curie temperature used to generate the potential is 1043 K. This deviation is reasonable within the Mean-Field Approximation (MFA) used to compute . We note that the agreement between simulated and experimental temperature-dependent magnetization curves can be further improved by applying a temperature-rescaling scheme, in which the physical temperature is mapped onto an effective simulation temperature that controls the thermal fluctuations of the spin system [26].

Figure 4. Normalised magnetisation of BCC Fe as a function of temperature and fit to the critical law in Eq. (13).
Spontaneous volume magnetostriction
The spontaneous volume magnetostriction is evaluated from separate energy–volume curves for the ferromagnetic and paramagnetic configurations. The paramagnetic reference is represented by randomly oriented magnetic moments, while the ferromagnetic calculation uses collinear, parallel moments. The equilibrium volumes are obtained by fitting the corresponding data to the Murnaghan EOS. The fitted equilibrium volumes are
The spontaneous volume magnetostriction is then calculated as
This value differs by approximately 1.4% from the target value used in the input file. The two EOS and the resulting volume difference is shown in Figure 5.

Figure 5. Comparison of the ferromagnetic and paramagnetic energy–volume curves. The vertical lines indicate the equilibrium volumes obtained from the Murnaghan fits. Their difference gives the spontaneous volume magnetostriction according to Eq. (15).
Pressure dependence of
The pressure dependence of the first magnetocrystalline-anisotropy constant is tested by calculating the energies of BCC Fe with the magnetisation constrained along the crystallographic directions [100] and [110] at a series of volumes. For each volume, the anisotropy constant is obtained from
The seven volume points span approximately to GPa. A linear fit of the form yields the following parameters:
The resulting linear fit is shown in Figure 6. The corresponding relative pressure derivative is

Figure 6. Pressure dependence of for BCC Fe. Symbols show the values obtained from the energy differences between magnetisation directions [110] and [100], and the solid line is the linear fit used to determine and .
with a coefficient of determination . These values agree closely with the input targets of and .
Anisotropic magnetoelastic constants
The anisotropic magnetoelastic constants are evaluated using the strain–energy procedure implemented in MAELAS mode 2 [14]. The strained atomic configurations generated for this procedure are automatically converted into LAMMPS data files using Atomsk [27]. The corresponding total energies are then calculated with LAMMPS using the generated spin–lattice potential. For , a set of tetragonal strains is applied and the energy difference between magnetisation directions and is fitted as a linear function of strain. For , a set of shear strains is applied and the corresponding energy difference between directions and is fitted. The values extracted from the LAMMPS energies are MPa and MPa, which compare well with the target values in Table 4. The two energy–strain fits are shown in Figure 7.

Figure 7. Energy differences as a function of strain used to determine the anisotropic magnetoelastic constants of BCC Fe: (a) tetragonal strain for and (b) shear strain for . Symbols denote the LAMMPS results and solid lines the linear fits performed by MAELAS.
Tests for the other supported symmetries
We have also verified that MagPot reproduces the cases for FCC-FM like FCC Ni [7], SC-AFM like FeRh [9] and FCC-AFM (type II) like NiO [8]. The two remaining systems SC-FM and BCC-AFM (type G) have been successfully tested assuming a hypothetical Fe crystal with such a lattice and magnetic order with the target properties given by Table 6.
Conclusions and future perspectives
A Python-based software tool, MagPot, has been presented for the generation of magnetic interaction parameters for spin–lattice molecular dynamics simulations. Starting from a compact set of structural, elastic, magnetic and magnetoelastic properties, the program evaluates the reference values and radial derivatives of the exchange function and the two Néel functions and . These quantities are then mapped onto Bethe–Slater functions and written as coefficient commands that can be used with the SPIN package in LAMMPS. In this way, MagPot provides a practical step between the determination of material properties and the construction of an atomistic spin–lattice model.
An important practical advantage of MagPot is its modular architecture, which separates the parameterisation of magnetic interactions from the choice of the underlying interatomic potential. The program generates the magnetic exchange and Néel contributions, which can be added to an independently selected lattice potential using the LAMMPS hybrid/overlay framework. This design makes MagPot suitable for use with a broad range of compatible classical interaction models like EAM, MEAM[7], Lennard-Jones [9], Buckingham [8], reference-free MEAM [8], SNAP [10], etc.
Version 1.0 covers SC, BCC and FCC lattices, with FM and selected collinear AFM configurations. The supported cases include the G-type AFM arrangement on BCC, in which the eight first neighbours are antiparallel, and the type-II AFM arrangement on FCC. For the latter, the implementation considers only the six antiparallel second neighbours, which form four interpenetrating simple-cubic networks; interactions between different networks are neglected. The present release generates input in the LAMMPS format and is intended to be used together with a non-magnetic interatomic potential describing the underlying lattice.
All supported systems were carefully examined through separate tests of the non-magnetic equation of state, the Curie temperature, spontaneous volume magnetostriction, the pressure dependence of the first magnetocrystalline-anisotropy constant, and the anisotropic magnetoelastic constants. These tests demonstrate how the material properties used as input can be checked independently against the response of the generated spin–lattice model.
MagPot is designed to complement first-principles tools such as MAELAS. DFT calculations, including workflows based on VASP and MAELAS, can provide magnetocrystalline-anisotropy and magnetoelastic data, while experimental measurements can supply the same quantities when available. The resulting material parameters can be passed to MagPot to construct the distance-dependent magnetic interactions for larger-scale spin–lattice simulations. This parameter-based workflow offers a route for connecting first-principles characterisation with classical atomistic simulations.
Several developments can be considered for future versions. First, the range of supported crystal symmetries could be extended beyond cubic structures to include, for example, tetragonal, hexagonal and orthorhombic systems. Such extensions would require the inclusion of the corresponding symmetry-specific analytical relations and, where necessary, additional magnetoelastic and magnetocrystalline-anisotropy parameters. Second, output generators could be implemented for other molecular-dynamics or atomistic spin–lattice simulation packages, in addition to the current LAMMPS/SPIN format.
In summary, MagPot provides a compact and transparent way to convert material-specific magnetic and magnetoelastic properties into Bethe–Slater parameters suitable for spin–lattice simulations. The current release establishes this workflow for selected cubic systems and provides example calculations for its validation. Extensions to lower-symmetry crystals and additional simulation formats would broaden its applicability to the computational investigation of magnetoelastic materials across length and time scales.
Funding
This work was supported by the Ministry of Education, Youth and Sports of the Czech Republic through the e-INFRA CZ (ID:90254) and by project QM4ST (CZ.02.01.01/00/22/008/0004572). P. N. acknowledges support by grant MU-23-BG22/00168 funded by The Ministry of Universities of Spain; the project MAG-COOLEST, grant PID2025-174502NB-C31, Ministerio de Ciencia, Innovación y Universidades (Spain). D. L. and I. K. acknowledge support from the project No. 25-14529L of the Grant Agency of Czech Republic. R.I. acknowledges funding from the project BETMATFUS, grant PID2023-149089OB-I00, Ministerio de Ciencia, Innovación y Universidades (Spain), the EIT-RM/EU project ExpSkills-REM, grant number UE-22-EXPSKILLS-21104, the Spanish AEI Project NEXPECH-2, grant number MCINN-24-PCI2024-153437, MCINN-23-PID2022-138256NB-C21. P.N. and R.I. would like to acknowledge the Agencia de Ciencia, Competitividad Empresarial e Innovación Asturiana (Sekuens) project MAGNES, SEK-25-GRU-GIC-24-113. Support provided by the EU-MACE and EuMINe COST Actions CA22123 and CA22143, respectively, is gratefully acknowledged as well.
Data availability
The datasets generated and analyzed during the current study are available in the GitHub repository https://github.com/pnieves2019/magpot. The corresponding author, Pablo Nieves (E-mail: [email protected]), is the designated individual responsible for receiving and replying to all data sharing requests.
Code availability
The source files of the program MagPot are available in the GitHub repository https://github.com/pnieves2019/magpot.
Competing interests
The authors declare no competing interests.
Author contributions
P.N. conceived the study. P.N. and I.K. performed the derivation of the theoretical formulas. P.N. and I.K. developed and tested the program and models. S.A., A.F., R.I. and D.L. contributed to the computational modeling analysis and project discussions. All authors contributed to the interpretation of the results, discussed the bcc Fe magnetoelastic properties, reviewed the manuscript, and approved the final version.
References
- [1]Lacheisserie, E.D.T.d.: Magnetostriction: Theory and Application of Magnetoelasticity. CRC Press, Boca Raton, FL (1993)
- [2]Engdahl, G.: Handbook of Giant Magnetostrictive Materials. Academic Press (1999)
- [3]Dapino, M.J.: Encyclopaedia of Smart Materials. John Wiley and Sons, New York (2000). Section: Magnetostrictive materials: their use in smart structure applications
- [4]Wasserman, E.F.: Chapter 3 Invar: Moment-volume instabilities in transition metals and alloys. Handbook of Ferromagnetic Materials, vol. 3, pp. 237–322. Elsevier (1990). https://doi.org/10.1016/S1574-9304(05)80063-X. http://www.sciencedirect.com/science/article/pii/S157493040580063X
- [5]Eriksson, O., Bergman, A., Bergqvist, L., Hellsvik, J.: Atomistic Spin Dynamics. Oxford University Press, Oxford, UK (2017). https://doi.org/10.1093/oso/9780198788669.001.0001
- [6]Tranchida, J., Plimpton, S.J., Thibaudeau, P., Thompson, A.P.: Massively parallel symplectic algorithm for coupled magnetic spin dynamics and molecular dynamics. Journal of Computational Physics 372, 406–425 (2018) https://doi.org/10.1016/j.jcp.2018.06.042
- [7]Nieves, P., Tranchida, J., Arapan, S., Legut, D.: Spin-lattice model for cubic crystals. Physical Review B 103(9), 094437 (2021) https://doi.org/10.1103/PhysRevB.103.094437
- [8]Korniienko, I., Nieves, P., Sebesta, J., Iglesias, R., Legut, D.: Development of a magnetic interatomic potential for cubic antiferromagnets: The case of NiO. The Journal of Chemical Physics 165(2), 024701 (2026) https://doi.org/10.1063/5.0329268
- [9]Nieves, P., Arapan, S., Padrón-Alemán, K., Korniienko, I., Iglesias, R., Álvarez-Alonso, P., Blanco, J.Á., Gorria, P., Legut, D.: Magnetoelastic fingerprints of metamagnetism in FeRh. Communications Physics 9(1), 363 (2026) https://doi.org/10.1038/s42005-026-02758-6
- [10]Nikolov, S., Nieves, P., Thompson, A.P., Wood, M.A., Tranchida, J.: Temperature dependence of magnetic anisotropy and magnetoelasticity from classical spin-lattice calculations. Physical Review B 107(9), 094426 (2023) https://doi.org/10.1103/PhysRevB.107.094426
- [11]Thompson, A.P., Aktulga, H.M., Berger, R., Bolintineanu, D.S., Brown, W.M., Crozier, P.S., Veld, P.J.i.t., Kohlmeyer, A., Moore, S.G., Nguyen, T.D., Shan, R., Stevens, M.J., Tranchida, J., Trott, C., Plimpton, S.J.: LAMMPS - a flexible simulation tool for particle-based materials modeling at the atomic, meso, and continuum scales. Computer Physics Communications 271, 108171 (2022) https://doi.org/10.1016/j.cpc.2021.108171
- [12]Plimpton, S.: Fast Parallel Algorithms for Short-Range Molecular Dynamics. Journal of Computational Physics 117(1), 1–19 (1995) https://doi.org/10.1006/jcph.1995.1039
- [13]Nieves, P., Arapan, S., Zhang, S.H., Kadzielawa, A.P., Zhang, R.F., Legut, D.: MAELAS: Magneto-ELAStic properties calculation via computational high-throughput approach. Computer Physics Communications 264, 107964 (2021) https://doi.org/10.1016/j.cpc.2021.107964
- [14]Nieves, P., Arapan, S., Zhang, S.H., Kadzielawa, A.P., Zhang, R.F., Legut, D.: MAELAS 2.0: A new version of a computer program for the calculation of magneto-elastic properties. Computer Physics Communications 271, 108197 (2022) https://doi.org/10.1016/j.cpc.2021.108197
- [15]Nieves, P., Arapan, S., Zhang, S.H., Kadzielawa, A.P., Zhang, R.F., Legut, D.: Automated calculations of exchange magnetostriction. Computational Materials Science 224, 112158 (2023) https://doi.org/10.1016/j.commatsci.2023.112158
- [16]Kresse, G., Furthmüller, J.: Efficiency of ab-initio total energy calculations for metals and semiconductors using a plane-wave basis set. Computational Materials Science 6(1), 15–50 (1996) https://doi.org/10.1016/0927-0256(96)00008-0
- [17]Kresse, G., Joubert, D.: From ultrasoft pseudopotentials to the projector augmented-wave method. Physical Review B 59(3), 1758–1775 (1999) https://doi.org/10.1103/PhysRevB.59.1758
- [18]Chikazumi, S.: Physics of Ferromagnetism, 2nd edn. Oxford University Press, Oxford, UK (2009)
- [19]O’Handley, R.C.: Modern Magnetic Materials: Principles and Applications. Wiley, New York (1999)
- [20]Vinet, P., Smith, J.R., Ferrante, J., Rose, J.H.: Temperature effects on the universal equation of state of solids. Physical Review B 35(4), 1945–1953 (1987) https://doi.org/10.1103/PhysRevB.35.1945
- [21]Murnaghan, F.D.: The Compressibility of Media under Extreme Pressures. Proceedings of the National Academy of Sciences 30(9), 244–247 (1944) https://doi.org/10.1073/pnas.30.9.244 - eprint: https://www.pnas.org/doi/pdf/10.1073/pnas.30.9.244
- [22]Chamati, H., Papanicolaou, N.I., Mishin, Y., Papaconstantopoulos, D.A.: Embedded-atom potential for fe and its application to self-diffusion on fe(100). Surface Science 600(9), 1793–1803 (2006) https://doi.org/10.1016/j.susc.2006.02.010
- [23]Shimizu, M.: Forced Magnetostriction, Magnetic Contributions to Bulk Modulus and Thermal Expansion and Pressure Dependence of Curie Temperature in Iron, Cobalt and Nickel. Journal of the Physical Society of Japan 44(3), 792–800 (1978) https://doi.org/10.1143/JPSJ.44.792 - eprint: https://doi.org/10.1143/JPSJ.44.792
- [24]Getzlaff, M.: Fundamentals of Magnetism. Springer (2008)
- [25]Sawaoka, A.: Effect of hydrostatic pressure on the magnetocrystalline anisotropy constant K1 of iron and nickel. Journal of Physics and Chemistry of Solids 36(4), 267–268 (1975) https://doi.org/10.1016/0022-3697(75)90020-7
- [26]Evans, R.F.L., Atxitia, U., Chantrell, R.W.: Quantitative simulation of temperature-dependent magnetization dynamics and equilibrium properties of elemental ferromagnets. Physical Review B 91(14), 144425 (2015) https://doi.org/10.1103/PhysRevB.91.144425
- [27]Hirel, P.: Atomsk: A tool for manipulating and converting atomic data files. Computer Physics Communications 197, 212–219 (2015) https://doi.org/10.1016/j.cpc.2015.07.012