feat: implement Verlet neighbour list#65
Merged
romainljsimon merged 11 commits intomainfrom Feb 3, 2026
Merged
Conversation
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
romainljsimon
pushed a commit
that referenced
this pull request
Feb 2, 2026
**Summary** This PR removes the validation subdirectory and moves its content to example. I initially felt like a validation subdir had some sense, as it shows that the code actually does what it should. With #65 that adds a thorough example, I feel like it makes more sense to put everything as examples. Maybe at some point add a README to explain that the results were validated, with a link to the LJ mixture example?
romainljsimon
approved these changes
Feb 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.