Introduction

Magnetic materials have garnered significant interest due to their wide range of technological applications, from everyday items like refrigerator magnets to complex devices such as electric motors, generators, sensors, and computer memories1,2,3. Their magnetic behavior stems from the presence of unpaired electrons in atomic orbitals and the subsequent interactions between the magnetic moments of these atoms. Depending on the crystal structure and chemistry of the material, these magnetic moments can align in a particular direction (ferromagnetic interaction) or anti-align (antiferromagnetic interaction). The complex interaction between magnetic moments gives rise to various magnetic phases, including conventional ferro and antiferromagnetism, weak ferromagnetic canting, spin waves, topological orders such as skyrmions, spin glasses, and even exotic magnetic monopoles3. Notably, the magnetic interactions between neighboring atoms are relatively weak compared to other electron–electron interactions. Consequently, magnetism is a sensitive property easily influenced by various factors such as temperature, pressure, strain, and magnetic field. These external parameters can dramatically alter the magnetic behavior of a material, leading to intriguing phenomena and providing opportunities for technological advancements. Hence, the development of high-throughput methodologies for the computation of magnetic properties and the exploration of various potential magnetic phases would be a valuable endeavor4,5,6,7.

Effective models such as the Heisenberg model are commonly employed to understand magnetic interactions and predict magnetic phases in materials8,9. These models simplify the many-body problem and can be parameterized using first-principles calculations, typically based on density functional theory (DFT). Real space energy mapping and spin-spiral calculations are two standard methods for obtaining Heisenberg Hamiltonian parameters from DFT calculations10,11,12. The real space energy mapping method involves calculating the energy spectrum of different magnetic configurations and mapping it to the Hamiltonian13,14. This approach often requires the use of supercells to accommodate different magnetic orders. On the other hand, the spin-spiral method relates the magnon spectra to the total energies of the many spin-spiral states, allowing the determination of exchange parameters. Both methods are widely used for simplicity but can be computationally demanding since the number of required calculations scales with the number of exchange parameters considered. An alternative approach is the Green’s function method, which uses the Magnetic Force Theorem (MFT) proposed by Liechtenstein, Katsnelson, Antropov, and Gubanov (LKAG)15,16. Initially implemented with the Koringa-Kohn-Rostoker Green’s function, this method accurately describes magnetic properties without the efficiency issues associated with energy mapping and spin-spiral methods17. The LKAG method is well-suited for high-throughput analyses, where computational efficiency is crucial. However, it has one limitation: it requires prior knowledge of the magnetic ground state. Although it can estimate the ground state from a non-ground-state approximated Heisenberg model, the estimation can be inaccurate based on the limitations of the Heisenberg model, which will be discussed later.

Knowing the magnetic ground state of a material is crucial as it enables the exploration of its magnetic response under various conditions. Once the magnetic ground state is determined, a perturbative approach (like the LKAG method) can be employed to compute other magnetic excitations. These excitations can be obtained by finding the eigenmodes of the Heisenberg Hamiltonian, providing a comprehensive picture of the magnon spectra. Furthermore, with the knowledge of all parameters in the Heisenberg Hamiltonian, researchers can perform atomistic spin dynamics simulations, which allow them to obtain dynamical properties in magnetic materials18. By understanding the magnetic ground state, researchers can also investigate how the material responds to different external factors, such as temperature, pressure, or magnetic fields. This knowledge is essential for studying the material’s magnetic behavior and predicting its properties under various conditions.

In the following sections, we outline our formalism for exploring the magnetic ground state of crystal systems. First, we describe how we map the problem of finding the magnetic ground state into a minimization procedure of a positive definite hermitian matrix. Then, we present our computational method for determining the magnetic ground state, which uses the computed magnetic exchange couplings from the LKAG method. Finally, we test our method for three systems: two bulk 3D materials and one 2D material. We compare the obtained results for each system with available experimental and existing theoretical data. By providing a comprehensive analysis of the obtained results and their comparison with experimental and theoretical data, we aim to showcase the effectiveness of our computational approach in exploring the magnetic ground state and understanding the magnetic behavior of different materials. Additionally, we elaborate on the potential limitations of our methodology. The paper concludes by discussing some perspectives on the use of our development.

Results

Heisenberg model

The Heisenberg model is the starting point of many analyses of the magnetic properties of materials. In the absence of an external magnetic field, it is contained in the following Hamiltonian:

