Abstract
Ab initio molecular dynamics (AIMD) simulation is widely employed in studying diffusion mechanisms and in quantifying diffusional properties of materials. However, AIMD simulations are often limited to a few hundred atoms and a short, subnanosecond physical timescale, which leads to models that include only a limited number of diffusion events. As a result, the diffusional properties obtained from AIMD simulations are often plagued by poor statistics. In this paper, we reexamine the process to estimate diffusivity and ionic conductivity from the AIMD simulations and establish the procedure to minimize the fitting errors. In addition, we propose methods for quantifying the statistical variance of the diffusivity and ionic conductivity from the number of diffusion events observed during the AIMD simulation. Since an adequate number of diffusion events must be sampled, AIMD simulations should be sufficiently long and can only be performed on materials with reasonably fast diffusion. We chart the ranges of materials and physical conditions that can be accessible by AIMD simulations in studying diffusional properties. Our work provides the foundation for quantifying the statistical confidence levels of diffusion results from AIMD simulations and for correctly employing this powerful technique.
Introduction
As a powerful modeling technique, ab initio molecular dynamics (AIMD) simulation has been recently applied to a wide range of research topics in chemistry and materials science.^{1,2,3,4} AIMD simulations are carried out using the potential energy surface and atomistic forces calculated from ab initio methods, such as density functional theory (DFT), and model the dynamics of atomistic systems with ab initio level of accuracy and chemical versatility. This accuracy is lacking in classical molecular dynamics (MD) simulations, which are based on interatomic potentials (a.k.a. force fields). In addition, the limited availability of reliable interatomic potentials for studying new materials greatly limits the applicability and chemical versatility of classical MD simulations. Therefore, AIMD simulation is the method of choice for studying the dynamics of atoms with complex chemistry changes and simulating materials that cannot be described by available interatomic potentials. The wide applicability of AIMD simulations has been successfully demonstrated in studies of diffusional properties,^{5,6,7,8,9} reaction processes,^{10,11} vibrational frequency,^{12,13,14} amorphous materials,^{15,16,17} phase transition,^{18} etc.
Mo et al.^{5} pioneered the application of AIMD simulations to the study of ionic diffusion in lithium ionic conductor materials, such as Li_{10}GeP_{2}S_{12} (LGPS). Since then, AIMD simulation has been widely adopted as a standard technique for studying fast ionic conductor materials with a wide range of mobile species (e.g., Li^{+}, Na^{+}, Mg^{2+}, O^{2−}).^{6,7,19,20,21,22,23} Both ab initio and classical MD simulations model the realtime dynamics of atoms with a femtosecondscale time resolution, which is difficult to directly obtain from experimental characterizations or from other nonMD computational methods. Due to their ab initio level of accuracy and chemical versatility, AIMD simulations provide more accurate quantification of diffusion properties than classical MD and have a unique ability to predict new diffusion mechanisms. AIMD simulation technique has achieved great successes in identifying diffusion mechanism at the atomistic scale and in quantifying the diffusional properties.
Major advantages of AIMD simulations (as well as classical MD simulations) are that the diffusion events, i.e., atom/ion hops, in the materials are directly observed from the dynamics and trajectory of atoms and that specific diffusion mechanism is not presumed as calculation input. In contrast, the widely used nudgedelasticband (NEB) calculations only obtain the energy barrier of a specific static migration pathway and require the pathway as input. That NEB input pathway is often derived from the guess of the researchers. The prior guess of diffusion mechanism may be difficult for complex materials such as superionic conductors, where the mobileion sublattice is highly disordered. For example, recent AIMD simulations identified that the diffusion mechanism in lithium superionic conductors, such as thioLISICON^{9,24} and lithium garnet,^{9,25,26} is a concerted migration of multiple ions rather than isolated ion hopping. AIMD simulations played unique roles in uncovering and identifying these concerted migration mechanisms, whereas isolated ion hopping was often assumed for previous NEB calculations. In addition, AIMD simulations sample the statistical contributions of all diffusional events and obtain diffusional properties such as diffusivity and ionic conductivity from the collective contributions of all different diffusion modes. In addition, performing AIMD simulations at different temperatures obtains the Arrhenius relation of diffusivity and ionic conductivity, including the prefactor and overall activation energy, which is similar to experimental measurements.
However, the high computational expenses of ab initio calculations limit the accessible length scale and timescale of AIMD simulations. The small system size and short physical time scale are major shortcomings of AIMD simulations when compared to classical MD simulations.^{27,28} Even on stateoftheart supercomputing facilities, typical AIMD simulations are limited to a system size of a few hundred atoms and a total physical time duration of tens to thousands of picoseconds. As a result, a limited number of diffusion events, i.e., ion hops, are observed during an AIMD simulation. The limited sampling of diffusion events may lead to significant statistical variances in calculated diffusional properties or even, if only a few ion hops are sampled, to erroneous values.
As AIMD simulation has become a widely used technique in studying diffusion mechanisms and in quantifying diffusional properties of materials, the procedures for applying AIMD simulations to extract diffusional properties need to be systematically established. First, the fitting procedure of AIMD simulation results requires a number of steps and parameters. Currently, every study chooses their own tested parameters, but the choice of these parameters has not been discussed. As we show in this study, the choice may significantly impact obtained diffusional properties. Second, most previous studies correlated the error bar and statistical uncertainty of diffusivity to the goodness of linear fitting to the Einstein relation. However, as we show in this study, the goodness of linear fitting to the Einstein relation does not necessarily capture the true statistical variance of fitted diffusivity. Instead, the statistical variance and uncertainty of fitted diffusivity should be a direct consequence of the limited observation of diffusion events (i.e., ion hops) during the MD simulation. In the literature, several studies estimated the errors in the fitted diffusivity from singleparticle tracking,^{29,30,31,32} classical MD simulations^{33} and kinetic Monte Carlo simulations.^{34} However, these studies, which are developed and tested for systems and measurements with a significantly larger number of diffusion events than typical AIMD simulations, are not ideal for analyzing errors from AIMD simulations, where the total number of diffusion events are small. Third, a significant number of diffusion events should be captured to quantify the diffusion with statistical validity. However, in many studies, the AIMD simulations only capture and sample ion diffusion from a few ion hops with a total meansquared displacement (MSD) of a few Angstrom.^{2} The diffusion properties from such poor sampling of ion hops may have low statistical significance. The limitation of AIMD simulations should be quantified and charted out. In summary, the following three problems of using AIMD simulations to study diffusional properties need to be addressed:
(1) How shall one properly extract diffusional properties from the dynamics of atoms with minimal error?
(2) How shall one quantify the statistical variances of diffusional properties extracted from AIMD simulations?
(3) What are the accessible ranges of materials properties and physical conditions for typical AIMD simulations in studying diffusion?
The aim of this paper is to resolve the aforementioned problems and to establish a systematic procedure for quantifying diffusional properties and their statistical variances from AIMD simulations. In the following sections, we examine and establish the proper procedure to extract diffusivity D from the atomic trajectory of AIMD simulations. We illustrate the origin and the functional dependence of the statistical variance of the diffusivity D. We estimate the proper temperature range for AIMD simulations to obtain D with reasonable accuracy. We estimate the errors of activation energy and ionic conductivity from the Arrhenius relation for typical superionic conductor materials.
Results
Quantifying diffusivity, ionic conductivity, and activation energy from AIMD simulations
The diffusional properties are calculated from the trajectory of ions (or atoms) ${\mathit{r}}_{i}\left(t\right)$ from AIMD simulations. The displacement $\Delta {\mathit{r}}_{i}$ of ion i from time t_{1} to t_{2} can be calculated as
The total squared displacement sums up the squared displacement of all mobile ions, ${\sum}_{i=1}^{N}\left({\u2223\Delta {r}_{i}\left(\Delta t\right)\u2223}^{2}\right)$, and describes the movement of all N mobile ions over a time interval Δt. During AIMD simulations over a total time duration t_{tot}, there are many (N_{Δt}) time intervals with the same duration Δt (Δt < t_{tot}) but with different starting time t. Since the displacement of ions over Δt reflects the mobility of ions, the total mean squared displacement (TMSD) for all diffusional ions over time interval Δt is calculated as:
by averaging over a total of N_{Δt} time intervals with the same duration Δt. This averaging over different N_{Δt} time intervals provides essential ensemble sampling to obtain more accurate diffusional properties. To estimate the diffusivity of the mobileion species, the MSD over time interval Δt is calculated as the TMSD per mobile ion:
N is the number of ions that are assumed to be the mobile carriers contributing to diffusion.
In general, the dependence of MSD over time interval Δt follows a linear relationship if a large amount of diffusional displacement is captured during the MD simulation. The diffusivity of these ions is calculated as the slope of the MSD over time interval Δt according to the Einstein relation:
where d = 3 is the dimension of the system, and the offset D_{offset} of this linear dependence is discussed in later sections. This calculated diffusivity D is the tracer diffusivity of the mobileion species and is an intrinsic property of the material at the given condition.
From the diffusivity D, the ionic conductivity is calculated based on the Nernst–Einstein relation:
where V is the total volume of the model system, q is the charge of the mobileion species, T is the temperature, and k is the Boltzmann constant. By combining Eqs. (3–5), the ionic conductivity is directly determined by TMSD(Δt)/Δt:
The ionic conductivity and TMSD calculated in Eq. (6) are independent of the specific choice of the diffusion carrier, such as vacancy or interstitial. In comparison, the diffusivity D can be calculated for specific carriers, e.g., Li^{+} or vacancy, by normalizing the specific number of carriers in Eq. (3). The choice and counting of mobile carriers do not affect the calculated ionic conductivity from Eq. (6). Therefore, the use of conductivity and TMSD is more straightforward in describing the overall diffusion that occurred during the AIMD simulations.
In addition, the Nernst–Einstein relation (Eq. (5)) assumes dilute, noninteracting mobile ions in the materials systems. However, recent AIMD simulation studies have shown the strong correlation of the ionic diffusion in fast ionic conductors.^{9,24,25,26,35,36,37} The Haven ratio is often used to describe the correlation factor, and can be quantified by the ratio of the jump diffusion coefficient D_{J} against the tracer diffusivity D calculated from Eq. (4).^{38,39,40} The jump diffusion coefficient D_{J}, which describes the collective migration of all ions, is estimated from the MSD of the mass center of all mobile ions. However, our analysis found that tracking the displacement of the single center point exhibits higher statistical variance. In this study, the scheme for estimating statistical variance is developed for tracer diffusivity D in Eqs. (5, 6), but a similar scheme can be applied and developed for analyzing the variance of D_{J}.
As in the experiments,^{41,42,43,44} AIMD simulations can be performed at multiple temperatures to obtain the Arrhenius relation of D as a function of T:
The activation energy E_{a} of ion diffusion can be obtained through fitting the data of log D vs. 1/T to the Arrhenius relationship (Eq. (7)). The fitted Arrhenius relationship can be used to extrapolate the diffusivity D and conductivity σ to other temperatures. It should be noted that, by extrapolating this Arrhenius relation to other temperatures, the identical diffusion mechanism is assumed at those extrapolated temperatures.
Regions of MSD–Δt dependence
Figure 1 shows a typical MSD–Δt curve from AIMD simulations of the Liion superionic conductor Li_{1.33}Ti_{1.67}Al_{0.33}(PO_{4})_{3} (LATP). The linear MSD–Δt dependence as described in the Einstein relationship (Eq. (4)) only holds within a certain range of time intervals Δt, and a notable fraction of this dependence is not linear. The MSD–Δt curve at short time interval Δt < 0.1 ps follows $\mathrm{MSD}\propto \Delta {t}^{1.42}$, which is consistent with the local harmonic vibration motion model as shown in the Supplementary Note 1 and Supplementary Figure 1. This portion of the MSD–Δt curve is named the ballistic region, corresponding to the ballistic and vibrational motion of Li ions around their local equilibrium sites rather than Liion hopping to new sites.^{33,45} More details of this ballistic region are discussed in the next section.
In Δt range of 10–100 ps, the MSD–Δt curve follows $\mathrm{MSD}\propto \Delta t$, the linear Einstein relationship for diffusional displacement. However, when Δt reaches a large fraction of t_{tot} (>100 ps in the case of Fig. 1), the MSD–Δt curve shows notable variance and deviation from the linear relationship. This deviation is a result of poor statistics for large Δt values, as values that are comparable to t_{tot} result in averaging a smaller number of time intervals N_{Δt} in Eq. (2) than would be averaged for small Δt values that are a small fraction of t_{tot}. The effect of this deviation is quantified in the next section.
Given that the linear MSD–Δt dependence only holds at certain Δt range, one should not utilize the entire MSD–Δt curve to fit the Einstein relation (Eq. (4)) and to deduce the diffusivity. The ballistic region at short times intervals and the poor statistical region at large time intervals should be excluded from fitting diffusivity. The linear fitting of MSD–Δt curve should be performed in a range [Δt_{ low }, Δt_{ up }], where Δt_{ low } and Δt_{ up } are the lower and upper bound, respectively. In last sections, we establish the procedures to determine the bounds Δt_{ low } and Δt_{ up } for the linear fitting of MSD–Δt in order to minimize the errors caused by improper fitting to the Einstein relation.
Lower bound of linear diffusion region
In Fig. 2, the local derivative dMSD/dΔt calculated using a finite difference method shows the transition from the ballistic region to the linear region and is used to determine the lower fitting bound Δt_{low}. The derivative dMSD/dΔt has a large value at small Δt values (<0.2 ps), and decreases significantly as Δt increases. The MSD–Δt curve becomes linear at Δt ≳ ~ 1 ps, and the value of dMSD/dΔt reaches a plateau value of ~3 Å^{2}/ps. In the case of Fig. 2, the cutoff of the ballistic region (black dotted line in Fig. 2) is at an MSD value of ~5 Å^{2}. An MSD of 5 Å^{2} is approximately 0.5a^{2}, where a is the distance between two neighboring Li sites and is 3.2 Å in LATP, which is typical of Li ionic conductors. The ballistic region has the MSD cutoff at a fraction of a^{2} because the local vibration of Li ions on their equilibrium sites is confined within the potential well between two nearby sites. This local vibrational displacement at small Δt < Δt_{low} does not represent the ionic diffusion from site to site, and should be excluded from the linear fitting for D.
One may identify the specific range of the ballistic region and the precise lower fitting bound Δt_{low} for each individual AIMD simulation of different materials systems at different temperatures using the same procedure shown in Figs. 1 and 2. The cutoff values of Δt (i.e., Δt_{low}) and MSD for the ballistic region are dependent on the temperatures and the materials, which yield different potential energy surfaces near the equilibrium sites. In general, the displacement of local vibration is within a fraction of site distance a, so the ballistic region corresponds to the MSD ranging from 0 to a fraction of a^{2} (Supplementary Note 1 and Supplementary Figure 1). Therefore, we propose to quantify the cutoff values of Δt, i.e., Δt_{low}, by defining the cutoff in MSD using the value of a fraction of a^{2} (e.g., 0.5 a^{2}). As a safer measure for lower fitting bound (i.e., Δt_{low}), the entire region with MSD less than this cutoff based on a^{2} may be excluded.
The linear fitting to Einstein relation should only be performed on the linear region corresponding to diffusional displacement. Otherwise, a part of ballistic motion would be included into the fitting for D, leading to an overestimation of D. This overestimation of D would be pronounced for the MSD–Δt curves with small values of the maximum MSD (~ a few Å^{2}), due to a significant fraction of ballistic motion mixed into the MSD–Δt curve. Therefore, AIMD simulation should be long enough to have the MSD per mobile ion larger than a few a^{2}, so that the ballistic region (and Δt_{low}) can be distinguished and separated from the linear fitting for D.
Upper bound of linear diffusion region
The upper fitting bound Δt_{up} is determined by the transition from the linear diffusion region to the region at large Δt with large variance and deviation. Ten different MSD–Δt curves from AIMD simulations of the same LATP structure model at 1200 K over 50 ps (Fig. 3a) were obtained by dividing a total AIMD simulation over 500 ps into ten nonoverlapping parts. The significant deviations from the linear dependence of these ten MSD–Δt curves are typically observed at large values of Δt, i.e., >25 ps in Fig. 3 or ≳50% of t_{tot}. At large Δt, a smaller number of time intervals N_{Δt} is averaged in Eq. (2) and many of these Δt intervals overlap other intervals that contain physically identical trajectories of ions, thus leading to larger deviation from the linear MSD–Δt relation. Therefore, the linear fitting for D should be performed below the upper bound Δt_{up} of the linear diffusion region.
To determine the upper fitting bound Δt_{up}, we fitted these MSD–Δt curves to the Einstein relation (Eq. (4)) with different Δt_{up} values ranging from 10% to 100% of t_{tot}. For the fitting of each curve, the value of R^{2} in the linear regression was calculated to evaluate the goodness of fitting. The average and standard deviation of R^{2} values over these ten curves are shown in Fig. 3b. At Δt_{up} ≤ 0.3t_{tot}, all values of R^{2} are very close to 1, showing good linearity of MSD–Δt curves at small Δt. At Δt_{up} > 0.7t_{tot}, R^{2} values decrease significantly from 1, indicating poor linearity of MSD–Δt curves at large Δt, and the standard deviation of R^{2} also increases. Therefore, one should only fit the linear region of MSD–Δt below an upper fitting bound of Δt_{up} < 0.7t_{tot}. By performing the same test on other fast ion conductor materials, such as LGPS and Li_{7}La_{3}Zr_{2}O_{12 }(LLZO) at a few different temperatures, we found this Δt_{up} < 0.7t_{tot} to be generally applicable (Supplementary Figure 3). As the optimal Δt_{up} values may depend on the material (the mobile ions) and temperatures, for unique systems one may use this scheme to determine the specific Δt_{up} values.
Within properly determined lower and upper fitting bounds, the goodness of fitting to the MSD–Δt curve would always be good. Therefore, the goodness of fitting itself does not reflect the statistical variance in the fitted D, the slope of the MSD–Δt curve, and is different among different AIMD simulations for the same materials model (Fig. 3a). The changes in the slopes of MSD–Δt curves below Δt_{up} reflect the statistical variances in the fitted diffusivity D from different runs of AIMD simulations, which are quantified and analyzed in the next section.
Statistical variance of diffusivity and conductivity
In Fig. 3a, the diffusivities, i.e., the slopes of different MSD–Δt curves, exhibit significant variance among different AIMD simulations of the exact same material model. The variance among the fitted diffusivities D are a result of the stochastic nature of the diffusion process, which causes different numbers of ion hops during AIMD simulations with different initial conditions.
In this section, we quantify the statistical variance of the fitted diffusivity D from AIMD simulations. The statistics were calculated based on a set of MD simulations that were created by dividing a long MD simulation into several nonoverlapping shorter MD simulations, each of which was treated as an individual MD simulation. Following our established fitting procedure, the value of D was extracted from each MD simulation. The standard deviation of D, s_{ D }, was calculated from the set of fitted D values (Supplementary Figure 2). The relative standard deviation (RSD) of D was calculated as s_{ D }/D_{true}, where the true value of the diffusivity D_{true} is calculated from the longest available MD simulation. Since more ion hops improve the sampling of the diffusional property, we found that the RSD of D decreases with the total effective ion hops N_{eff} as
N_{eff} is calculated as
where $\underset{\Delta t}{max}\left[\mathrm{TMSD}\left(\Delta t\right)\right],$ is the maximum value of TMSD over the entire MSD–∆t curve. N_{eff} can be considered as the effective number of ion hops that contributed to the TMSD of all mobile ions in the entire duration of the MD simulation. The value of a is 2.4, 3.2, 2.8, 3.4 Å for LLZO, LATP, LGPS, RbAg_{4}I_{5}, respectively, as averaged distance between neighboring mobileion sites. For all materials in Fig. 4, the values of A and B are fitted as 3.43 and 0.04, respectively. As shown in Fig. 4, Eq. (8) and its parameters are general for ionic conductor materials and also hold for a classical MD simulation of LLZO over much longer time duration with a large number of ion hops (Fig. 4b).
Equation (8) can be used to estimate the statistical variance of D calculated from any given AIMD simulation, where the number of total effective ion hops N_{eff} can be first estimated from the maximum TMSD of all mobile ions using Eq. (9). For example, in a material with site distance a = 3 Å (assumed for all following estimations), an AIMD simulation that reaches a maximum TMSD of 1800 Å^{2}, corresponding to N_{eff} = ~ 200, results in an RSD of D of ~28%. In addition, since the diffusivity D and ionic conductivity σ are linearly dependent (Eq. (5)), the RSD of σ is equivalent to the RSD of D. Thus, Eq. (8) is also valid for estimating the RSD of ionic conductivity σ from AIMD simulations.
This result suggests that in order to obtain more accurate diffusivity from AIMD simulations, one should run longer MD simulations that sample more diffusion events, i.e., have larger N_{eff}. For AIMD simulations with an estimated N_{eff} of 50, 100, and 150, corresponding to max (TMSD) of 450, 900, and 1350 Å^{2}, respectively, RSD of D is 52%, 38%, and 32%, respectively. These levels of RSD are reasonable, but still allow for a notable statistical error of the fitted D. To obtain D with <20% RSD, the AIMD simulation should observe more than max (TMSD) of ~4150 Å^{2} (N_{eff} = ~ 460). The RSD is reduced to ~ 10% for N_{eff} = 3200 and max (TMSD) = ~ 30,000 Å^{2}. It should be noted that N_{eff} and TMSD are from all mobile ions, while only MSD per ion is often presented in the literature. A max(TMSD) of a few thousand Å^{2} is quite significant for typical AIMD simulations within 1 ns and can only be reached in fast ion conductors at relatively high temperatures. In addition to running longer MD simulations, running MD simulations on larger systems with more mobile ions, for example as is done in classical MD simulations, can achieve more effective ion hops N_{eff} and hence less statistical variance in D and σ.
Accessible range of diffusivity, activation energy, and temperature
Given the short physical time duration of 100 ps to 1 ns in typical AIMD simulations, AIMD simulations of materials with large activation energy E_{a} or at low temperature T may not observe enough number of ion hops. In order to achieve a reasonable accuracy of the fitted D, AIMD simulations may only be applicable to materials with relatively high ionic conductivity. Given the high computational costs of AIMD simulations, it is often desired to preestimate the range of temperatures that can be performed for a given material (with an estimated E_{a}). The accessible ranges of T at a given E_{a} can be estimated as follows. The estimation here assumes an AIMD simulation over a total physical time duration of 1 ns and a supercell with a volume V of 1000 Å^{3} (i.e., 10 Å × 10 Å × 10 Å) with N = 20 mobile ions and a site distance a = 3 Å. In order to achieve <50% RSD of D and σ, N_{eff} should be >55 according to Eq. (8). For this RSD limit, the ionic conductivity should be >0.025 S/cm at 600 K to achieve N_{eff} > 55 over 1 ns (Eqs. (4), (5)). This ionic conductivity corresponds to a Li^{+} diffusivity of ~4.2 × 10^{–7} cm^{2}/s (Eq. (5)) for the assumed supercell model. For the materials supercell with different size V or different number of mobile carriers N, the accessible range of diffusivity can be estimated in the same way using Eqs. (5–8). In general, a minimum diffusivity of ~10^{−7} cm^{2}/s is accessible by the AIMD simulations with typical size (~1 nm^{3}) and time duration (~1 ns), in order to have a reasonable number of effective ion hops (N_{eff} > 50).
Figure 5 shows a plot of D as a function of E_{a} and T estimated from the transition state theory
where ${v}^{*}$ is the attempting jump frequency and is chosen to be 10^{12} Hz, a is the neighboringsite distance, and k is the Boltzmann constant. The geometric factor and correlation factor, which also affect the value of D, were neglected in this backoftheenvelope estimation. This plot can be used to estimate the range of E_{a} and T accessible to typical AIMD simulations. In the same example model above, a minimum diffusivity of ~5 × 10^{–7} cm^{2}/s is needed to achieve an RSD of ~50% within 1 ns. The highest E_{a} and lowest temperatures to have the desired D value can be read from this plot (Fig. 5). For materials with an E_{a} of 0.6 eV, as in some cathode materials, AIMD simulations below 900 K may not observe enough ion hops and the fitted D would have a large error. For super ionic conductors with an E_{a} of 0.20 eV or lower, the temperature accessible by AIMD simulations may go as low as 300 K.
In addition, this plot can be used to determine the appropriate temperatures for AIMD simulations to obtain D with reasonable accuracy. For example, in order to achieve a desired RSD of ~20%, a maximum TMSD of 4150 Å^{2} over 1 ns is needed (Eqs. (7–8)), and this maximum TMSD corresponds to a minimum diffusivity of ~3 × 10^{–6} cm^{2}/s (Eq. (5)) in the same example material model. To achieve that diffusivity, AIMD simulations of a material with E_{a} of 0.2 eV need to be at above 450 K (Fig. 5). An ionic conductor with E_{a} of 0.3 eV should have AIMD simulations above 700 K to achieve similar accuracy (RSD = ~20%). An AIMD simulation at >1150 K is needed for an ionic conductor with E_{a} of 0.5 eV. Therefore, for materials with slow diffusion, long AIMD simulations at high temperatures are essential to obtain D with low statistical uncertainty. In general, AIMD simulations containing a significant number of ion hops are crucial for achieving small error bounds and a high confidence level in the fitted D.
Estimating errors of diffusional properties from Arrhenius relation
Given the statistical uncertainty of fitted D, it is crucial to include the statistical uncertainty of every D data point into the fitting of the Arrhenius relation. In particular, the data points from the simulations at lower temperatures or over shorter durations may have a significantly smaller number of ion hops and thus a higher uncertainty, and this uncertainty should be taken into account during the fitting. The data points in Fig. 6 indeed show significantly larger variance at lower temperatures. Therefore, these lowertemperature data points should have less weight in the fitting. As a common practice in linear regression, the inverse square of the standard deviation of log(D) is factored into the fitting as the weight of each data point to account for the statistical uncertainty.^{46} Given that the fitting of the Arrhenius relationship is usually performed as a linear fitting of log(D) and 1/T, the derived standard deviation of log(D) shall be used as the weight on each point (as shown as error bars in Fig. 6) for the linear fitting (Supplementary Note 2). Therefore, the error bounds and statistical intervals of E_{a} and D_{0} in the Arrhenius relation (Eq. (7)) can be obtained using standard error analysis for linear regression, and so are also the errors for diffusivity and conductivity when extrapolated to other temperatures.
Table 1 shows the error bounds of the activation energy E_{a} and ionic conductivity σ extrapolated to 300 K for LATP, LGPS and LLZO Liion conductors. E_{a} and extrapolated σ at 300 K agree well with experimental values, showing the capability of AIMD simulations for quantifying diffusional properties.^{41,42,47,48} For all three materials, the E_{a} has a standard deviation of ~0.02 eV, and the extrapolated σ at 300 K has the error bound within 1–2 orders of magnitude. It should be noted that extrapolated conductivity (i.e., room temperature conductivity) assumes that there is no change in the slope of the Arrhenius relation due to a phase change. While excellent agreement of AIMD simulations and experiments is widely reported, one should note that the statistical uncertainty of extrapolated σ at 300 K can be as large as an order of magnitude for typical AIMD simulations. The errors in E_{a} and σ may be larger for AIMD simulations over shorter duration or on slower ion conductors, which sample fewer diffusion events. As shown in Supplementary Note 3 and Supplementary Figure 4, using short AIMD simulations, especially at low temperatures, would lead to significant overestimation of diffusivity and, in particular, the RT conductivity.
In addition, the errors of E_{a} and extrapolated σ also depend on the number of data points and the linearity of the relationship according to the error analyses of linear regression.^{46} To minimize the error of E_{a} and extrapolated σ, more data points are helpful. For example, the error of E_{a} and σ may increase significantly if some data points are omitted for the LGPS data in Fig. 6, leading to more deviations from the experimental values (Supplementary Figure 5 and Supplementary Table 1). Therefore, having more data points of D (from sufficiently long AIMD simulations) would lead to smaller error and less statistical uncertainty for fitted diffusional properties.
Discussion
In this work, we systematically test and establish the procedures to obtain the diffusional properties and their statistical variances from AIMD simulations. Only the linear region of the MSD–Δt curve within the lower and upper fitting bound Δt_{low} and Δt_{up}, which corresponds to diffusional displacements, should be used to fit the diffusivity. The cutoff of the ballistic region, Δt_{low}, is at the MSD per mobile ion of less than a fraction of a^{2} (a is the distance between neighboring mobileion sites), since the local ballistic vibration is limited within the potential well of the equilibrium site. The AIMD simulation should be long enough to have the MSD per mobile ion larger than a few times a^{2} so that the distinction between the linear diffusion region and the ballistic region can be clearly observed. Otherwise, a part of ballistic motion would be mixed into the fitting, leading to the overestimation of D. Moreover, the upper fitting bound Δt_{up} should be set as <30–70% of t_{tot} to exclude the region with poor linearity at large Δt. An adequately long AIMD simulation with properly determined lower and upper fitting bounds is crucial to have a linear MSD–Δt curve for fitting D.
If the proper procedure is followed to determine the linear diffusion region of the MSD–Δt curve, the goodness of fitting to the MSD–Δt curve would be nearly perfect and would not reflect the statistical variance of the fitted diffusivity. The statistical variance of the fitted diffusivity and conductivity is instead a direct result of the total number of ion hops sampled during the MD simulations. The statistical variances of D from fitting Einstein relation should be quantified by the total displacement TMSD using the empirically determined relation in Eq. (8).
On the basis of these results, AIMD simulations should be adequately long to collect a sufficient number of ion hopping events. As shown in typical alkaliion conductor materials, a simple rule of thumb is that a maximum TMSD of a few hundred Å^{2} is necessary to obtain a reasonable estimation of D (with ~50% RSD), and a maximum TMSD of a few thousand Å^{2} is necessary to obtain a more accurate D (~20–30% RSD). Given the high uncertainty of D from typical AIMD simulations, the error bounds of diffusivity and conductivity should be reported.
Given the need to collect a large number of ion hops, AIMD simulation is more suitable for studying fastionconducting materials. Likewise, it is necessary to perform AIMD simulations at high temperature for most materials. A minimum diffusivity of ~10^{−7} cm^{2}/s is necessary for a material to be accessible by AIMD simulations and a diffusivity of ~10^{−5} cm^{2}/s may allow for the calculation of a more accurate D. On the basis of these estimated bounds of minimum diffusivity, the approximate accessible temperature ranges of AIMD simulations may be estimated using the plot in Fig. 5 or using a backoftheenvelope estimation based on the Arrhenius relation. For materials with a high activation energy, running AIMD simulations at sufficiently high temperatures is crucial for simulating an adequate number of ion hops.
In addition, it is also crucial to include the statistical error bounds of each diffusivity data point when fitting to the Arrhenius relation (Eq. (7)). The error bounds of D should be accounted for as a weight into the linear fitting of log(D) over 1/T. The error of E_{a} and extrapolated σ can be established through standard regression error analysis. Such error analyses indicate that the typical statistical error bounds of extrapolated σ at 300 K may be as large as an order of magnitude, even for fast ionic conductors with many data points at different temperatures and with long AIMD simulations. One should consider the statistical variances when interpreting the diffusional properties calculated from AIMD simulations.
While the results of this study are largely based on AIMD simulations, our analyses, schemes, and conclusions are applicable for diffusional studies using classical MD simulations. While AIMD simulations provide ab initio potential energy surfaces, leading to more accurate diffusion properties, classical MD simulations can be performed on significantly larger model systems with more mobile ions and over longer time scales, so more diffusional events can be observed. When the TMSD and total effective ion hops N_{eff} from classical MD simulations are large, the statistical variances of diffusional properties are expected to be small. However, in classical MD simulations in which TMSD or N_{eff} is small, which is common for systems with slow diffusion or at low temperatures, our scheme and analyses should be carried out to properly quantify diffusional properties and their statistical variances.
In summary, the major conclusions for calculating diffusional properties from AIMD simulations are as follows. These conclusions also serve as specific guidelines for future practices.

