Hello.
I am seeking advice regarding the utilization of the delta_vector method in OVITO for calculating the vector between two particles. The particle coordinates can be found in the dump file below.

Additionally, I have employed the formula outlined in the book (Allen, M. P., & Tildesley, D. J. (2017). Computer simulation of liquids (2nd ed.). Oxford University Press.) to compute the vector between the two particles. The formula is as follows:

I have noticed discrepancies in the obtained vectors along the x-direction.
Thanks in advance. Below is my data processing code:

The method you described calculates the distance by identifying the nearest particle in Cartesian space. Conversely, OVITO employs reduced coordinates to determine this distance. When working with sheared cells, these two approaches may not identify the same periodic image as the closest one for subsequent distance calculation.

The image below illustrates the difference: Your method links the two particles across the periodic boundary, whereas OVITO connects them within the primary cell. This discrepancy results in the two different Cartesian distances calculated by your code.

In reduced coordinates, which are scaled by a factor of 10 for better visibility, the distance within the primary cellâ€”as determined by OVITO - becomes the shorter one.

Thank you for your response. Could you please clarify if â€średuced coordinatesâ€ť refer to the coordinates obtained by affine transformation of particle coordinates from a deformed box to an orthogonal box? Additionally, Iâ€™m unsure why OVITO utilizes these reduced coordinates for distance calculations. How can one avoid using reduced coordinates in OVITO?

Could you please clarify if â€średuced coordinatesâ€ť refer to the coordinates obtained by affine transformation of particle coordinates from a deformed box to an orthogonal box?

The fractional coordinate system gives the position of a particle in reference to the cell vectors.

Here, the ion positions (in ) are listed. The first line selects one of the two possible modes how the coordinates and given in the following lines are interpreted:

â€śDirectâ€ť means the positions are provided in direct (fractional) coordinates: where is the position vector of an ion.

Yes, this corresponds to an affine transformation of the particles into a cube with unit edge length.

Iâ€™m unsure why OVITO utilizes these reduced coordinates for distance calculations.

It accelerates the process of finding the correct nearest periodic image of the requested particle. Otherwise one would need to manually check all 27 neighbors.

Additionally, Iâ€™m unsure why OVITO utilizes these reduced coordinates for distance calculations.

The actual distance is calculated in Cartesian coordinate space. The reduced coordinates are only used to identify the right periodic image of the atoms.

How can one avoid using reduced coordinates in OVITO?

You would need to hand roll your own â€śdelta vectorâ€ť function. Here, I would recommend to using the replicate modifier to generate the periodic images and afterwards calculating the distance of particle A to all 27 images of particle B and storing the closest distance.