Skip to content

Documentation Clarification #175

Closed

Description

@ejmeitz

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.

function f(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 output
    return output
end

Activity

  1. lmiq commented on May 13, 2026

    @lmiq
    Member

    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:

    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.

  2. ejmeitz commented on May 13, 2026

    @ejmeitz
    Author

    I just realized the other place in the docs does specify this:

    The coordinates of particle j of the pair (minimum-image relative to x).
    
  3. lmiq commented on May 13, 2026

    @lmiq
    Member

    I added this to the docs:

    Image

    If you find any inconsistency, let me know. Thanks again.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions