Skip to content

Commit

Permalink
Of course the gradient doesn't need to be "translated".
Browse files Browse the repository at this point in the history
  • Loading branch information
greghjones committed Feb 19, 2024
1 parent 92ae454 commit 107becf
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions pysisyphus/calculators/CFOUR.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,12 @@ def rotate_gradient(self, text, gradient):

cfour_coords_3d = self.read_geom(text)
pysis_coords_3d = np.reshape(self.input_coords, (-1,3))

cfour_centroid = self.calc_centroid(cfour_coords_3d)
pysis_centroid = self.calc_centroid(pysis_coords_3d)

rot_matrix = self.calc_rot_matrix(cfour_coords_3d, pysis_coords_3d, cfour_centroid, pysis_centroid)

t = self.calc_translation(rot_matrix, cfour_centroid, pysis_centroid)

return (gradient @ rot_matrix.T) + t
return (gradient @ rot_matrix.T)

def read_geom(self, text):
regex = r"Coordinates used in calculation \(QCOMP\)(.+)Interatomic distance matrix"
Expand Down Expand Up @@ -173,9 +170,6 @@ def calc_rot_matrix(self, cfour_coords_3d, pysis_coords_3d, cfour_centroid, pysi

return R

def calc_translation(self, rotation_matrix, cfour_centroid, pysis_centroid):
return pysis_centroid - rotation_matrix @ cfour_centroid

def run_calculation(self, atoms, coords, calc_type):
self.input_coords = coords ## For use later to rotate CFOUR gradient to the pysisyphus frame
inp = self.prepare_input(atoms, coords, calc_type)
Expand Down

0 comments on commit 107becf

Please sign in to comment.