From 3cae2edb1ac06e097624658eb9e95bc98cce1387 Mon Sep 17 00:00:00 2001 From: m-julian <52214154+m-julian@users.noreply.github.com> Date: Sat, 22 Jun 2024 12:33:15 +0100 Subject: [PATCH] add comments --- .../core/models/gaussian_energy_derivative_wrt_features.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ichor_core/ichor/core/models/gaussian_energy_derivative_wrt_features.py b/ichor_core/ichor/core/models/gaussian_energy_derivative_wrt_features.py index c7062db6..5d5604bb 100644 --- a/ichor_core/ichor/core/models/gaussian_energy_derivative_wrt_features.py +++ b/ichor_core/ichor/core/models/gaussian_energy_derivative_wrt_features.py @@ -238,9 +238,12 @@ def convert_to_feature_forces( # can use np.linalg.pinv here as well g_inv = form_g_inverse(g_matrix) - gradient_dE_df = g_inv @ b_matrix @ copied_forces_array + # note that if the forces are passed in, will get the + # feature forces, which are the -ve of the gradient + # the gradient is what is used for models + feature_forces = g_inv @ b_matrix @ copied_forces_array - return gradient_dE_df + return feature_forces def convert_to_cartesian_forces(