Collection of codes to analyze periodic ab initio molecular dynamics (AIMD) simulations. The scripts are currently tailored to the output generated from the Vienna Ab initio Simulation Package (VASP), but the input files can also be formatted for other software. These generalized codes work for simulation boxes in the cartesian geometry where the lattice vectors are orthogonal. These codes are being continuously developed, and more features will be added soon.

The XDATCAR file generated by VASP after an AIMD run is first formatted with the command below and then copied to a .xlsx file to use with the scripts. The command to delete the 'Direct Configuration' line from XDATCAR:
sed -i '/Direct/d' XDATCAR
bond_length.py tracks the bond distance between two atoms during a periodic ab initio molecular dynamics simulation. The script can be run with:
python bond_length.py *XDATCAR.xlsx atom1 atom2 OUTPUT.png
Here, atom1 and atom2 are the indexes of the atom whose bond is being monitored, and OUTPUT.png gives the evolution of the bond length for simulation. *XDATCAR.xlsx is the input file.
bond_angle.py tracks the bond angle between three atoms during a periodic ab initio molecular dynamics simulation. The script can be run with:
python bond_angle.py *XDATCAR.xlsx atom1 atom2 atom3 OUTPUT.png
Here, atom1, atom2, and atom3 are the index of the atoms whose angle is being monitored, and OUTPUT.png gives the evolution of the bond angle for simulation. *XDATCAR.xlsx is the input file.
dihedral_angle.py tracks the dihedral angle between four atoms during a periodic ab initio molecular dynamics simulation. The script can be run with:
python dihedral_angle.py *XDATCAR.xlsx atom1 atom2 atom3 atom4 OUTPUT.png
Here, atom1, atom2, atom3, and atom4 are the indexes of the atoms whose dihedral angle is being monitored, and OUTPUT.png gives the evolution of the dihedral for simulation. *XDATCAR.xlsx is the input file.
H_bond_counter.py tracks the number of hydrogen bonds for a reference atom for any generalized mixture of solutes and solvents during a periodic ab initio molecular dynamics simulation. The script can be run with:
python H_bond_counter.py *XDATCAR.xlsx atom1 OUTPUT.png
Here, atom1 is the reference atom whose hydrogen bonds are being tracked, and OUTPUT.png gives the evolution of these interactions for simulation. The cutoff for hydrogen bonds is set at 2 Å and for atom-hydrogen covalent bonds at 1.2 Å. *XDATCAR.xlsx is the input file.
radial_distribution_function.py generates a reference atom's probability and radial distribution functions for a periodic ab initio molecular dynamics simulation. The code can be manipulated to give instantaneous and average distribution functions. The script can be run with:
python radial_distribution_function.py *XDATCAR.xlsx atom1 frame1 grid1 OUTPUT1.png OUTPUT2.png OUTPUT3.png
Here, atom1 is the reference atom for creating the radial distribution function, frame1 is the frame index for the instantaneous rdf of the particular frame, grid1 is the gridpoint size for generating the distributions, and the three OUTPUT files give instantaneous and average distribution functions. *XDATCAR.xlsx is the input file.
volume_fraction_distribution gives the amount of volume and the fraction of volume around a reference atom occupied by the rest of the atoms for a periodic ab initio molecular dynamics simulation. This distribution quantifies the local environment by treating atoms as soft van der Waals spheres and calculating how much volume is occupied by surrounding atoms for a reference atom as a function of distance. The code gives the volume occupied and the fraction relative to the total volume. The script can be run with:
python volume_fraction_distribution.py *XDATCAR.xlsx atom1 grid OUTPUT.png
Here, atom1 is the reference atom for creating the volume fraction distribution, grid is the gridpoint size for generating the distributions, and the OUTPUT file gives volume and volume fraction distributions. *XDATCAR.xlsx is the input file.
Mayank Tanwar email: tanwa008@umn.edu GitHub: tanwarmayank524
Nhu Quach email: quach062@umn.edu GitHub: quach062
Publications relevant to the code: https://doi.org/10.1021/jacs.2c07305, https://doi.org/10.1021/jacs.4c08080
NSF Center for Synthetic Organic Electrochemistry (https://cci.utah.edu/)