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.
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.