summaryrefslogtreecommitdiff
path: root/ml_exp
diff options
context:
space:
mode:
authorDavid Luevano Alvarado <55825613+luevano@users.noreply.github.com>2020-02-21 19:06:36 -0700
committerDavid Luevano Alvarado <55825613+luevano@users.noreply.github.com>2020-02-21 19:06:36 -0700
commit5ba008a928d34c49e431f32b5161f624d780c254 (patch)
tree7efc1e22003e28d655d239ab7f74e81ba62e759b /ml_exp
parenta2463470b639a743189deece071654ed03791c3c (diff)
Add ljmatrix to compound
Diffstat (limited to 'ml_exp')
-rw-r--r--ml_exp/compound.py41
1 files changed, 33 insertions, 8 deletions
diff --git a/ml_exp/compound.py b/ml_exp/compound.py
index 3ea377826..d74f1230a 100644
--- a/ml_exp/compound.py
+++ b/ml_exp/compound.py
@@ -22,7 +22,7 @@ SOFTWARE.
"""
import numpy as np
from ml_exp.data import NUCLEAR_CHARGE
-from ml_exp.representations import coulomb_matrix
+from ml_exp.representations import coulomb_matrix, lennard_jones_matrix
class Compound:
@@ -40,8 +40,8 @@ class Compound:
self.coordinates = None
self.energy = None
- self.coulomb_matrix = None
- self.lennard_jones_matrix = None
+ self.c_matrix = None
+ self.lj_matrix = None
self.bob = None
if xyz is not None:
@@ -57,11 +57,36 @@ class Compound:
as_eig: if the representation should be as the eigenvalues.
bhor_ru: if radius units should be in bohr's radius units.
"""
- self.coulomb_matrix = coulomb_matrix(self.coordinates,
- self.atoms_nc,
- size=size,
- as_eig=as_eig,
- bhor_ru=bohr_ru)
+ self.c_matrix = coulomb_matrix(self.coordinates,
+ self.atoms_nc,
+ size=size,
+ as_eig=as_eig,
+ bhor_ru=bohr_ru)
+
+ def gen_lj(self,
+ diag_value=None,
+ sigma=1.0,
+ epsilon=1.0,
+ size=23,
+ as_eig=True,
+ bohr_ru=False):
+ """
+ Generate the Lennard-Jones Matrix for the compund.
+ diag_value: if special diagonal value is to be used.
+ sigma: sigma value.
+ epsilon: epsilon value.
+ size: compound size.
+ as_eig: if the representation should be as the eigenvalues.
+ bhor_ru: if radius units should be in bohr's radius units.
+ """
+ self.lj_matrix = lennard_jones_matrix(self.coordinates,
+ self.atoms_nc,
+ diag_value=diag_value,
+ sigma=sigma,
+ epsilon=epsilon,
+ size=size,
+ as_eig=as_eig,
+ bhor_ru=bohr_ru)
def read_xyz(self,
filename):