## Introduction

Modern high-performance computing has allowed the simulation of crystalline materials and their properties on an unprecedented scale, allowing the construction of large computational materials databases, including the Materials Project and its database of over 86,000 inorganic materials and associated properties.1 These computational databases have led to real-world, experimentally verified advances in state-of-the-art materials design.2

Magnetic materials, in this context meaning an inorganic, crystalline material with a magnetically ordered ground state at 0 K, are of particular interest both due to their wide range of potential applications, such as data storage, spintronic devices,3,4 memristors,5 magnetocaloric-based refrigeration6 and more, and are also of significant interest because of the diversity of fundamental physics at play, including the relation between magnetic order and superconductivity,7,8,9 multiferroic systems10,11 and skyrmions.12

However, despite their importance, magnetic materials have been largely neglected from high-throughput materials computations due to their complexity, with no systematic method employed to explore the magnetic landscape, in particular identifying the ground state of a material from first principles. Previous efforts at high-throughput computation of non-ferromagnetic magnetic materials have been restricted to specific crystal symmetries and specific pre-determined magnetic orderings13 or have only considered simple antiferromagnetic orderings,14 rather than ferrimagnetic orderings or orderings consisting of multiple magnetic sub-lattices, although a sophisticated treatment of paramagnetic phases has been considered15 in addition to the antiferromagnetic cases.

As we will demonstrate in this paper, restricting a search to only a few antiferromagnetic orderings can often lead to an erroneous determination of the ground state magnetic ordering, and justifies a more systematic approach. Currently, the Materials Project database does itself contain a large number of magnetic materials as illustrated in Fig. 1, but the vast majority of these (31,631 of 33,986) are in a ferromagnetic configuration, with only a few well-known antiferromagnetic or ferrimagnetic materials present. While many of these materials might indeed have a ferromagnetic ground state, many materials will exhibit antiferromagnetic or more complex magnetic ground states. Not only will this mean a reported erroneous ground state energy, but also that investigative screening for magnetic properties will be limited in scope.

Density Functional Theory has become the de facto tool for calculating material properties due to its efficiency, scalability, and maturity. Within the DFT framework, magnetism can either be neglected completely, be considered in a restricted collinear, non-spin–orbit-coupled case, or include non-collinearity and spin–orbit coupling. In the non-spin–orbit-coupled, collinear case, the total energy of the system is invariant to the rotation of the spins relative to crystallographic cell, and thus the magnetic moments can only be expressed purely as scalar quantities. The non-collinear case, though performed routinely for individual materials, often requires 1–2 orders of magnitude longer computation time, both due to the inclusion of the full spin-density matrix, and also due to reduced symmetry of the system. This places a restriction on the methods available for a high-throughput workflow, and means that a full DFT-based workflow using non-collinear calculations is currently inaccessible. The challenge of high-throughput computation is to find a sufficient compromise such that calculations can be completed in a reliable and timely manner, while also obtaining results that are scientifically useful for the purpose at hand. For many screenings, this purpose might not require absolute accuracy, but rather a low number of false data points such that overall trends are still correct.

In the present study, we therefore present a workflow based on purely collinear DFT simulations with the modest but crucial goal of determining whether a material is ferromagnetic or not in a high-throughput context, and then of attempting to find the ground state magnetic order of a given material at 0 K, presupposing that such a ground state exhibits collinear spin.

The two key advances addressed in this paper are as follows. Firstly, we propose and implement a scheme for enumerating plausible magnetic orderings for a given material, and decide on a ranking for prioritizing calculations. Secondly, we evaluate these generated orderings using a workflow based on conventional DFT + U for a set of well-established magnetic materials, store the differences in energy between the calculated orderings and thus determine the ground-state ordering predicted by DFT.

## Results and discussion