$$H=-\mathop{\sum}\limits_{i}{{{{\bf{S}}}}}_{i}^{T}{{{{\bf{A}}}}}_{i}{{{{\bf{S}}}}}_{i}-\mathop{\sum}\limits_{{{{\rm{i}}\,\ne \,{\rm{j}}}}}{{{{\bf{S}}}}}_{i}^{T}{{{{\bf{J}}}}}_{ij}{{{{\bf{S}}}}}_{j},$$
(1)

where Ai denotes the single-ion anisotropy tensor, Jij is the exchange coupling tensor, and Si is the spin operator corresponding to the ith magnetic atom. While Ai and Jij are represented by 3 × 3 matrices, Si corresponds to a 3 × 1 column unit vector that points in the direction of the magnetic moment mi at site i. Here, Jij includes the isotropic exchange (\({J}_{ij}^{iso}\)), the anisotropic exchange (\({{{{\bf{J}}}}}_{ij}^{ani}\)), and the Dzyaloshinskii-Moriya interaction (DMI; Dij). While \({J}_{ij}^{iso}\) is a number independent of the magnetic sites’ relative orientation with the lattice, \({{{{\bf{J}}}}}_{ij}^{ani}\) and Dij are second and first-order tensors that describe anisotropic and anti-symmetric interactions. The exchange coupling tensor Jij can be constructed from the foregoing terms by the expression

$$\begin{array}{r}{{{{\bf{J}}}}}_{ij}={{{{\bf{J}}}}}_{ij}^{ani}+\left[\begin{array}{ccc}0&{D}_{z}^{ij}&-{D}_{y}^{ij}\\ -{D}_{z}^{ij}&0&{D}_{x}^{ij}\\ {D}_{y}^{ij}&-{D}_{x}^{ij}&0\end{array}\right]+{J}_{ij}^{iso}I,\end{array}$$
(2)

where I is the identity matrix.

Although Eq. (1) contains an infinite number of interactions, the values of the exchange tensors decrease with distance, and only a finite set of them is needed to obtain a good approximation. The product \({{{{\bf{S}}}}}_{i}^{T}{{{{\bf{J}}}}}_{ij}{{{{\bf{S}}}}}_{j}\) effectively describes the interactions between magnetic species in a crystal lattice by quantifying the effect on the total energy of each interacting pair i, j. Consequently, if Ai and Jij are known, we can access relevant information about a magnetic material, like its critical temperature, the spin-wave energies, and the magnetic ground state configuration, which we will discuss in this paper.

The exchange tensors describe how the alignment of a particular local magnetic moment mi affects the overall system. For example, consider a purely isotropic case for which the matrices in Eq. (1) are multiples of the identity matrix so that Jij only contains \({J}_{ij}^{iso}\) terms. Then, if we suppose that \({J}_{ij}^{iso}\) is positive (negative) for a given interacting pair i, j, it will favor a parallel (antiparallel) alignment between the local magnetic moments of sites i and j. Furthermore, if Jij contains anisotropic components (nonzero diagonal entries), it also contains information about the local magnetic moments’ alignments relative to the lattice. Thus, in principle, we can expect the Heisenberg model to predict the most favorable magnetic configuration. We argue that such a prediction can be obtained by considering a stability condition on the eigenvalue problem of the Heisenberg Hamiltonian, which we discuss in the next section.

Linear spin wave theory

A general solution of Eq. (1) in the one-magnon picture can be obtained from linear spin-wave theory (LSWT). Toth and Lake19 used LSWT to develop an algorithm capable of solving Eq. (1) for systems with an incommensurate magnetic structure. Their method uses a local coordinate system that transforms any magnetic structure into ferromagnetic ordering for which the spin-wave energies are easily calculable. Here, we briefly discuss their algorithm’s mathematics but refer to ref. 19 for further details.

First, we state that any magnetic configuration can be described by a propagation vector Q in the reciprocal lattice (that describes how the orientation mi rotates depending on its positions in the lattice) and the relative alignment of each mi within its crystallographic unit cell. This introduces the following transformation:

$${{{{\bf{S}}}}}_{i}={R}_{{\phi }_{i}}{R}_{i}{{{{\bf{S}}}}}_{i}^{{\prime} },$$
(3)

where Ri is a matrix that rotates \(\hat{z}\) into the relative orientation of mi within its unit cell and \({R}_{{{{{\rm{\phi }}}}}_{{{{\rm{i}}}}}}\) represents the propagation vector rotation by the phase ϕi = Q ⋅ ri, where ri is the position vector of the magnetic site i. Thus, the transformation \({R}_{{{{{\rm{\phi }}}}}_{{{{\rm{i}}}}}}{R}_{i}\) rotates \(\hat{z}\) into \({\hat{{{{\bf{m}}}}}}_{i}\). From this step, we also define the vectors ui and vi by

