MD Probability Density Visualization
SkillDev toolsCalculate and visualize the probability density of diffusing ions from a Molecular Dynamics (MD) trajectory.
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the MD Probability Density Visualization skill
What this skill tells your AI
The instructions your AI receives, as published by learningmatter-mit/atomisticskills in .agents/skills/mat-md-probability-density/SKILL.md and read by ahel’s review.
Goal
To visualize the spatial probability density of mobile ions (e.g., Li, Na) from an MD simulation trajectory. This helps in understanding conduction pathways and identifying preferred occupation sites within the crystal structure. The output is a volumetric data object in CHGCAR format, which can be easily visualized using VESTA.
Instructions
-
MD Simulation: Run an MD simulation at an appropriate temperature to observe sufficient diffusion events.
Note: Short MD trajectories (e.g., ≤10 ps) often have too few discrete ion hops to naturally form continuous probability density tubes. The resulting density will look like isolated blobs exactly at the crystal lattice sites. To visualize continuous macroscopic diffusion pathways for short trajectories, use the
--logcompression flag to mathematically connect the sparse pathways.- The trajectory is typically saved to
trajectory.traj. - Ensure
supercell_min_lengthis reasonably large (>10 Å) to avoid finite-size artifacts in the density mapping. - Allow the simulation to run long enough so that the ions sample the entire available volume (e.g., 50-100 ps or more).
- The trajectory is typically saved to
-
Calculate Probability Density: Use the provided script to extract the fractional coordinates of the targeted species over time and convert them into a spatial density grid.
# Env: base-agent python .agents/skills/mat-md-probability-density/scripts/calculate_probability_density.py \ results/md_600K/trajectory.traj \ --species Li \ --interval 0.2 \ --ignore_ps 5.0 \ --output_chgcar results/md_600K/CHGCAR_proba--species: The specific diffusing ion to visualize.--interval: Grid spacing in Angstroms (0.1 to 0.5 is recommended). Smaller values give smoother isosurfaces but take longer to process and generate larger files. Defaults to0.2Å.--ignore_ps: The equilibration time to discard from the beginning of the trajectory.- The script will automatically detect the frame time step if a
.logfile is available alongside the.trajfile.
-
Visualize in VESTA:
- Open the output
CHGCAR(orCHGCAR_proba) file in VESTA. - Crucial VESTA Settings:
- Because we apply Gaussian smoothing and optional logarithmic compression, simply open Objects panel > Properties > Isosurfaces to adjust colors (e.g. set the surface to yellow).
- If you did not use
--logcompression on a sparse timeline, the peak values may be spread out. If you don't see any 3D clouds, your Isosurface level is too high. Try lowering it (e.g., to0.001or lower) until you see continuous 3D ion diffusion channels connecting the lattice sites. If you used--log, the default Isosurface level will usually connect the pathway out of the box.
- Open the output
Examples
- A fast workflow description based on a $Li_{12}Er_{12}Br_{48}$ Solid-State Electrolyte can be found in the LiErBr Example.
Constraints
- Environments: The script requires the base-agent conda environment.
- File formats: The trajectory should be provided in
ASE .trajformat. - Memory Limits: Avoid setting
--intervaltoo small ($< 0.1$) on large supercells, as this may result in extremely large 3D grid sizes and out-of-memory errors.
Author: Bowen Deng Contact: GitHub @learningmatter-mit
Signals
- GitHub stars
- 164
- Forks
- 24
- Last commit
- Sep 2026
Advanced
- Catalog kind
- skill
- Gateway key
mat-md-probability-density- Source
- github.com/learningmatter-mit/atomisticskills