Benchmark structures were drawn from the magndata16 database of magnetic structures. magndata is currently the largest high-quality database of experimentally known magnetic structures, typically determined using neutron powder diffraction. The database consists of a rich cross section of magnetic orderings and also includes, in most cases, the associated magnitude of atomic magnetic moments, although in some instances only direction is known. Some of the entries in the database were deemed unsuitable for the present study, due to either (i) non-collinearity or incommensurate magnetic order, (ii) partial occupancies, or (iii) elements present that are known to be not well described by DFT. As such, a subset of ordered, collinear structures was selected to evaluate our ordering algorithm and workflow. This benchmark set was selected to cover a wide variety of crystallographic structures including spinels and inverse spinels (e.g. Al2CoO4), perovskites and double perovskites (e.g. NaOsO3, EuTiO3), rutiles (e.g. MnF2, Cr2TeO6), corundums and ilmenites (e.g. Cr2O3, TiMnO3), rock salts (NiO, CoO and MnO), and layered and quasi-layered materials (e.g. VClO). In particular, magnetic materials both from well-known, well-understood materials systems, and also lesser-studied magnetic materials, such as those containing Ru or Os, were included to ensure a representative benchmark set. Although f-block elements are notoriously difficult to calculate accurately, Gd and Eu were also included, since these were found to reliably sustain a magnetic moment using the standard VASP pseudopotentials and Materials Project settings. Additionally, both ferrimagnetic materials and materials with multiple magnetic sub-lattices of different elements were included, since these represent particularly complex cases for the enumeration algorithm.

As an initial validation step, the known experimental ground states were computed using the standard DFT workflows found in atomate. Predicted atomic magnetic moments were found to agree well with experimental observation across both a wide range elements and oxidation states, as shown in Fig. 2. A common feature is that the predicted moments were found to cluster around specific values associated with distinct oxidation states in contrast to the wider spread of experimental values, though this spread in experimental values might in part be due to the simulated annealing method commonly used to experimentally determine these moments,17 which is sensitive to noise, peak broadening, and other factors, while the clustering in calculated values is a result of exchange-correlation functional used. There were a few notable failures: while Eu was found to be well-described in that it reliably sustained a magnetic moment and the desired orderings, Gd was not as discussed later, at least among the materials in the benchmark set. This suggests future work suggests future work to better optimize U values and pseudopotentials for Gd. There were two cases where DFT significantly overestimated the magnetic moment including NaFe(SiO3)3 (aegirine), which is a material that exhibits a degeneracy between two different types of magnetic order including an incommensurate phase,18 and LaCrAsO. The latter which belongs to a family of materials important for their superconducting properties and which has proven difficult in previous computational studies,19 although the current workflow did successfully predict the antiparallel spin coupling between adjacent CrAs planes.

To test the workflow enumeration algorithm, we ensure that it successfully generates and then ranks the experimental ground state ordering for the selected materials. This is important irrespective of the performance of how the total energy of each ordering is obtained, whether by DFT or otherwise, since the enumeration of the experimental ordering is necessary to evaluate the general ability of the algorithm to find any collinear ordering, and how many different orderings will need to be attempted before the ordering for the true ground state is trialed. An efficient enumeration algorithm necessarily ensures that most experimentally determined ground states are among the highest ranked enumerated orderings. This is found to be the case, as illustrated in Fig. 3. The enumerated orderings are sorted by symmetry, with the first enumerated ordering is always the ferromagnetic case since it is the most symmetrical. Since simple ferromagnetic materials are excluded from this test set, the most likely ordering is at the second index, which is the most symmetrical antiferromagnetic ordering. Subsequently, the distribution matches the desired behavior of the algorithm, with the probability of finding a ground state decreasing as enumeration index increases. The distribution of ground state orderings exhibits a long tail, with the experimental ordering being found as the tenth enumerated ordering in some cases. With this, two distinct cut-offs are proposed that should provide a reasonable chance of enumerating the ground state ordering in most cases. The first cut-off is a soft cut-off of eight orderings, however, if multiple orderings are found with equal symmetry at this index, additional orderings are considered until a hard cut-off of 16 orderings. The exact number of orderings considered will vary depending on the size of the unit cell, number of symmetrically distinct possible magnetic sites in that unit cell, Nsites, and number of magnetic elements present. For the present benchmark this is set to consider a supercell Nsupercells times larger than the primitive cell up to the limit of $$N_{{\mathrm{supercells}}} = \left\lceil {4/N_{{\mathrm{sites}}}} \right\rceil$$, such that a sufficient number of supercells will be considered for materials with small primitive cells, while the enumeration algorithm will still complete for materials with large primitive cells. These thresholds ensure that in a high-throughput context not too many spurious calculations are performed, however it does not exclude the possibility to use the enumeration algorithm with much larger cut-offs in the case of specific materials should they be of particular interest. Figure 3 also shows distribution of indices where the DFT-predicted ground state is found after the workflow is run. Though these distributions do not match exactly, the broad distribution of DFT ground state indices closely resembles that of the experimental indices, as would be expected if the workflow performs well.

In addition to modifying the choice of maximum supercell size and cut-offs for number of orderings to attempt, the workflow as-written is fully customizable. Users can supply their own mapping of elements to magnetic moment to run the workflow in an additional low-spin configuration, supply their own U values, or enable spin–orbit coupling, which are choices that might be more appropriate for use of the workflow in a low-throughput context.

From the benchmark set, the ability of the workflow to accurately predict the experimental ground-state ordering for each individual benchmark material is summarized in Table 1, where μmax. refers to the maximum atomic magnetic moment determined by experiment or from the ground state predicted by DFT, and ΔE refers to the difference in energy between the predicted ground state ordering and either the calculated energy for the known experimental ordering (expt.) or the calculated energy for the ferromagnetic ordering (FM). Figure 4 shows the total energies of all orderings considered in this benchmark, where each graph represents a distinct material, and with each point representing the energy of a distinct magnetic ordering as a function of the enumeration index. Due to the behavior of the enumeration algorithm, the symmetry tends to decrease along the x-axis, although two adjacent points may exhibit equivalent symmetry. Total energies are normalized to the ferromagnetic ordering in all cases. We note that the energy scale is highly dependent on the specific material, such that the magnetic ordering energy differences range from hundreds of meV to only a few meV per atom. In these later cases, surprisingly, the ground state ordering is often still determined correctly, presumably due to systematic cancellation of errors as a result of a consistent set of simulation parameters being applied across the different orderings. Calculations with very small energy differences between different orderings should be treated with a skepticism, since the absolute energy differences are likely meaningless, for example the cases of Ba2CoGe2O7, YCr(BO3)2, and Li2VSiO5. However, this information is still of interest, since the low sensitivity of total energy to magnetic order might indicate a low transition temperature. Indeed, in these three cases, the materials are only magnetic at very low temperatures and are paramagnetic above 7,20 821 and 3 K22 respectively.

The workflow successfully predicts the experimental ground state in over 60% of the materials benchmarked. In many cases, there are multiple orderings that exhibit very similar energies, and indeed, in nine materials the experimentally determined ground state is found to be very close in energy to the ground state ordering predicted by DFT (these materials are indicated in blue in Fig. 4). As an example, SrRu2O6 is a material with a quasi-two-dimensional honeycomb magnetic lattice of Ru atoms separated by layers of Sr atoms, and as such exhibits very weak interlayer coupling, as confirmed by RPA calculations of this material.23 This is reflected in the workflow results where, even though the predicted ground state ordering did match the experimental ordering, there was a second ordering of very similar energy with the same in-plane magnetic ordering but with different interlayer stacking. Likewise, a case where the predicted ground state did not match experiment is the layered material VClO, where similarly the magnetic in-plane ordering is predicted correctly but the interlayer stacking is different.

Where there is outright disagreement between experiment and computational predictions, there are three main interpretations. Most likely the theoretical prediction itself is in error given the relative coarseness of the high-throughput approach, the nature of the exchange-correlation functionals used and the fixed Hubbard corrections. However, an additional possibility, though unlikely given the robustness and maturity of the neutron diffraction technique, is that experimental measurement or its interpretation may be incorrect. This is especially true considering that many theoretical studies in support of experimental work do not consider orderings beyond the common A-, C- and G-type AFM orderings. As an example of this, consider the case of EuTiO3 which, in our workflow, has a significantly lower energy striped magnetic ordering (two planes of spin-up alternating with two planes of spin-down Eu ions) than the higher symmetry A, C, and G phases previously considered in the literature.24 While this specific case could be spurious due to strong dependence on Hubbard U term,24 it does highlight the value in exploring these lower-symmetry orderings. Finally, disagreement between experiment and workflow predictions might simply be a result of other factors, such as grown-in strain or impurities present in the experimental samples.

