Verifying the correctness of an MD simulation is challenging.
Because MD is Lyapunov unstable, any small errors, even harmless round-off errors, will lead to a long-term divergence in the atom trajectories. Hence, comparing atom positions at the end of a run is not always a useful verification technique. (Such divergences are not a problem for science applications of MD since they do not alter the statistical physics.) Small, single-particle errors can also be difficult to detect in system-wide quantities such as the kinetic or potential energy that are averaged over a large number of particles.
In spite of these challenges, there are several methods which are likely to catch significant errors.
With a perfect lattice as the initial structure (this is the default), the potential energy per atom is the cohesive energy. This value should be computed correctly to many decimal places. Any variation beyond the last 1 or 2 decimal places is cause for investigation. The correct values for the cohesive energy are
| Potential | Cohesive Energy |
|---|---|
| Lennard-Jones | -1.243619295058 |
| EAM (Adams) | -3.538079224691 |
| EAM (Mishin) | -3.539999969176 |
The command line options documentation explains the switches used to select the potential used in the simulation.
Note that the cohesive energy calculation is not sensitive to errors in forces. It is also performed on a highly symmetric structure so there are many errors this will not catch. Still, it is a good first check.
A correctly implemented force kernel, with an appropriate time step (the default value of 1 fs is conservative for temperatures under 10,000K) will conserve total energy over long times to 5 or more digits. Any long term systematic drift in the total energy is a cause for concern.
To facilitate checking energy conservation CoMD prints the final and initial values of the total energy. When comparing these values, pay careful attention to these details:
The simulation should always end with the same number of particles it started with. Any change is a bug. CoMD checks the initial and final number of particles and prints a warning at the end of the simulation if they are not equal.
The same simulation run repeatedly on the same hardware should produce the same result. Because parallel computing can add elements of non-determinism we do not expect perfect long term reproducibility, however over a few hundred to a few thousand time steps the energies should not exhibit run-to-run differences outside the last 1 or 2 decimal places. Larger differences are a sign of trouble and should be investigated. This kind of test is practically the only way to detect race conditions in shared memory parallelism.
In our experience, simulations that start from the same initial condition tend to produce very similar trajectories over short terms (100 to 1000 time step), even on different hardware platforms. Short term differences beyond the last 1 or 2 decimal places should likely be investigated.