From d34f2729fd4ce4914642b332ed8f8417cd22a5b5 Mon Sep 17 00:00:00 2001 From: jeff231li Date: Thu, 31 Aug 2023 15:19:49 -0700 Subject: [PATCH] ling --- paprika/analysis/analysis.py | 38 +++++++++++++++--------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/paprika/analysis/analysis.py b/paprika/analysis/analysis.py index 2b22d50..9cf107c 100644 --- a/paprika/analysis/analysis.py +++ b/paprika/analysis/analysis.py @@ -1036,32 +1036,26 @@ def run_ti(self, phase, prepared_data, method): # Compute forces and store the values of the changing coordinate, # either lambda or target if phase == "attach" or phase == "release": - dU[k, 0 : N_k[k]] = ( - sum( - [ - (k * (val - eq) ** 2) - for k, val, eq in zip( - max_force_constants, ordered_values[k], targets_T[k] - ) - ] - ) - .m_as(self.energy_unit) - ) + dU[k, 0 : N_k[k]] = sum( + [ + (k * (val - eq) ** 2) + for k, val, eq in zip( + max_force_constants, ordered_values[k], targets_T[k] + ) + ] + ).m_as(self.energy_unit) # this is lambda. assume the same scaling for all restraints dl_vals[k] = force_constants_T[k, 0] / max_force_constants[0] else: - dU[k, 0 : N_k[k]] = ( - sum( - [ - 2.0 * k * (val - eq) - for k, val, eq in zip( - max_force_constants, ordered_values[k], targets_T[k] - ) - ] - ) - .m_as(self.energy_unit / self.distance_unit) - ) + dU[k, 0 : N_k[k]] = sum( + [ + 2.0 * k * (val - eq) + for k, val, eq in zip( + max_force_constants, ordered_values[k], targets_T[k] + ) + ] + ).m_as(self.energy_unit / self.distance_unit) # Currently assuming a single distance restraint dl_vals[k] = targets_T[k, 0].m_as(self.distance_unit)