$$\begin{array}{ll}{u}_{i}^{k}\,={R}_{i}^{k1}+i{R}_{i}^{k2},\\ {v}_{i}^{k}\,={R}_{i}^{k3},\end{array}$$
(4)

where k = 1, 2, 3.

The next step in the LSWT method is to expand the rotated spin operators in terms of bosonic annihilation and creation operators. When only the linear terms are considered, we obtain the expression

$$\begin{array}{ll}{S}_{i}^{{\prime} +}&=\sqrt{2{S}_{i}}{b}_{i}\\ {S}_{i}^{{\prime} -}&=\sqrt{2{S}_{i}}{b}_{i}^{{\dagger} }\\ {S}_{i}^{{\prime} z}&={S}_{i}-{b}_{i}^{{\dagger} }{b}_{i},\end{array}$$
(5)

where \({S}_{i}^{{\prime} \pm }={S}_{i}^{{\prime} x}\pm i{S}_{i}^{{\prime} y}\) and bi and \({b}_{i}^{{\dagger} }\) satisfy the bosonic commutation relations:

$$\left[{b}_{i},{b}_{j}^{{\dagger} }\right]={\delta }_{ij}.$$
(6)

Then, by getting the Fourier transformation of the bosonic operators and the exchange tensors:

$${b}_{i}=\frac{1}{N}\mathop{\sum}\limits_{{{{\bf{k}}}}\epsilon B.Z}{b}_{i}({{{\bf{k}}}}){{{{\rm{e}}}}}^{i{{{\bf{k}}}}\cdot {{{{\bf{r}}}}}_{i}},{{{{\bf{J}}}}}_{ij}=\mathop{\sum}\limits_{{{{\bf{k}}}}\epsilon B.Z}{{{{\bf{J}}}}}_{ij}({{{\bf{k}}}}){{{{\rm{e}}}}}^{i{{{\bf{k}}}}\cdot {{{{\bf{r}}}}}_{i}}$$
(7)

we can express the Heisenberg Hamiltonian from equation (1) as

$$H=\mathop{\sum}\limits_{{{{\bf{k}}}}\epsilon B.Z}{{{{\bf{x}}}}}^{{\dagger} }({{{\bf{k}}}})h({{{\bf{k}}}}){{{\bf{x}}}}({{{\bf{k}}}}).$$
(8)

Here, \({{{{\bf{x}}}}}_{i}=[{b}_{1}({{{\bf{k}}}}),\ldots ,{b}_{N}({{{\bf{k}}}}),{b}_{1}^{{\dagger} }({{{\bf{k}}}}),\ldots ,{b}_{N}^{{\dagger} }({{{\bf{k}}}})]\) and h(k) is a Hermitian block matrix given by

$$h({{{\bf{k}}}})=\left[\begin{array}{cc}A({{{\bf{k}}}})-C&B({{{\bf{k}}}})\\ {B}^{{\dagger} }({{{\bf{k}}}})&\bar{A}(-{{{\bf{k}}}})-C\end{array}\right],$$
(9)

with

$$\begin{array}{ll}{A}_{ij}({{{\bf{k}}}})\,=\frac{\sqrt{{S}_{i}{S}_{j}}}{2}{{{{\bf{u}}}}}_{i}^{T}{{{{\bf{J}}}}}_{ij}^{{\prime} }(-{{{\bf{k}}}}){\bar{{{{\bf{u}}}}}}_{j},\\ {B}_{ij}({{{\bf{k}}}})\,=\frac{\sqrt{{S}_{i}{S}_{j}}}{2}{{{{\bf{u}}}}}_{i}^{T}{{{{\bf{J}}}}}_{ij}^{{\prime} }(-{{{\bf{k}}}}){{{{\bf{u}}}}}_{j},\\ \quad\,\,{C}_{ij}\,={\delta }_{ij}\mathop{\sum}\limits_{l}{S}_{l}{{{{\bf{v}}}}}_{i}^{T}{{{{\bf{J}}}}}_{ij}^{{\prime} }({{{\bf{0}}}}){{{{\bf{v}}}}}_{j},\\ {{{{\bf{J}}}}}_{ij}^{{\prime} }({{{\bf{k}}}})\,={R}_{{{{{\rm{\phi }}}}}_{{{{\rm{i}}}}}}^{T}{{{{\bf{J}}}}}_{ij}({{{\bf{k}}}}){R}_{{{{{\rm{\phi }}}}}_{{{{\rm{j}}}}}}.\end{array}$$
(10)