1.
In the calculation of diffusivity, fitting to the Einstein relation (Eq. (4)) should be limited to the linear diffusion region of the MSD–Δt curve. This linear diffusion region excludes the ballistic region at MSD ≲ a^{2} and the poor linearity region at large Δt > Δt_{up} (Δt_{up} < 0.7t_{tot}).

2.
The AIMD simulations should be long enough and should only be performed on materials with reasonably fast diffusion so that a large number of diffusion events can be captured to obtain accurate diffusivity. In addition, the MSD per mobile ion should be larger than a few times a^{2} to distinguish the ballistic region (i.e., Δt_{low}).

3.
The statistical variance of the diffusivity should be derived from the total diffusional displacements (such as maximum TMSD using Eqs. (8–9)) rather than the goodness of fitting to the Einstein relation. The statistical variance of fitted diffusivity values from AIMD simulations should be reported.

4.
The statistical uncertainties of each data point of diffusivity should be included when fitting to the Arrhenius relation. The error bounds of activation energy and extrapolated ionic conductivity are nonnegligible and should be evaluated using standard regression analysis.
Our study establishes the proper calculation procedures and statistical error analyses for the correct application of AIMD simulations in estimating diffusional properties. The obtained knowledge and established procedures are the basis for quantifying diffusional properties, drawing proper conclusions from the AIMD simulation results, and further developing AIMD simulations.
Methods
In this study, all DFT calculations were performed using the Vienna ab initio Simulation Package^{49} within the projector augmentedwave approach with the Perdew−Burke−Ernzerhof generalizedgradient approximation.^{50} The initial structures for AIMD simulations are statically relaxed in DFT using the standard parameters from Materials Project.^{51,52,53} In AIMD simulations, the DFTbased force evaluations were nonspinpolarized with a single Γcenter kpoint grid. The AIMD simulations performed in this study were based on the Born–Oppenheimer approximation with a time step of 2 fs. Classical MD simulations of garnet were performed using Largescale Atomic/Molecular Massively Parallel Simulator^{54} in a supercell model of 8 formula units of Li_{7}La_{3}Zr_{2}O_{12} and the interatomic potential from ref. ^{55}. All AIMD and classical MD simulations used a time step of 2 fs, an NVT ensemble using a Nose–Hoover thermostat, and a velocity–Verlet algorithm for integrating the equation of motion.
The crystal structures of LGPS, cubic phase LLZO, and RbAg_{4}I_{5} investigated were obtained from Inorganic Crystal Structure Database (ICSD)^{56} and Materials Project.^{51,52,53} We used the Li superionic conductor LATP based on the NASICON structure to establish the fitting scheme, and then tested the same scheme in other Li superionic conductors. The structure of LATP was derived from the LiTi_{2}(PO_{4})_{3} structure by partially substituting Ti with Al and by inserting extra Li atoms. The structures with disordered site occupancy were ordered using the same method in the previous studies.^{5,7}
Data availability
The computation data to support the findings of this study is available from the corresponding author on reasonable request. The code to analyze AIMD simulation is available at: https://github.com/mogroupumd/aimd
Additional information
Publisher's note: Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
References
 1.
Carloni, P., Rothlisberger, U. & Parrinello, M. The role and perspective of ab initio molecular dynamics in the study of biological systems. Acc. Chem. Res. 35, 455–464 (2002).
 2.
Iftimie, R., Minary, P. & Tuckerman, M. E. Ab initio molecular dynamics: concepts, recent developments, and future trends. Proc. Natl. Acad. Sci. USA 102, 6654–6659 (2005).
 3.
Kirchner, B., di Dio, P. J. & Hutter, J. RealWorld Predictions from Ab Initio Molecular Dynamics Simulations. Vol. 307 (Springer, Berlin, Heidelberg, 2011).
 4.
Hassanali, A. A., Cuny, J., Verdolino, V. & Parrinello, M. Aqueous solutions: state of the art in ab initio molecular dynamics. Philos. Trans. R. Soc. A 372, 20120482 (2014).
 5.
Mo, Y., Ong, S. P. & Ceder, G. First principles study of the Li_{10}GeP_{2}S_{12} lithium super ionic conductor material. Chem. Mater. 24, 15–17 (2012).
 6.
Mo, Y., Ong, S. P. & Ceder, G. Insights into diffusion mechanisms in P2 layered oxide materials by firstprinciples calculations. Chem. Mater. 26, 5208–5214 (2014).
 7.
