Hello all,
I am also trying to calculate the diffusion coefficient of water, and rather than create a new thread, I decided to continue this one. I’ve run the TRPMD simulations recommended above, but I am having trouble getting realistic results for the diffusion coefficient. I know I need the Kubo-transformed velocity autocorrelation function (as seen in Eq. 43 in https://aip.scitation.org/doi/10.1063/1.2953308 ), so I tried using the getacf.py python script included in the i-PI release, but the results I'm getting do not get anywhere close to the expected results. My results for the radial distribution functions are in good agreement with published results, so I do not think it is an issue with how I'm running my simulation (though that is a possibility). My question is: does i-PI do the necessary Kubo-transform of the velocity autocorrelation function in the getacf python script (I tried looking through the source code but couldn’t determine whether or not this is the case)? If it does not, what steps do I need to take to perform this transform?
Thanks,
Chris
python ~/source/i-pi-dev/tools/py/getacf.py -ifile simulation.vc.xyz -mlag 2000 -bsize 4000 -ftpad 4000 -ftwin none -dt "1.0 femtosecond" -oprefix out
Thank you all for your prompt and informative replies.
Michele, thank you for clearing that up.
Mariana, from what I can tell, i-PI does not include any functionality for computing the mean square displacement. This isn’t too much of an issue, as many MD codes are capable of doing so on their own. I’ll look into how to compute it using LAMMPS (the client MD code I am using).
Venkat, I took the files you
provided, ran the i-PI simulation, ran the same python command you provided to
get the vvacf, loaded the file into a Python script, performed the integration
& divided by 3 (per the formula from the reference). I got a value of 1.49088e-4
[bohr^2 / atomic time], which translates to 1.725 Angstrom^2/ps after
multiplying by the unit-conversion prefactor you provided. This is significantly
larger than the value you got, so I suspect that there is something that I am
neglecting to do. My run did use a different random seed from the file you
provided, but I don’t think that would lead to a difference of this magnitude.
I’ve attached a .png file containing the plot of the vvac as well as the Fourier transform of the vvac. As far as I can tell, the Fourier transformed vvac looks correct, so I suspect my issue is not with the i-PI run or the getacf.py command, but rather in how I calculate the diffusion coefficient. The exact Python command I use is:
D=numpy.trapz(vvacf, t)/3*11576.76
Is this not the correct way to calculate this diffusion coefficient?
Thanks,
Chris