Equations (8 - 9) are solved using finite
differences with a constant step in space
*x* = *y* = *z* = 1 and a constant step in the expansion parameter *a* . We
use the ``leap-frog'' scheme to advance coordinates and velocities
from one moment to another. (In the following we drop tildas for all
dimensionless variables.) At any moment
*a*_{n} = *a*_{0} + *n**a* , we have the
coordinates
**x** _{n} and the potential . Velocities
**p** _{n - 1/2} are defined at
*a*_{n - 1/2} = *a*_{n} - *a*/2 . The coordinates and the velocities for the next moment are found using:

p _{n + 1/2}
| = |
p _{n - 1/2} - F(a_{n})a,
| |

x _{n + 1}
| = |
x _{n} + p _{n + 1/2}a
| (14) |

In order to solve eq.(9) we approximate the Laplacian operator using the 7-point ``crest'' template:

+ + - 6, | (15) |

where
(*i*,*j*,*k*) = 1,...,*N*_{grid} .
This leads to a large system of linear equations relating unknown
variables
with known right-hand side of the discrete
form of the Poisson equation
3( - 1)/2*a* .
The system of equations is solved exactly by the FFT technique.

The density on the mesh
is obtained from particle
positions using the Cloud-In-Cell method. In order to find the
``acceleration''
**g** = - for each particle, the gravitational
potential is differentiated on the mesh:

g_{x} = - ( - )/2, g_{y} = ..., g_{z} = ...
| (16) |

Thus, the main scheme of the PM method consists of the following four blocks repeated every time step:

- Find density on the mesh using the Cloud-In-Cell technique.
- Solve the Poisson equation using two three-dimensional FFTs.
- Advance velocities and coordinates of the particles.
- Advance time and print results.