Since only the first-order terms of the boson operators are considered, equation (8) remains only as a linear approximation of equation (1). The details of obtaining equation (8) from equation (1) can be found in section 6 of Toth and Lake’s paper19.

Since the new Hamiltonian in Eq. (8) is a quadratic form of the bosonic operators, the matrix h(k) must be positive definite in addition to being Hermitian20. Hence, for a given set of fixed Jij, the vectors ui and vi (and thus the vectors \({\hat{{{{\bf{m}}}}}}_{i}\)) must be such that h(k) is positive definite for every vector k of the reciprocal lattice. Finally, when this condition is satisfied, the eigenvalues or spin-wave energies of H will be the positive eigenvalues of the matrix

$$L={K}^{{\dagger} }gK,$$
(11)

where h(k) = KK corresponds to a Cholesky decomposition and \(g=\left(\begin{array}{ll}I&0\\ 0&-I\end{array}\right)\) is a block matrix with the same dimensions as h(k). Therefore, the problem of finding the magnetic ground state becomes the problem of finding a magnetic structure that satisfies the positive definiteness condition of h(k) and minimizes the spin-wave energies.

Magnetic ground state workflow

Predicting a structure’s magnetic ground state begins with determining the exchange tensors from the Heisenberg model. Traditionally, fitting Eq. (1) to the total energy changes resulting from spin perturbations using DFT has been a common first-principles approach21. This involves generating multiple spin configurations and calculating their total energies. However, this method becomes computationally demanding for systems with numerous interactions, requiring many spin configurations. To overcome these challenges, we employ the LKAG Green’s function method15. This method has been extended to consider magnetic anisotropy and the Dzyaloshinskii-Moriya interaction (DMI)22,23. Using the Green’s function method, we can determine the exchange tensors with fewer single-point DFT calculations. Only one calculation is needed for the isotropic case, while up to six calculations are required for the anisotropic case. Our procedure involves running a DFT calculation to construct a tight-binding model and then utilizing Green’s function method to generate spin perturbations and calculate the exchange tensors efficiently. This approach allows us to predict a wide range of exchange tensors by performing a limited number of calculations, making it particularly advantageous for systems with many interactions and accurately predicting their magnetic properties.

To facilitate Green’s function method, we employ the TB2J package24, which automates the process using the output of various DFT codes. In our case, we utilize Siesta25 for the DFT calculations. Siesta’s basis set of localized atomic orbitals simplifies the construction of the tight-binding model, making it advantageous compared to DFT codes that employ a plane-wave basis set. Using TB2J with Siesta eliminates the need for another step to build Wannier functions, as discussed in Section 4.3.1 of the main TB2J paper24. Also, we note that to calculate the anisotropic exchange parameters and the DMI, the Siesta calculations need to include spin-orbit coupling corrections.

Once the exchange tensors are calculated, we leverage the information from the Heisenberg model to predict the magnetic ground state. As outlined in the precious section, our objective is to determine appropriate vectors ui, vi, and Q that yield a positive definite matrix h(k) and minimize the spin-wave energies. It is noteworthy that gh(k) represents the dynamical matrix associated with Eq. (8)26. Therefore, we focus on minimizing the eigenvalues of h(k) to determine the most favorable spin-wave energies.

First, we optimize the value of Q. The propagating vector k associated with a spin-wave mode can be taken from the first Brillouin zone. This motivates us to define the vector kmin that minimizes the eigenvalues of h. When kmin ≠ 0, there exists a spin-wave mode with lower energy than the magnetic structure given by Q. If this is the case, then Q is corrected by setting Q = kmin. Relative to the new supercell, we then get that kmin = 0. Next, we optimize the vectors ui and vi. Since ui and vi depend on the polar and azimuthal angles θi and ϕi that determine the orientation of mi, we define the function

$$f({{{\boldsymbol{\theta }}}},{{{\boldsymbol{\phi }}}})=\left\vert inf\,\left\{\lambda \ :\ h({{{\bf{0}}}}){{{\bf{x}}}}=\lambda {{{\bf{x}}}}\right\}\right\vert ,$$
(12)

where \({{{\boldsymbol{\theta }}}}=\left({\theta }_{1},\ldots ,{\theta }_{N}\right)\), \({{{\boldsymbol{\phi }}}}=\left({\phi }_{1},\ldots ,{\phi }_{N}\right)\), and N is the number of magnetic sites inside a unit cell. The previous step ensures that h(0) has the lowest eigenvalues; therefore, the values of θ and ϕ that give the magnetic ground state are obtained by finding the global minima of f. Here, both the propagation vector and the optimized angles are found by using the Basin-hopping global optimization technique as implemented in the Scipy package27.

