summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Luevano Alvarado <55825613+luevano@users.noreply.github.com>2020-02-29 09:08:22 -0700
committerDavid Luevano Alvarado <55825613+luevano@users.noreply.github.com>2020-02-29 09:08:22 -0700
commit2db295947a75ab0347ba0e11b98564da9d228c6a (patch)
tree813c47bd86ba4752b21444f99b7d1828b7db4280
parentda6b1428cda40534b820642d8e9be398d7fee8be (diff)
Temp fix for adj mat
-rw-r--r--ml_exp/representations.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/ml_exp/representations.py b/ml_exp/representations.py
index 5e684314b..5e99627df 100644
--- a/ml_exp/representations.py
+++ b/ml_exp/representations.py
@@ -242,12 +242,14 @@ size. Arrays are not of the right shape.')
def adjacency_matrix(fnm,
bonds,
forces,
+ use_forces=False,
size=22):
"""
Calculates the adjacency matrix given the bond list.
fnm: first neighbour matrix.
bonds: list of bonds (tuple of indexes).
forces: list of forces.
+ use_forces: if the use of forces instead of k_cx should be used.
size: compund size.
"""
n = len(bonds)
@@ -264,7 +266,7 @@ def adjacency_matrix(fnm,
# Ignore the diagonal.
if i != j:
if (bond_i[0] in bond_j) or (bond_i[1] in bond_j):
- if forces:
+ if use_forces:
am[i, j] = np.dot(forces[i], forces[j])
else:
am[i, j] = fnm[bond_i[0], bond_i[1]]