Skip to content

Commit

Permalink
refactorizing Q calculation for easy understanding
Browse files Browse the repository at this point in the history
  • Loading branch information
yihengwuKP committed Sep 10, 2024
1 parent 8b8a4fc commit 7e40fcd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pysages/colvars/contacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ def native_contact_fraction(r, contact_pairs, references, gamma, lambda_d, clip,

distances_contacts = distances[contact_pairs[:, 0], contact_pairs[:, 1]]
reference_distances_contacts = reference_distances[contact_pairs[:, 0], contact_pairs[:, 1]]
diff = distances_contacts - lambda_d * reference_distances_contacts
diff = gamma * (distances_contacts - lambda_d * reference_distances_contacts)
if clip:
diff = np.clip(diff, None, clip_val / gamma)
Q_contribution = 1 / (1 + np.exp(gamma * diff))
diff = np.clip(diff, None, clip_val)
Q_contribution = 1 / (1 + np.exp(diff))

N_contacts = contact_pairs.shape[0]

Expand Down

0 comments on commit 7e40fcd

Please sign in to comment.