Skip to content

Conversation

@V-Francois
Copy link
Contributor

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.
verlet

@V-Francois V-Francois requested a review from a team as a code owner January 26, 2026 14:38
@codecov
Copy link

codecov bot commented Jan 26, 2026

Codecov Report

❌ Patch coverage is 96.59091% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/neighbours.jl 97.50% 2 Missing ⚠️
src/ParticlesMC.jl 0.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/IO/IO.jl 69.83% <100.00%> (+0.12%) ⬆️
src/atoms.jl 96.87% <100.00%> (ø)
src/molecules.jl 71.11% <100.00%> (ø)
src/ParticlesMC.jl 8.91% <0.00%> (+1.98%) ⬆️
src/neighbours.jl 82.24% <97.50%> (+9.44%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants