feat: implement Verlet neighbour list #65
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements a flavor of Verlet list. It addresses #63.
The VerletList object contains for each particle in the system, an array of all its neighbours (defined as all particles within the interaction cutoff + some arbitrary parameter dr).
These arrays of neighbours are updated only when a given particle moves a distance greater than dr/2, ensuring that the list of neighbours always contains all particles within the interaction cutoff radius.
Test plan
The CI was updated to check over a trajectory that the energy is identical to that obtained using different neighbour list methods.
Performances

The VerletList implementation was compared to the LinkedList one, for a system of ortho-terphenyl molecules, at density 1.2 and temperature 2.
In the attached plot, the simulation time is reported for different values of the parameter dr. The dashed line at the top is the timing with the LinkedList implementation. For reference, the interaction cutoff is 1.23.
The timing is done once for each Verlet list, and 4 times for the LinkedList, with values ranging from 75s to 105s.
There's quite a lot of variability between repeats, but we still have a ~2x speedup for this system, for 0.3 < dr < 0.6.