Neighborlists
Neighborlists are a data structure used in molecular dynamics simulations and other computational physics applications to efficiently find pairs of atoms or particles that are close to each other. In simulations involving a large number of particles, calculating the interactions between every possible pair of particles at each time step can be computationally very expensive, often scaling as O(N^2) where N is the number of particles. Neighborlists aim to reduce this computational cost by only considering interactions between particles that are within a certain cutoff distance.
The basic idea behind a neighborlist is to divide the simulation box into a grid of cells.
There are various types of neighborlists, including Verlet lists and Cell Lists. Verlet lists store pairs of
Updating the neighborlist is a crucial step. As particles move during the simulation, the list of neighbors