Velocity cross-correlation function

The collective dynamics of different particles in a MD simulation can be investigated through velocity cross-correlation functions (VCCF). vccf.py computes the time cross-correlation function between the initial velocity of a particle of type \(i\) and the latter velocities of particles of type \(j\), initially located inside a spherical shell of radius \(R\) around the particle of type \(i\), defined as

\[C(t) = \frac{ \left\langle \boldsymbol{v}_j(t) \cdot \boldsymbol{v}_i(0) \right\rangle } { \left( \left\langle v_i^2 \right\rangle \left\langle v_j^2 \right\rangle \right) ^{0.5} }\]

where \(\boldsymbol{v}_i(t)\) and \(\boldsymbol{v}_j(t)\) are the velocity of the particles \(i\) and \(j\) at any specific time, \(\left\langle v_i^2 \right\rangle\) and \(\left\langle v_j^2 \right\rangle\) are the mean squared velocities of all particles of type \(i\) and \(j\), respectively. \(\left\langle \boldsymbol{v}_j(t) \cdot \boldsymbol{v}_i(0) \right\rangle\) is a restricted statistical average defined as

\[\frac{1}{N} \left\langle \sum_{j} \boldsymbol{v}_j(t) \cdot \boldsymbol{v}_i(0) \cdot u( R - r_{ij}(0) ) \right\rangle\]

where \(u(x)\) is the step function, \(r_{ij}(0)\) is the initial distance between the central particle \(i\) and a particle \(j\), and \(N\) is the mean number of \(j\) particles in the spherical shell of a particle \(i\). The cutoff radius \(R\) for species \(i\) and \(j\) is usually set to the position of the first minimum of their center-of-mass radial distribution function.

Usage:

python vccf.py -h

Tip

Example data files, particle_a.data and particle_b.data, are available in the example directory. The required values to run the example can be found in the md.param file.

vccf.ccf(Avel, Bvel, Apos, Bpos, rmax, box, same=False)

Computes the velocity cross-correlation function (VCCF) for a set of particles, which is a measure of how the velocity of a particle \(i\) at a given time is correlated with the velocity of particles \(j\) at a later time.

Parameters:
  • Avel (np.ndarray) – A 3D NumPy array of particle velocities of shape (N, 3, M) where N is the number of particles of type \(i\), 3 represents the x, y, z dimensions, and M is the number of time steps.

  • Bvel (np.ndarray) – A 3D NumPy array of particle velocities of shape (N, 3, M) where N is the number of particles of type \(j\), 3 represents the x, y, z dimensions, and M is the number of time steps.

  • Apos (np.ndarray) – A 3D NumPy array of particle positions of shape (N, 3, M) where N is the number of particles of type \(i\), 3 represents the x, y, z dimensions, and M is the number of time steps.

  • Bpos (np.ndarray) – A 3D NumPy array of particle positions of shape (N, 3, M) where N is the number of particles of type \(j\), 3 represents the x, y, z dimensions, and M is the number of time steps.

  • rmax (float) – The cutoff radius around an \(i\) particle within which the \(j\) particles considered as neighbors.

  • box (list of floats) – Length of the 3 cell vectors of the simulation box.

  • same (bool) – Are particles \(i\) and \(j\) the same type?

Returns:

  • crosscorrelation (np.ndarray) – A 1D NumPy array representing the average VCCF of all \(i\) particles and a neighboring \(j\) particle.

  • crosscorrelation_avg (np.ndarray) – A 1D NumPy array representing the average VCCF of all \(i\) particles averaged over all neighboring \(j\) particle.

  • num_nb (float) – Average number of \(j\) particles around an \(i\) particle.