From: Olaf Lenz (lenzo_at_mpip-mainz.mpg.de)
Date: Sat Apr 11 2009 - 07:15:51 CDT

Hi!

Neelanjana Sengupta wrote:
> However, if one uses the pbcwrap tool from the pbctools plugin to
> re-write a trajectory with the coordinates wrapped, then the results
> obtained with 'within' should be accurate, right?

This is not completely true. This is only true under the following
conditions:
1. The coordinates have been wrapped around the reference point of "within".
2. The distance used in "within" is smaller than half the smallest side
length of the unit cell ( d < 0.5*min(A,B,C) ).

If these conditions hold, then "within" should be correct.

> The reason I am
> bringing this up is because when I do the above and compare with results
> obtained rigorously (ie. by taking each atom pair and re-calculating
> their distance based on PBC), I do not get a perfect match.

What do you mean by "not [...] a perfect match"? Can the differences be
a matter of numerical precision (i.e. small differences), or are we
talking about some distances being completely bogus?
It would be really helpful if you could provide us with some more
details, like: how did you compute the periodic distances, how exactly
did you wrap, what were the unitcell parameters etc.

Olaf