openmaterials.ai / codes / AtomisticSkills mat-diffusion-analysis

mat-diffusion-analysis: diffusivity and activation energy from MD

An AtomisticSkills skill that reads ASE trajectories at several temperatures, takes the diffusivity from the mean squared displacement and fits a weighted Arrhenius line for E_a.

What it is and how it works

MSD slope to Arrhenius slope

analyze_diffusion.py runs pymatgen's DiffusionAnalyzer on each trajectory after a 5 ps equilibration skip and reports D with its error. calculate_activation_energy.py fits ln D against 1/T, weighted by those errors.

Several temperatures

The skill asks for NVT or NPT runs at 4 to 6 temperatures between 600 and 1200 K from the run_md tool of the mace or matgl skill, in supercells over 10 A on every side.

Early stopping

The diffusion monitor stops a run once the transport property has converged and writes diffusion_{specie}.json and the MSD plot into the trajectory folder.

Weighted fit with uncertainties

The fit weights each temperature by the standard deviation of its D. The covariance propagates into E_a and into the conductivity extrapolated to 300 K in mS/cm.

Inputs and outputs

Input is an ASE .traj file per temperature with its .log for the frame interval. Outputs are diffusion_results.json per run, msd_{specie}.png and arrhenius_plot.png.

What people do with it

Li in Li10GeP2S12 (LGPS)

A 2x2x1 supercell of about 200 atoms, 20 ps of NVT at 600 to 1000 K with MatPES-r2SCAN, gives E_a = 0.152 +/- 0.035 eV and a 300 K conductivity of 91.44 +/- 79.18 mS/cm. LGPS example README

How it is used

  1. Run MD

    run_md at 4 to 6 temperatures, supercell_min_length 10 A, diffusion monitor optional.

  2. Diffusivity per run

    analyze_diffusion.py trajectory.traj --species Li --temperature 600 --ignore_ps 5.0

  3. Arrhenius fit

    calculate_activation_energy.py results/ reads md_*K/diffusion_results.json and fits E_a.

  4. Check linearity

    Inspect the MSD plots for a linear regime and the R^2 of the Arrhenius line.