Other notable failures of the workflow include Gd2CuO4 which is an example of a class of CuO2 planar compounds important for their superconducting properties, and which exhibits magnetic ordering on both the Cu and Gd sites. While the enumeration algorithm produced plausible inputs in this case, few of the orderings were stable during the electronic state minimization. This is a common failure mode for some materials, which results in many of the magnetic orderings spontaneously relaxing to a non-magnetic configuration. In the case of Gd2CuO4 the predicted ground state possesses two down-spin Gd ions to a single up-spin Gd ion, due to the frustration between Gd atoms, and without a sustained magnetic moment on the Cu ion. We therefore conclude that while the enumeration algorithm and machinery of the workflow are appropriate for this material, the specific choice of pseudopotentials and U values are not, and that further improvement in electronic parameter choices is required before this workflow can be confidently applied to rare-earth magnetic materials. V2CoO6 is an example of a material that, although successfully matched experiment, does highlight a weakness of the workflow in that a magnetic moment was incorrectly initialized on the V site, even though after electronic minimization this moment relaxed to zero.

While, in general, the magnetic ordering after electronic minimization matches that of the initial magnetic ordering, some materials relax spontaneously to their ground state, such as MnCuO2 and NaOsO3, where this latter material would not even sustain a ferromagnetic configuration. As previously discussed, in the case of several materials, the experimentally determined ground states were not determined as the exact ground state by the workflow, but were very similar in energy, where similar here is defined as within an arbitrary window of 0.2 ΔEFM. For example the case of ferrimagnetic Ni3TeO6 or of CaMnBi2, where two orderings are seen to be significantly lower in energy than the other orderings, including the DFT-determined ground state and the experimentally determined ground state. We mark these cases as partial successes of the workflow.

Determining the correct ground state can also lead to improved estimation of band gaps, magnetic moments, and formation enthalpies and other properties, as detailed in Supplementary Figs. 1 and 2 and Supplementary Tables 13. While optical properties were not explicitly included in these calculations, the calculations provide an approximate Kohn–Sham gap which can give an estimate of the optical band gap. While many materials that have metallic character in their ferromagnetic configuration, are correctly semiconducting in their predicted magnetic ground state ordering. In the case of formation energies, we also see an improvement, notably in the case of CrN, which has an experimental formation enthalpy of −0.65 eV/atom,14,25 while we calculate a value of −0.55 eV/atom in the ferromagnetic case compared to −0.67 eV/atom in its ground state ordering. Determination of the magnetic ground state is therefore an important initial step before high-throughput calculation of additional properties should be attempted.

This workflow and supporting analyses opens up opportunities for screening based on magnetic properties, and provide a starting point for the investigation of magnetic materials previously unstudied by experimental techniques. Future work includes the consideration of materials whose magnetic ground state is non-collinear or that is highly sensitive to spin–orbit coupling effects, and further optimization of the workflow parameters including choice of functional and U values. All of the results from this study are available on the Materials Project website at materialsproject.org, including interactive representations of the data in this paper. Iterative improvements to this workflow will be communicated in the atomate documentation and Materials Project wiki. The magnetic structures in this paper and additional future outputs from this workflow will also be available via the Materials Project public API and website.

## Methods

The workflow presented here is distributed with the atomate26 code, which provides a suite of tested, reusable workflows to calculate a variety of materials properties. These workflows are written as computational ‘recipes’ that use the FireWorks workflow management code,27 which enables the workflows to be managed in a central database and integrates with many high-performance computing systems to enable easy management and tracking of calculations. The outputs of an atomate workflow are then stored in a document-based database for later analysis. In this case, an input structure is provided to the workflow, a series of magnetic orderings is generated, and then for each ordering a structural relaxation and high-quality static calculation are performed using Density Functional Theory with the Vienna Ab Initio Simulation Package (VASP) and their results stored in the database. This is followed by a final analysis step, which determines the lowest-energy ordering and characterizes the output with additional useful information, such as the final type of magnetic ordering present (ferromagnetic, antiferromagnetic, ferrimagnetic, or non-magnetic), the magnitude of atomic magnetic moments, and whether any symmetry breaking has occurred. The overall workflow is summarized in Fig. 5. The input structure can be any periodic crystallographic structure and does not need to be annotated with magnetic moments. Plausible magnetic moments will be generated by the Python-based pymatgen analysis code28 and through use of a new MagneticStructureAnalyzer class. Additionally, the capability to input a structure directly from its magnetic space group, based on the magnetic symmetry data tables of Stokes and Campbell,29 or from a magnetic CIF file has also been added for the purposes of this workflow.

In general, prior to any DFT relaxation, it is desirable to assign plausible initial atomic positions and lattice parameters to promote convergence to the global minimum. Similarly, the initial choice of magnetic moments used to prime the electronic minimizer is of crucial importance. While the size and, sometimes, sign of the magnetic moments will change during a self-consistent electronic minimization procedure, local magneto-structural minima can be difficult to escape. To appropriately sample this space, a set of different initial magnetic moments corresponding to distinct magnetic orderings are generated and each of them calculated independently. The heuristic rule for ferromagnetic orderings is to initialize the system with moments set at or above their high-spin configuration, since it is generally true that a high-spin state will relax to a low-spin state, while a low-spin state will not relax to a high-spin state even if that state is lower in energy. This can be seen illustrated in Fig. 1 where existing high-throughput calculations of materials, all initialized in a high-spin configuration, routinely relax to lower-spin states. Despite this, there will still be cases where a more energetically favorable low-spin configuration might be missed by the electronic minimizer and this is a compromise made in the workflow, although it is designed such that the choice of spin magnitude is easy to customize should a user wish to explicitly include low-spin configurations. In addition to high-spin and low-spin cases, the possibility of zero-spin must also be considered, and this is explicitly included in our workflow. For example, it is possible for the moments on one site to quench the moments on another site such that a configuration, where both sites are initialized with finite moments will result in a higher total energy than if one site is initialized with no moment at all. This exact situation has lead to results inconsistent with experiment and can cause significant misunderstanding,30 but we have found that including a combination of high spin and zero spin initial moments can successfully avoid this issue.

The chosen workflow strategy is to sample this configuration space systematically to maximize the likelihood of finding the true ground state. As previously mentioned, to reduce the degrees of freedom, we restrict our search space to collinear magnetic states. However, it is important to note that this domain still—in principle—contains an infinite number of magnetic orderings, which requires the workflow to set limits and contain a priori prioritization schemes. There are many heuristics and theories for estimating, which magnetic ordering would be the ground state of a given material, such as the Goodenough–Kanamori–Anderson rules, but many of these heuristics rely on chemical intuition that is not necessarily available in a high-throughput context. For example, the oxidation state of a species in a given material is often not known with certainty, and though algorithms exist that can guess what oxidation states are present, such as the bond valence analyzer algorithm found in pymatgen,28 these often fail, including in several cases of important magnetic materials such as inverse spinels. Therefore any strategy for prioritizing magnetic orderings has to be systematic and robust to work at scale and without human intervention. These chemically based heuristics also have known counter examples, which also supports a more systematic approach to enumerating orderings.

The choice made here is to prioritize the most symmetrical magnetic orderings first, provided that they satisfy certain constraints. The algorithms involved in enumerating different magnetic orderings of a given crystal structure are not dissimilar to algorithms for creating ordered approximations of a crystal with partial site occupancies. Leveraging this analogy, we first consider the sites that are potentially magnetic and then construct a co-incident lattice of fictitious dummy ‘spin’ atoms. These sites hold a certain percentage of spin-up dummy atoms and the corresponding percentage of spin-down dummy atoms, where the percentage of up to down spins is referred to as the ‘ordering parameter’ of that site. We refer to this crystal structure including dummy ‘spin’ atoms as a template.