He, X. & Mo, Y. Accelerated materials design of Na_{0.5}Bi_{0.5}TiO_{3} oxygen ionic conductors based on first principles calculations. Phys. Chem. Chem. Phys. 17, 18035–18044 (2015).
 8.
Deng, Z., Mo, Y. & Ong, S. P. Computational studies of solidstate alkali conduction in rechargeable alkaliion batteries. NPG Asia Mater. 8, e254 (2016).
 9.
He, X., Zhu, Y. & Mo, Y. Origin of fast ion diffusion in superionic conductors. Nat. Commun. 8, 15893 (2017).
 10.
He, K. et al. Sodiation kinetics of metal oxide conversion electrodes: a comparative study with lithiation. Nano Lett. 15, 5755–5763 (2015).
 11.
Mosconi, E., Azpiroz, J. M. & De Angelis, F. Ab initio molecular dynamics simulations of methylammonium lead iodide perovskite degradation by water. Chem. Mater. 27, 4885–4892 (2015).
 12.
Zhang, C., Wu, J., Galli, G. & Gygi, F. Structural and vibrational properties of liquid water from van der Waals density functionals. J. Chem. Theory Comput. 7, 3054–3061 (2011).
 13.
Lin, I. C., Seitsonen, A. P., Tavernelli, I. & Rothlisberger, U. Structure and dynamics of liquid water from ab initio molecular dynamicscomparison of BLYP, PBE, and revPBE density functionals with and without van der Waals corrections. J. Chem. Theory Comput. 8, 3902–3910 (2012).
 14.
