Currently, we check the distance between interaction sites versus the cutoff.
let r = system.cell().distance(posi, posj);
if r >= self.cutoff {
0.0
} else {
// compute potential / force
We could test if using the squared distance and squared cutoff (an hence skipping calculation of the square root) impacts performance.
let r2 = system.cell().distance2(posi, posj);
if r2 >= self.cutoff2 {
0.0
} else {
// (compute distance)
// compute potential / force