Hi developers,
I’ve written a script that calculates IR spectra based on a LAMMPS MD simulations, and I’d like to share it with the community. I’d be happy if you want to put it in LAMMPS’s included examples or on http://lammps.sandia.gov/user.html.
The code does a few things:
- It shows how to print out the net dipole moment of the system (implementing Axel’s method given in http://lammps.sandia.gov/threads/msg25750.html).
- It calculates the autocorrelation function of the net dipole moment.
- It computes the Fourier transform of the autocorrelation function to get the spectrum.
The files are attached, and can also be found at https://github.com/efremdan1/calc-ir-spectra-from-lammps. On the github page, I show the output files one obtains from running the code (since the LAMMPS simulation takes about 3.5 hours on a single core computer and the post-processing takes about 2.5 hours), but since it states on http://lammps.sandia.gov/user.html that the aggregate file size shouldn’t be too large, I’m guessing you wouldn’t want it.
calc-ir-spectra.py (5.51 KB)
data.infrared (57.9 KB)
in.infrared (3.33 KB)
README (2.94 KB)