The Green’s function method and LSWT impose an additional challenge since their results depend on how far the system is from the magnetic ground state (which is yet to be known). To address this challenge, we employ a self-consistency procedure. We start with an initial magnetic configuration, often chosen as ferromagnetic (Q = 0). We calculate the exchange tensors and optimize the values of Q, θ, and ϕ. If the optimized values lead to a magnetic configuration different from the previous one, we iterate the process. We calculate a new set of exchange tensors based on the updated magnetic configuration and obtain new values for Q, θ, and ϕ. We repeat this procedure until the optimized values of Q, θ, and ϕ yield the same magnetic configuration from which they were calculated (Fig. 1).

Fig. 1
figure 1

Magnetic ground state workflow.

It is important to note that any magnetic configuration with a nonzero Q requires using a supercell to represent it accurately. However, no supercell can contain the magnetic structure if the magnetic phase is incommensurate (i.e., Q has irrational components). We choose the closest commensurate supercell to approximate the magnetic structure in such cases. For example, if kmin = (0.2136324…, 0.0, 0.0) ≈ (1/5, 0, 0), then we can approximate the corresponding magnetic structure with a 5 × 1 × 1 supercell. To automatically generate the supercell, we define a neighborhood U of kmin such that the energies of the members of U differ from the energy of kmin by less than a cut-off value ϵ (usually ϵ = 0.5 meV, but this might depend on the system). Finally, we choose the member of U that gives the smallest supercell. Additionally, the supercells are chosen based on cut-off values that limit their dimensions and number of atoms. The size cut-off values will depend on the available computational resources, but we typically limit the supercells to having less than 120 atoms. Similarly, if there are points of the h(k) dispersion outside U that also have energies inside the ϵ cut-off window, we select the one that yields the smallest supercell.

Test cases

Here, we present our method applied to three magnetic materials: NiO, FePS3, and FeP. We chose these materials since they represent cases of interest: a simple collinear antiferromagnet (NiO), a 2D layered van der Waals material with interlayer interactions (FePS3), and a helimagnet with spin canting (FeP). We only included the isotropic interactions for the first two cases since the anisotropic components’ values are insignificant. In the third case, however, we find that the anisotropic exchange has a measurable effect on the predicted magnetic ground state. Furthermore, for every case, we considered interacting pairs within a 20 Å interacting distance.

We first apply our method to the well-known antiferromagnetic structure of FCC NiO. Initially, we consider the ferromagnetic configuration using the primitive cell. We focus on the isotropic exchange constants of magnetic pairs within a distance of 30 Å. Table 1 presents the values obtained for the nearest-neighbor (NN) and next-nearest-neighbor (NNN) interactions. Notably, the NNN interaction dominates the magnetism in NiO, contributing significantly more to the total energy than the NN interaction. This highlights the importance of considering interactions beyond the short range to accurately predict the magnetic properties of a system. Furthermore, we provide results from DFT and DFT+U calculations (see Table 1). We use U = 5.847 eV and J = 0.589 eV from the Materials Project Database28.

Table 1 Isotropic exchange constants for different magnetic configurations of NiO.

Given the isotropic exchange tensors, we calculate the dispersion relation of h(k) for the ferromagnetic configuration (Fig. 2a). For this case, every eigenvalue of h(k) is negative, implying the instability of NiO’s ferromagnetic state. Moreover, we see that h(k) has a minimum at kmin = (0.5, 0.5, 0.5) = L. Thus, our method predicts that the spin-spiral generated by the propagation vector (0.5, 0.5, 0.5) gives a more stable magnetic configuration at the L point. Hence, the exchange tensors and the spin dispersion are recomputed from this L point magnetic ordering. This is the reported magnetic structure from neutron scattering experiments29,30. The dispersion obtained by this configuration has nonnegative values with a global minimum at the Γ point (Fig. 2b), which shows that it is the final ground state from the self-consistency cycle (although L is also a global minimum, Γ yields the smallest supercell; see the discussion in “Magnetic Ground State Workflow”). Also, we note that we obtained the same magnetic structure for NiO when using both DFT and DFT+U despite the differences in the exchange constants.

Fig. 2: Dispersion relation of the matrix h(k) for FCC NiO.
figure 2

