-
Notifications
You must be signed in to change notification settings - Fork 19
Description
Expected behavior
The subroutine Minimum_Image_Separation should compute the minimum image distance between two atoms.
Current behavior
The subroutine Minimum_Image_Separation computes the distance from a central atom i to the image of another atom j in a cell centered on atom i. For cubic and orthogonal cells, the distance between atom i and the image of j in this cell will be the minimum image distance. However, for triclinic cells the image j in this cell may not be the closest image to i.
Steps to reproduce
- In the input file, create a triclinic box with lattice vectors a = (1, 0, 0), b = (1/2, sqrt(3)/2, 0), c = (0, 0, 1). This can be accomplished by adding the following section to a CASSANDRA input file:
# Box_Info
1
cell_matrix
1.000000 0.500000 0.000000
0.000000 0.866025 0.000000
0.000000 0.000000 1.000000
- Create a system with two atoms at scaled positions (1/3, 1/3, 0) and (7/8, 7/8, 0). This can be accomplished by creating an xyz
file with the following content:
2
# BOX: 1.000000 1.000000 1.000000 90. 90. 60.
LJ 0.500000 0.288675 0.000000
LJ 1.312500 0.757772 0.000000
3a. As input, the vector pointing from atom 1 to atom 2 is (13/24, 13/24, 0) in scaled coordinates and (0.812501, 0.469097, 0) in Cartesian coordinates. The length of this vector is 0.938195.
3b. In a triclinic cell centered on atom 1, atom 2 gets wrapped along lattice vectors a and b. The vector pointing from atom 1 to image 2 is (-11/24, -11/24, 0) in scaled coordinates and (-0.687499, -0.396928, 0) in Cartesian coordinates. The length of this vector is 0.793856. This is the distance that CASSANDRA finds.
3c. If we wrap atom 2 only using lattice vector a, the vector pointing from atom 1 to image 2 is (-11/24, 13/24, 0) in scaled coordinates and (-0.187499, 0.469097, 0) in Cartesian coordinates. The length of this vector is 0.505181. This is the distance that CASSANDRA should find.
Possible solution (optional)
Rather than wrapping atoms such that the scaled distance between atoms is on the range [-0.5, 0.5] along each lattice vector, we might could wrap atoms until the Cartesian component of the distance is on the range [-hbox, hbox] where hbox is half the distance between faces of an orthogonal cell constructed around atom i.