When I calculate the vector between the center atom (i) and target atom (j), sometimes, the sign is inverted from that is defined in GULP. This may be because the minimal image convention is not unique.
As an ad hoc fix, I create nearest.py that is direct interpretation from GULP fortran code.
But, the code is messy and I think there should be more efficient way to solve this problem.
And also, I don't know the exact reason, running all index cause different result (limiting lower triangle and setting Vij=-Vji fix this matter)
These unclear point should be resolved after tentative version works.
I have made faster&simple algorithm but it is only for orthorhombic system. (nearest/find_nearest_ortho)
Need to assert to check the cell is orthorhombic or not and consider more general algorithm.
When I calculate the vector between the center atom (i) and target atom (j), sometimes, the sign is inverted from that is defined in GULP. This may be because the minimal image convention is not unique. As an ad hoc fix, I create nearest.py that is direct interpretation from GULP fortran code.
But, the code is messy and I think there should be more efficient way to solve this problem.
And also, I don't know the exact reason, running all index cause different result (limiting lower triangle and setting Vij=-Vji fix this matter)
These unclear point should be resolved after tentative version works.