Thomas, M., Brehm, M., Fligg, R., Vöhringer, P. & Kirchner, B. Computing vibrational spectra from ab initio molecular dynamics. Phys. Chem. Chem. Phys. 15, 6608–6622 (2013).
 15.
Car, R. & Parrinello, M. Structural, dynamical, and electronic properties of amorphous silicon: an ab initio molecular dynamics study. Phys. Rev. Lett. 60, 204–207 (1988).
 16.
Kresse, G. & Hafner, J. Ab initio moleculardynamics simulation of the liquidmetal–amorphoussemiconductor transition in germanium. Phys. Rev. B 49, 14251–14269 (1994).
 17.
Johari, P., Qi, Y. & Shenoy, V. B. The mixing mechanism during lithiation of Si negative electrode in Liion batteries: an ab initio molecular dynamics study. Nano Lett. 11, 5494–5500 (2011).
 18.
Lee, T. & Elliott, S. Ab initio computer simulation of the early stages of crystallization: application to Ge_{2}Sb_{2}Te_{5} phasechange materials. Phys. Rev. Lett. 107, 145702 (2011).
 19.
Ong, S. P. et al. Phase stability, electrochemical stability and ionic conductivity of the Li_{10±1}MP_{2}X_{12} (M = Ge, Si, Sn, Al or P, and X = O, S or Se) family of superionic conductors. Energy Environ. Sci. 6, 148–156 (2013).
 20.
Deng, Z., Radhakrishnan, B. & Ong, S. P. Rational composition optimization of the lithiumrich Li_{3}OCl_{1x}Br_{ x } antiperovskite superionic conductors. Chem. Mater. 27, 3749–3755 (2015).
 21.
Zhu, Z., Chu, I.H., Deng, Z. & Ong, S. P. Role of Na+ interstitials and dopants in enhancing the Na+ conductivity of the cubic Na_{3}PS_{4} superionic conductor. Chem. Mater. 27, 8318–8325 (2015).
 22.
Ling, C., Zhang, R., Arthur, T. S. & Mizuno, F. How general is the conversion reaction in Mg battery cathode: a case study of the magnesiation of αMnO_{2}. Chem. Mater. 27, 5799–5807 (2015).
 23.
Ling, C. & Suto, K. Thermodynamic origin of irreversible magnesium trapping in chevrel phase Mo_{6}S_{8}: importance of magnesium and vacancy ordering. Chem. Mater. 29, 3731–3739 (2017).
 24.
Xu, M., Ding, J. & Ma, E. Onedimensional stringlike cooperative migration of lithium ions in an ultrafast ionic conductor. Appl. Phys. Lett. 101, 031901 (2012).
 25.
Jalem, R. et al. Concerted migration mechanism in the Li ion dynamics of garnettype Li_{7}La_{3}Zr_{2}O_{12}. Chem. Mater. 25, 425–430 (2013).
 26.