a Eigenvalues of a ferromagnetic configuration. b Eigenvalues corresponding to the predicted antiferromagnetic structure. The plots correspond to the U = 0 case.

Next, we apply our methodology to the quasi-two-dimensional antiferromagnet FePS3. Like the NiO case, we begin with the ferromagnetic configuration of the primitive cell (Fig. 4b left) and initially consider only the isotropic exchange interactions. In the Brillouin zone, h(k) exhibits negative eigenvalues for every k vector, indicating the instability of the ferromagnetic state (Fig. 3a), which compares to the positive values of the antiferromagnetic configuration. While both the Γ and Z ≔ (0, 0, 1/2) points appear as potential global minima of h(k), the Z point has a lower energy than Γ by a margin of 2.0 meV. Thus, our method suggests that the magnetic order associated with the reciprocal vector Q = (0, 0, 1/2) represents the state with the lowest energy.

Fig. 3: Dispersion relation of the matrix h(k) for layered FePS3.
figure 3

a Eigenvalues of a ferromagnetic configuration. b Eigenvalues corresponding to the predicted antiferromagnetic structure. The antiferromagnetic state is the one shown in Fig. 4b.

In the case of FePS3, selecting a new propagation vector does not ensure that h(k) becomes a positive definite matrix. The stability conditions are satisfied only by minimizing the function f defined in Eq. (12). After optimization, the angles for the unit cell of FePS3 with four magnetic atoms are θ = (0, 0, π, π) and ϕ = (0, 0, 0, 0). This indicates that the resulting magnetic configuration involves half of the Fe atoms in the unit cell having opposite magnetic moments (Fig. 4b right). The predicted antiferromagnetic structure of FePS3 with a propagation vector Q = (0, 0, 1/2) aligns with the findings from neutron scattering experiments31.

Fig. 4: Magnetic structure of layered FePS3.
figure 4

a Top view showing the intralayer interactions between the Fe atoms. b Ferromagnetic (left) and antiferromagnetic (right) structures of FePS3. Q = (0.0, 0.0, 0.5) is the propagation vector of the antiferromagnetic structure.

This example also allows us to discuss the robustness of our method, particularly in terms of the impact of variations in the exchange parameters on the predicted magnetic ground state. In a study conducted by Olsen32, it was found that the magnetic properties of FePS3 obtained with DFT+U strongly depend on the choice of the Hubbard parameter U. Here, we compare the results of our method using DFT+U with U = 0 and U = 3 eV (see Table 2). From the obtained exchange parameters, we also compute the magnon spectra (Fig. 5) for comparison. Our choice of U = 3 eV is made since this value gave the most accurate predictions in a recent FePS3 study32. Despite the significant differences in the exchange parameters and magnon spectra between these two cases (Fig. 5), both scenarios predict the same magnetic ground state as previously mentioned.

Table 2 Comparison of the exchange parameters of FePS3 obtained with different methods.
Fig. 5: Magnon energies of layered FePS3 for different U values.
figure 5

a Magnons of the U = 0 case. b Magnons of the U = 3 eV case. The chosen symmetry points are Γ = (0, 0, 0), N = (−1/2, 1/2, 0), P = (−1/2, 0, 0), Z = (0, 0, 1/2), and M = (0, 1/2, 0).

Moreover, we compare our calculated data with experimental results and other first principles studies. In Table 2, we show the values of the near neighbors’ isotropic interactions (Fig. 4a). The U = 3 eV agrees significantly better with the reported values than the U = 0 case. Also, we note that in contrast to other studies, we treat the J1, \({J}_{1}^{{\prime} }\) and J2, \({J}_{2}^{{\prime} }\) parameters independently (Fig. 4a), which can increase the differences between our values and the reported ones.

In our final example, we investigate the magnetic properties of FeP, a well-known helimagnet with orthorhombic symmetry (space group Pnmma). We examine the isotropic exchange interactions in the ferromagnetic state similar to the previous cases. We observe that the dispersion of h(k) exhibits negative eigenvalues and a global minimum at \({{{{\bf{k}}}}}_{\min }=(0.00,0.03,0.21)\) (Fig. 6a). This indicates the instability of the ferromagnetic configuration and aligns with the reported antiferromagnetic structure characterized by the propagation vector (0.0, 0.0, 0.2)33. From this, we automatically generate a 1 × 1 × 5 supercell (see the end of “Magnetic Ground State Workflow”) containing a spin spiral magnetic structure. Furthermore, we optimize the local magnetic moments within the unit cell from our workflow and obtain an alignment that resembles the double helix arrangement observed in FeP. Consequently, the resulting magnetic structure yields a positive definite matrix h(k) for all points in the Brillouin zone, with a global minimum at Γ (Fig. 6b).

