You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the pairwise docs it says that the positions of the two atoms are minimum image adjusted. What does this mean exactly.
I think of minimum image as with respect to a central atom. So is pair.y the minimum image coordinate relative to pair.x. At the end of the day I'm just interested in getting the distance vector between the two atoms in a way that respects PBC/minimum image convention. I'm guessing I can just do pair.y .- pair.x but its not immediately clear to me.
functionf(pair, output)
# pair.i, pair.j: indices of the particles# pair.x, pair.y: coordinates (minimum-image adjusted)# pair.d: distance between particles# pair.d2: squared distance# update outputreturn output
end
Your interpretation is correct, you can just compute pair.y - pair.y and pair.d == norm(pair.y - pair.x), and this distance will always be smaller than the cutoff, because we are already taking into account the PBCs and the cutoff.
This is illustrated in the example where we compute energy and forces, in the energy_and_forces! function:
Activity
lmiq commentedon May 13, 2026
Your interpretation is correct, you can just compute
pair.y - pair.yandpair.d == norm(pair.y - pair.x), and this distance will always be smaller than the cutoff, because we are already taking into account the PBCs and the cutoff.This is illustrated in the example where we compute energy and forces, in the
energy_and_forces!function:https://m3g.github.io/CellListMap.jl/stable/ParticleSystem/single_set_compound/#Warning-1976be32c5a90a34
I'll clarify that in the documentation and then close the issue. Thank you very much for your feedback.
ejmeitz commentedon May 13, 2026
I just realized the other place in the docs does specify this:
lmiq commentedon May 13, 2026
I added this to the docs:
If you find any inconsistency, let me know. Thanks again.