Meier, K., Laino, T. & Curioni, A. Solidstate electrolytes: revealing the mechanisms of Liion conduction in tetragonal and cubic LLZO by firstprinciples calculations. J. Phys. Chem. C 118, 6668–6679 (2014).
 27.
Panchmatia, P. M. et al. Oxygen defects and novel transport mechanisms in apatite ionic conductors: combined ^{17}O NMR and modeling studies. Angew. Chem. Int. Ed. 50, 9328–9333 (2011).
 28.
Deng, Y. et al. Structural and mechanistic insights into fast lithiumion conduction in Li_{4}SiO_{4}Li_{3}PO_{4} solid electrolytes. J. Am. Chem. Soc. 137, 9136–9145 (2015).
 29.
Saxton, M. J. Singleparticle tracking: the distribution of diffusion coefficients. Biophys. J. 72, 1744–1753 (1997).
 30.
Berglund, A. J. Statistics of camerabased singleparticle tracking. Phys. Rev. E 82, 011917 (2010).
 31.
Michalet, X. Mean square displacement analysis of singleparticle trajectories with localization error: Brownian motion in an isotropic medium. Phys. Rev. E 82, 041914 (2010).
 32.
Michalet, X. & Berglund, A. J. Optimal diffusion coefficient estimation in singleparticle tracking. Phys. Rev. E 85, 061916 (2012).
 33.
Chitra, R. & Yashonath, S. Estimation of error in the diffusion coefficient from molecular dynamics simulations. J. Phys. Chem. B 101, 5437–5445 (1997).
 34.
Leetmaa, M. & Skorodumova, N. V. Mean square displacements with error estimates from nonequidistant timestep kinetic Monte Carlo simulations. Comput. Phys. Commun. 191, 119–124 (2015).
 35.
