bjmorgan / kinisi

A Python package for estimating diffusion properties from molecular dynamics simulations.
https://kinisi.readthedocs.io
MIT License
49 stars 11 forks source link

Faster implementation of the get_disp function #52

Closed jd15489 closed 7 months ago

jd15489 commented 7 months ago

Numpy's Einsum function is used to replace a slow for loop in the get_disp function. This loop applies the periodic boundary conditions to each frame of the displacements. The Einsum used is equivalent but gives a >10x speedup. There seems to be a small difference in the values these produce, <1e-5; potentially an imprecision error. This will need testing.