Fig. 6: Dispersion relation of the matrix h(k) for the helimagnet FeP.
figure 6

a Eigenvalues of the ferromagnetic state. b Eigenvalues of the spiral antiferromagnetic prediction. Here Z = (0, 0, 1/2) and Y = (0, 1/2, 0).

Furthermore, we examined the impact of anisotropy on predicting the magnetic ground state in FeP. The exchange parameters are found in Table 3. When considering only the isotropic interactions, the optimized local magnetic moments in the unit cell align collinearly, with half of the magnetic moments pointing in the opposite direction to the other half (see Fig. 7). However, when we include both the anisotropic exchange and the Dzyaloshinskii–Moriya interaction (DMI), where the Jij matrices are not diagonal, the previously predicted collinear alignment is disrupted. Instead, a spin canting effect emerges, affecting half of the magnetic moments in the unit cell, causing them to rotate by an angle of θ = 4.19. This spin canting angle aligns with the findings of various experimental studies on FeP33,34, which report a value of ~4.

Table 3 Exchange parameters of FeP in units of meV.
Fig. 7: Top view of the basis for the double-helix of FeP.
figure 7

Only the Fe atoms are shown (gold balls). The local magnetic moments (red and blue arrows) were optimized by considering isotropic and anisotropic exchange interactions (a and b, respectively).

Further testing

The preceding examples illustrate how the method works in different scenarios, where the reported magnetic structures were successfully predicted. In addition to what has been presented, we tested our method with five additional materials: MnF2, FeCl2, CuO, CrSBr, and Mn5Si3. The main results are summarized in Table 4. The details of each calculation can be found in Supplementary Material.

Table 4 Total energy differences as obtained from DFT.

From all the tests that we performed, our method successfully predicted the structure of NiO, FePS3, FeP, MnF235, FeCl236, and CuO37,38,39. On the other hand, our method predicts a ferromagnetic structure for both CrSBr40,41 and Mn5Si342 in contrast with the available experimental data. However, we notice that our predictions are lower in energy than the experimental structures for the specific parameters that were used on each calculation. Thus, although we fail to predict the reported structure, our prediction is closer to the DFT ground state. In other words, our method as presented cannot give a better prediction than DFT allows since we compute the exchange tensors from DFT. Additionally, we mention that for CuO the spin-ligand correction as implemented in TB2J was necessary to correctly predict the experimental magnetic structure.

Discussion

It is essential to acknowledge certain limitations of the Heisenberg model, which may render it less ideal for determining the absolute ground state of a material. One fundamental assumption of the Heisenberg model is that the interaction parameters are independent of the spin state, which may not hold for all materials. In some cases, materials can exhibit substantial deviations from the Heisenberg model, and their behavior cannot be adequately described by this simplified framework. As a result, the predicted ground state from the Heisenberg model may deviate from the actual ground state observed experimentally. For such cases, higher-order spin-spin interactions, such as three-sites (four-spin) or even four-sites (six-spin) interactions, may be necessary to describe the system dynamics accurately43,44,45,46. A method exists to compute the high-order terms with Green’s function method47, and thus we could potentially include this in our workflow. Nonetheless, the many terms involved make it computationally demanding and difficult to use.

Additionally, we remark that a fundamental issue raised in using the Heisenberg Hamiltonian comes from evaluating the “magnetic moment of an atom" in a crystal. This is because the ways of assigning the spins to the atoms are not unique. The usual way is to use atomic-centered basis set functions, as in the case of muffin-tin spheres, Wannier functions24,48, or numerical atomic orbitals24,49. Here, it is assumed that the magnetic moments within the basis functions of one atom rotate uniformly. This is not always a good approximation as these functions can spread out of the region away from the atomic center.

On the other hand, the unpaired spins may also not be included in these functions, for example, in the ligands, which could lead to an incomplete Heisenberg model. This can sometimes give the wrong sign of the exchange parameters when the ligand-spin strongly affects the magnetic interaction50. This could potentially lead to the wrong ground state prediction of the Heisenberg model even if DFT is at its ground state (i.e., the predicted structure has a higher total energy). The parameters obtained with the magnetic force theorem are only exact in the strong-coupled limit and the rigid-spin approximation15. Many corrections have been proposed to improve the Heisenberg models from the magnetic force theorem. For example, including the ligand spin effect50 could improve the prediction accuracy once they are included in our workflow.

