Skip to content

Commit

Permalink
take into account feedback from the editor
Browse files Browse the repository at this point in the history
1. clarity of first paragraph
2. typos and style issues
3. update of the figures
  • Loading branch information
pdebuyl committed Aug 27, 2018
1 parent d4c95df commit 33e6aea
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 16 deletions.
Binary file modified paper/msd_example.pdf
Binary file not shown.
11 changes: 11 additions & 0 deletions paper/paper.bib
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,14 @@ @article{hinsen_nmoldyn3_2012
abstract = {Abstract We present a new version of the program package nMoldyn, which has been originally developed for a neutron-scattering oriented analysis of molecular dynamics simulations of macromolecular systems (Kneller et al., Comput. Phys. Commun. 1995, 91, 191) and was later rewritten to include in-depth time series analyses and a graphical user interface (Rog et al., J. Comput. Chem. 2003, 24, 657). The main improvement in this new version and the focus of this article are the parallelization of all the analysis algorithms for use on multicore desktop computers as well as distributed-memory computing clusters. The parallelization is based on a task farming approach which maintains a simple program structure permitting easy modification and extension of the code to integrate new analysis methods. © 2012 Wiley Periodicals, Inc.}
}


@Article{oliphant_cise_2007,
Title = {Python for Scientific Computing},
Author = {Travis E Oliphant},
Journal = {Computing in Science {\&} Engineering},
Year = {2007},
Pages = {10--20},
Volume = {9},
doi = {10.1109/MCSE.2007.58},
}

36 changes: 20 additions & 16 deletions paper/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@ bibliography: paper.bib

# Summary

tidynamics provides an efficient implementation of the Fast Correlation Algorithm to compute
correlation functions of interest in molecular [@allen_tildesley_1987;@nmoldyn_1995] and
stochastic [@gardiner_2004] dynamics.
The autocorrelation, the correlation between two time-series, the mean-square displacement,
and the cross-displacement (for off-diagonal realisations of Brownian motion), allow the
quantitative measure of relaxation and transport coefficients from numerical trajectories.
tidynamics provides an efficient implementation of the Fast Correlation Algorithm (FCA) to
compute correlation functions of interest in molecular [@allen_tildesley_1987;@nmoldyn_1995]
and stochastic [@gardiner_2004] dynamics.
Building on the FCA, tidynamics computes the autocorrelation (the correlation of a time
series with itself), the correlation between two time-series, the mean-square displacement
of a trajectory, and the cross-displacement (for off-diagonal realisations of Brownian
motion).
These correlation functions serve for the quantitative measure of relaxation and transport
coefficients from numerical trajectories.

There is a lack of a self-contained implementation of the algorithm. The software nMoldyn
[@hinsen_nmoldyn3_2012] implements it within a larger library but it has a more complex
Expand All @@ -31,18 +34,18 @@ implementation with a lighter interface.

tidynamics is designed as a library in which every routine operates directly on NumPy arrays
and returns NumPy arrays. The interface is simple and enables convenient use in interactive
sessions or in teaching material. We test the library against Python 2.7, 3.5 and 3.6 and
sessions or in teaching material. We test the library against Python 2.7, 3.5, and 3.6 and
several versions of NumPy to guard against a possible sensitivity to the API.

The Fast Correlation Algorithm relies on the Fourier transform to compute correlations. For
this purpose, we use NumPy's [@travis_numpy_2006] FFT module `np.fft`.
this purpose, we use NumPy's [@oliphant_cise_2007] FFT module `np.fft`.
The advantage of using Fourier transforms is a reduced computational cost in comparison to a
direct loop over the data. We expect a scaling of the CPU time $t_\mathrm{CPU}$ of
$t_\mathrm{CPU} \propto N \log N$ where $N$ is the length of the time series. We show the
actual CPU time and compare it favourably to the expected scaling in the example *Scaling
behaviour*.
$t_\mathrm{CPU} \propto N \log N$ where $N$ is the length of the time series. We show in
Figure 3 the actual CPU time and compare it favourably to the expected scaling in the
example *Scaling behaviour*.

NumPy [@travis_numpy_2006] and SciPy [@scipy-web] implement correlation routines as well. In
NumPy [@oliphant_cise_2007] and SciPy [@scipy-web] implement correlation routines as well. In
the case of NumPy, the computation is based on a direct loop with a quadratic scaling of the
CPU time $O(N^2)$. In SciPy, both the direct and a Fourier transform version are
implemented.
Expand All @@ -54,16 +57,17 @@ zero-padding the signal, and they do not normalise the result by the actual numb
samples. In addition to these differences, the relative complexity of building SciPy and its
larger size motivated us to rely on NumPy only. NumPy and SciPy do not provide functions to
compute the mean-square displacement of trajectories. The Fast Correlation Algorithm as
applied to mean-square displacements was proposed in [@nmoldyn_1995] and is less known than
applied to mean-square displacements was proposed by @nmoldyn_1995 and is less known than
the plain correlation algorithm.

The benefits of using tidynamics originate in the implementation of the suitable definitions
for the study of dynamical systems, in a good performance, and in its ease of installation.
for the study of dynamical systems, good performance, and its ease of installation.

# Examples

We show in figures 1, 2, and 3 the examples provided with tidynamics. The examples in the
repository include short codes for a random walk and for the Ornstein-Uhlenbeck process.
We show in Figures 1, 2, and 3 the examples provided with tidynamics. The examples in the
repository include short codes for a random walk, for the Ornstein-Uhlenbeck process, and
for the scaling performance analysis of the autocorrelation routine.

![Mean-square displacement for a random walk and for a trajectory at constant velocity.](msd_example.pdf)

Expand Down
Binary file modified paper/scaling.pdf
Binary file not shown.
Binary file modified paper/vacf_example.pdf
Binary file not shown.

0 comments on commit 33e6aea

Please sign in to comment.