summaryrefslogtreecommitdiff
path: root/ml_exp/compound.py
diff options
context:
space:
mode:
authorDavid Luevano Alvarado <55825613+luevano@users.noreply.github.com>2020-02-23 22:06:30 -0700
committerDavid Luevano Alvarado <55825613+luevano@users.noreply.github.com>2020-02-23 22:06:30 -0700
commitb300e365d0886695b0d0220aad1be6cb38cf3c36 (patch)
tree38440ade31f5412b238ef5a6809d4f5ff01ff72e /ml_exp/compound.py
parentb82b90ec609ee80629f1e7f4b8a03cbbb53a0f21 (diff)
Add bos to compound, and bugfix to bos
Diffstat (limited to 'ml_exp/compound.py')
-rw-r--r--ml_exp/compound.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/ml_exp/compound.py b/ml_exp/compound.py
index 595078d55..8b6af0ae9 100644
--- a/ml_exp/compound.py
+++ b/ml_exp/compound.py
@@ -23,7 +23,7 @@ SOFTWARE.
import numpy as np
from ml_exp.data import NUCLEAR_CHARGE
from ml_exp.representations import coulomb_matrix, lennard_jones_matrix,\
- first_neighbor_matrix, adjacency_matrix
+ first_neighbor_matrix, adjacency_matrix, bag_of_stuff
class Compound:
@@ -115,6 +115,19 @@ class Compound:
forces,
size=size)
+ def gen_bos(self,
+ size=23,
+ stuff='bonds'):
+ """
+ Generate the Bag of Stuff for the compound.
+ size: compound size.
+ stuff: elements of the bag, by default the known bag of bonds.
+ """
+ self.bos = bag_of_stuff(self.cm,
+ self.atoms,
+ size=size,
+ stuff=stuff)
+
def read_xyz(self,
filename):
"""