Code

AtomisticSkills mat-diffusion-analysis

An AtomisticSkills skill: diffusivity and activation energy from trajectories.

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.

What AtomisticSkills mat-diffusion-analysis is, how it works and what it is used for, from the papers listed as sources. Every number links to its paper.Poster pageDownload the poster (PNG, 1920 x 1080)

What AtomisticSkills mat-diffusion-analysis is

mat-diffusion-analysis is one of the AtomisticSkills, packaged calculations an agent can call. It takes molecular dynamics trajectories at several temperatures, extracts the diffusivity at each from the mean squared displacement, and fits a weighted Arrhenius law through them. The slope gives the activation energy in eV. On the map it serves the diffusivity and the activation energy.

In more detail

Einstein diffusivity and a weighted Arrhenius fit

analyze_diffusion.py converts the ASE frames after the ignore_ps skip into pymatgen structures and calls DiffusionAnalyzer.from_structures with smoothed=False and step_skip=1, using the frame interval read from the MD .log file. The diffusivity of the chosen species comes from the slope of the mean squared displacement, in cm^2/s, with its standard deviation from the structural variance of the MSD. calculate_activation_energy.py collects md_*K/diffusion_results.json and calls pymatgen's fit_arrhenius with the per-temperature errors. It fits the Arrhenius law D(T) = D0 exp(-E_a/k_B T) as a weighted line in ln D against 1/T.

Numerics and checks

The SKILL.md asks for 4 to 6 temperatures, typically between 600 and 1200 K, supercells longer than 10 A in every direction and more than 20 mobile ions for the statistics. The user should check the MSD for a linear regime after the equilibration skip, 5.0 ps by default. The fitting script prints R^2 and warns below 0.95. It propagates the uncertainties through the covariance matrix of the weighted fit into E_a and into the diffusivity and ionic conductivity extrapolated to 300 K through pymatgen's get_extrapolated_conductivity, which takes the structure file given by --structure. In the LGPS example this gives 0.152 +/- 0.035 eV and 91.44 +/- 79.18 mS/cm from five 20 ps runs.

Interfaces and environment

Trajectories must be ASE .traj files, produced by the run_md tool of a potential skill such as mace or matgl, which expands the cell to supercell_min_length (10 A by default) and can run several structures at once. The diffusion monitor from mat-md-monitors stops a run when D has converged within a threshold and saves diffusion_{specie}.json and msd_{specie}.png itself, so step 2 is skipped for those runs. The analysis scripts run in the cpu environment through venv/run. The sibling skill mat-md-monitors documents the monitors.

What it computes on the map

2 quantities, drawn by tier with the data flow between them. Dashed boxes are intermediate quantities. Select one for its formula and the other codes that compute it.

Open the full mapShare this submap
Embed this submap
<iframe src="https://openmaterials.ai/m/c56731602651/00000000000000000000000018?embed=1" title="AtomisticSkills mat-diffusion-analysis on the OpenMaterials map" width="100%" height="480" loading="lazy" style="border:1px solid #EBEBEB;border-radius:6px"></iframe>

Each quantity with the interface the representation records.

  • ActivationEnergyweighted Arrhenius fit of the diffusivities over several temperatures, eVeV
  • Diffusivitypymatgen DiffusionAnalyzer.diffusivity over an MLIP MD trajectory (Einstein MSD slope), cm^2/scm^2/s

References

No curated reference list yet. The citations recorded on the map representation are listed under How to cite.

How to cite

B. Deng, B. Li, M. Cox, et al., Harnessing AtomisticSkills for Agentic Atomistic Research (2026), arXiv:2605.24002 (mat-diffusion-analysis skill)

doi.org/10.48550/arXiv.2605.24002