In the case of a simple antiferromagnetic material it is often sufficient to define a global ordering parameter of 0.5 on the magnetic sites and perform the enumeration, or an ordering parameter of 1 for the ferromagnetic case. However, a global ordering parameter is not appropriate for more complex cases. For example, in a case of ferrimagnetism, a global ordering parameter would depend on the number of atoms in each respective magnetic sub-lattice. For example, the postspinel Mn3O431 exhibits two symmetrically in-equivalent Mn sites. Here, the distinct magnetic sub-lattices are both of the same element, although in different oxidation states. The Mn(III) site orders antiferromagnetically, so magnetic moments on this sub-lattice would be generated using an ordering parameter of 0.5, while the Mn(II) site orders ferromagnetically, which requires an ordering parameter of 1 on its sub-lattice. Therefore, to obtain our templates with the correct ordering parameters for the correct sites, multiple strategies are employed that identify these different sub-lattices, whether by the site symmetry, structural motif32 or by the element present, and apply different combinations of ordering parameter to each, allowing each sub-lattice either to be non-magnetic (zero initial spin), ferromagnetic, or antiferromagnetic. Overall, this also allows for the case of ferrimagnetic materials, which can be defined as multiple antiferromagnetic and/or ferromagnetic sub-lattices.

For each template, an enumeration algorithm is then applied. The algorithm is implemented in the pymatgen28 code and builds upon existing functionality that makes use of the enumlib33 enumeration library and spglib34 symmetry analysis libraries. This produces a set of symmetrically distinct crystal structures where each magnetic site is occupied either by a spin-up or spin-down dummy atom. With reference to the element on each site, the dummy atom is then removed, and the underlying site assigned an element-specific spin magnitude.

This collection of distinct magnetic orderings generated from each template are combined into a single list and sorted from most symmetrical to least symmetrical, with the most symmetrical orderings prioritized for calculation. Here, “most symmetrical” is taken simply to mean structures whose space group (determined with spin included as a site coloring to distinguish between otherwise symmetrically equivalent sites) contains the largest number of symmetry operations, and if the number of symmetry operations is equal, they are considered equally symmetric. This sorting of magnetic orderings defines the “enumeration index” in subsequent discussion.

The workflow performs DFT calculations on each ordering using the VASP35,36 code with the PBE exchange-correlational functional and a set of input parameters established by the Materials Project to yield well-converged results in most cases. The only change made to these parameters is to increase the criteria for force convergence, to ensure aspherical contributions are always included in the gradient corrections inside the PAW spheres, and not to use VASP’s in-built symmetrization optimizations. In particular, a common set of standard Hubbard U corrections used by the Materials Project is adopted here, including for corrections for elements Co (3.32 eV), Cr (3.7 eV), Fe (5.3 eV), Mn (3.9 eV), Ni (6.2 eV), and V (3.25 eV). These Hubbard U corrections are included to reduce the error associated with strong on-site Coulomb interactions with standard PBE DFT, and were fitted to reduce the error in a set of known binary formation enthalpies.37 In particular, the workflow uses the rotationally invariant Dudarev form of the Hubbard corrections. This approach will necessarily be insufficient to capture many subtle magnetic properties especially for non-collinear systems or systems where magnetocrystalline anisotropy is significant. In the present study, this standard set of Hubbard U corrections is maintained in the hope that it will be sufficiently transferable to magnetic properties given that there are significant benefits to using the same consistent set of U values as the current Materials Project database, since it allows for seamless integration of energies within the current GGA/GGA + U mixing scheme and therefore of workflow outputs into existing Materials Project functionality, such as the construction of phase diagrams.

During relaxation, the material’s symmetry is allowed to change, followed by a higher quality static calculation with a finer k-point mesh to allow a more accurate total energy evaluation. Future improvements may be to add a dynamic pre-filter step whereby static calculations are performed first to screen out very high-energy configurations before the more computationally expensive geometry optimization is performed.

While the total magnetization of a supercell is calculated using DFT that is well-defined, there are multiple methods for obtaining site-projected magnetic moments. VASP’s native method is to integrate the charge density around an element-specific radius, but this has the unfortunate consequence that the sum of site moments does not match the total magnetization and is also more subject to noise. Here we adopt a method shown to provide good results38 based on integrating the charge difference found within a Bader basin. Since the magnetization density is typically very localized, this method is found to be robust and superior to VASP’s native integration method. This method was implemented for the present study in the pymatgen code, and uses the Henkelman Bader39 code to perform the Bader partitioning.