While the Heisenberg model may not yield the exact ground state, it offers a reasonable approximation and a helpful starting point for exploring the system’s energy landscape. Researchers can leverage the predicted ground state as a guide to search for lower energy configurations and gain valuable insights into the material’s magnetic properties. Furthermore, the MFT method can be utilized to estimate the exchange parameters, which are often close to the reference state, enhancing the accuracy of the predictions and providing valuable information for further investigations.

Even if the Heisenberg model gives a perfect picture of a system, our method still encounters other limitations. One comes from the MFT giving exact results only in the limit of infinite wavelength magnons51. To account for this, Bruno51 showed that a renormalization approach enhances the accuracy of the MFT predictions. At the moment, this has not been implemented in the TB2J code, but we plan to incorporate it into our workflow in a future version.

Another limitation arises because the LSWT method we used assumes a single q-state, which does not hold for systems with a ground state with multiple propagation vectors52. For the multiple q-states, our method could still potentially generate a supercell that encloses all propagation vectors, and then each individual magnetic moment within the unit cell could be optimized by following our proposed scheme. Furthermore, even if for the single q-states, the supercell approach cannot deal with incommensurate magnetic structures. An alternative would be to use DFT with the generalized Bloch theorem (GBT). This could also make our workflow more efficient since we only use the unit cell in the calculations. However, the GBT only works for isotropic structures (where the spin-orbit coupling is negligible), and thus the supercell approach would still be preferred for many cases.

Lastly, we mention that the current stage of our workflow does not include single-ion anisotropy (SIA). For most bulk systems, this has a negligible effect, but it can be crucial in the one and two-dimensional limits53. The addition of the SIA to TB2J is currently under development, but we plan to incorporate this into our workflow in the future.

In this study, we have presented a self-consistent method based on first-principles calculations to determine the magnetic ground state of materials, regardless of their dimensionality. Our methodology is founded on satisfying the stability conditions derived from the linear spin wave theory (LSWT) by optimizing the magnetic structure iteratively. It enables the consideration of isotropic and anisotropic exchange interactions and the Dzyaloshinskii-Moriya interaction (DMI). We have incorporated Green’s function method using the TB2J-Siesta codes interface to enhance efficiency. This interface, implemented with AiiDA54,55, offers a user-friendly workflow that ensures convergence and improves variables as necessary to achieve the desired level of convergence. We demonstrated the effectiveness of our method by successfully predicting the experimental magnetic structures of NiO, FePS3, FeP, MnF2, FeCl2, and CuO. In each case, we compared our results with available experimental data and theoretical calculations reported in the literature. Furthermore, our methodology can be easily combined with phonon calculations56, enabling a comprehensive approach to investigate magnons’ influence on materials’ thermal properties. Overall, our self-consistent approach provides a reliable and versatile framework for studying magnetic ground states and can contribute to advancing our understanding of the magnetic properties of diverse materials. As magnetic materials are correlated systems, the correlation effects can be accounted for by considering DFT+U. The U and J parameters from DFT+U can be passed as inputs to the workflow where they will have an impact on the results.

We emphasize that various materials’ properties may be quite sensitive to the exact nature of the magnetic ground state. These properties include atomic vibrations (phonons) through the spin-phonon coupling57,58; elastic properties through the magnetoelastic coefficients59; magnon-magnon interactions60,61; magnetothermal response62; magnon-polaron interaction63; and even optical properties, such as the magnon-exciton coupling64. Therefore, knowing the magnetic ground state will improve our understanding of those materials.

Methods

Computational details

All the DFT calculations are performed with the Siesta code25, while the LKAG method is implemented within the TB2J code24. We use the Siesta version that can compute the Hubbard model corrections with spin-orbit coupling65. We use norm-conserving fully relativistic pseudo-potentials taken from the Pseudo-Dojo database66 in the psml format67. In all our calculations, we use the exchange-correlation functional given by the general gradient approximation (GGA) as parametrized by Perdew, Burke, and Ernzerhof68. The optimized k-point grids for each test case are 13 × 13 × 13 (NiO), 8 × 4 × 8 (FePS3), and 12 × 7 × 7 (FeP). For all cases, we use a mesh-cutoff energy of 400 Ry. Also, we use a double-zeta polarized LCAO basis automatically generated by Siesta. We optimize the geometry of every structure by allowing a maximum force on each atom of 0.01 eV Å−1. Additionally, we perform the LSWT calculations with the NumPy library69. Finally, all the structure models were drawn with the VESTA code70, while the rest of the graphs were generated with the Matplotlib library71.