Catti, M. Shortrange order and Li+ ion diffusion mechanisms in Li_{5}La_{9}□_{2}(TiO_{3})_{16} (LLTO. Solid State Ion. 183, 1–6 (2011).
 36.
Lang, B., Ziebarth, B. & Elsässer, C. Lithium ion conduction in LiTi_{2}(PO_{4})_{3} and related compounds based on the NASICON structure: a firstprinciples study. Chem. Mater. 27, 5040–5048 (2015).
 37.
Burbano, M., Carlier, D., Boucher, F., Morgan, B. J. & Salanne, M. Sparse cyclic excitations explain the low ionic conductivity of stoichiometric Li_{7}La_{3}Zr_{2}O_{12}. Phys. Rev. Lett. 116, 135901 (2016).
 38.
Uebing, C. & Gomer, R. Determination of surface diffusion coefficients by Monte Carlo methods: comparison of fluctuation and Kubo–Green methods. J. Chem. Phys. 100, 7759–7766 (1994).
 39.
Van der Ven, A., Ceder, G., Asta, M. & Tepesch, P. Firstprinciples theory of ionic diffusion with nondilute carriers. Phys. Rev. B 64, 184307 (2001).
 40.
Murch, G. E. The Haven ratio in fast ionic conductors. Solid State Ion. 7, 177–198 (1982).
 41.
Murugan, R., Thangadurai, V. & Weppner, W. Fast lithium ion conduction in garnet‐type Li_{7}La_{3}Zr_{2}O_{12}. Angew. Chem. Int. Ed. 46, 7778–7781 (2007).
 42.
Kamaya, N. et al. A lithium superionic conductor. Nat. Mater. 10, 682–686 (2011).
 43.
Arbi, K., Mandal, S., Rojo, J. & Sanz, J. Dependence of ionic conductivity on composition of fast ionic conductors Li_{1+x}Ti_{2x}Al_{ x }(PO_{4})_{3}, 0≤ x ≤ 0.7. a parallel NMR and electric impedance study. Chem. Mater. 14, 1091–1097 (2002).
 44.
Kosova, N., Devyatkina, E., Stepanov, A. & Buzlukov, A. Lithium conductivity and lithium diffusion in NASICONtype Li_{1+x}Ti_{2–x}Al_{ x }(PO_{4})_{3} (x=0; 0.3) prepared by mechanical activation. Ionics 14, 303–311 (2008).
 45.
Huang, R. et al. Direct observation of the full transition from ballistic to diffusive Brownian motion in a liquid. Nat. Phys. 7, 576–580 (2011).
 46.
Ruppert, D. & Wand, M. P. Multivariate locally weighted least squares regression. Ann. Stat. 22, 1346–1370 (1994).
 47.
Aono, H., Sugimoto, E., Sadaoka, Y., Imanaka, N. & Adachi, G.y. Ionicconductivity and sinterability of lithium titanium phosphate system. Solid State Ion. 40/41, 38–42 (1990).
 48.
Li, Y. et al. Ionic distribution and conductivity in lithium garnet Li_{7}La_{3}Zr_{2}O_{12}. J. Power Sources 209, 278–281 (2012).
 49.
Kresse, G. & Furthmuller, J. Efficient iterative schemes for ab initio totalenergy calculations using a planewave basis set. Phys. Rev. B 54, 11169–11186 (1996).
 50.
Perdew, J. P., Ernzerhof, M. & Burke, K. Rationale for mixing exact exchange with density functional approximations. J. Chem. Phys. 105, 9982–9985 (1996).
 51.
Jain, A. et al. A highthroughput infrastructure for density functional theory calculations. Comput. Mater. Sci. 50, 2295–2310 (2011).
 52.
Jain, A. et al. Formation enthalpies by mixing GGA and GGA+U calculations. Phys. Rev. B 84, 045115 (2011).
 53.
Jain, A. et al. Commentary: the materials project: a materials genome approach to accelerating materials innovation. Apl. Mater. 1, 011002 (2013).
 54.
Plimpton, S. Fast parallel algorithms for shortrange molecular dynamics. J. Comput. Phys. 117, 1–19 (1995).
 55.
Adams, S. & Rao, R. P. Ion transport and phase transition in Li_{7−x}La_{3}(Zr_{2−x}M_{ x })O_{12}(M = Ta^{5+}, Nb^{5+}, x = 0, 0.25). J. Mater. Chem. 22, 1426–1434 (2012).
 56.
Belsky, A., Hellenbrandt, M., Karen, V. L. & Luksch, P. New developments in the Inorganic Crystal StructureDatabase (ICSD): accessibility in support of materials research and design. Acta Crystallogr. Sect. B Struct. Sci. 58, 364–369 (2002).
Acknowledgements
The authors acknowledge the support from Office of Naval Research (ONR) and from National Science Foundation under award No. 1550423. We thank Shuo Zhang for testing the initial parameters of classical molecular dynamics simulations. This research used computational facilities from the University of Maryland supercomputing resources, the Maryland Advanced Research Computing Center (MARCC), and the Extreme Science and Engineering Discovery Environment (XSEDE) supported by National Science Foundation Award No. DMR150038.
Author information
Affiliations
Department of Materials Science and Engineering, University of Maryland, College Park, MD, 20742, USA
 Xingfeng He
 , Yizhou Zhu
 , Alexander Epstein
 & Yifei Mo
Maryland Energy Innovation Institute, University of Maryland, College Park, MD, 20742, USA
 Yifei Mo
Authors
Search for Xingfeng He in:
Search for Yizhou Zhu in:
Search for Alexander Epstein in:
Search for Yifei Mo in:
Contributions
Y.M. conceived the project. Y.M. and X.H. developed the computation methods and analyses, and X.H. performed the computation and analyses. Y.M. and X.H. wrote the manuscript. All authors contributed to the discussions and revisions of the manuscript.
Competing interests
The authors declare no competing interests.
Corresponding author
Correspondence to Yifei Mo.
Electronic supplementary material
About this article
Publication history
Received
Revised
Accepted
Published
DOI
https://doi.org/10.1038/s415240180074y
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/.