summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Luevano <55825613+luevano@users.noreply.github.com>2019-12-12 03:51:16 -0700
committerDavid Luevano <55825613+luevano@users.noreply.github.com>2019-12-12 03:51:16 -0700
commitd0635e04971e3ee3b951d1c74c43b755b0096bb2 (patch)
treecd5d502f3b68319d5d11cc161cc9870bc20ef07f
parenta3a758d03c6c9f7839495e9a379a010e7116d9bd (diff)
Add function for multiple molecules and fix spelling
-rw-r--r--c_matrix.py21
-rw-r--r--lj_matrix.py21
2 files changed, 40 insertions, 2 deletions
diff --git a/c_matrix.py b/c_matrix.py
index dff638bc5..f6f18976e 100644
--- a/c_matrix.py
+++ b/c_matrix.py
@@ -31,7 +31,7 @@ def c_matrix(mol_data,
as_eig=False,
bohr_radius_units=False):
"""
- Creates the coulomb matrix from the molecule data given.
+ Creates the Coulomb Matrix from the molecule data given.
mol_data: molecule data, matrix of atom coordinates.
nc_data: nuclear charge data, array of atom data.
max_len: maximum amount of atoms in molecule.
@@ -144,3 +144,22 @@ def c_matrix(mol_data,
return np.sort(eig(cm)[0])[::-1]
else:
return cm
+
+
+def c_matrix_multiple(mol_data,
+ nc_data,
+ max_len=25,
+ as_eig=False,
+ bohr_radius_units=False):
+ """
+ Calculates the Coulomb Matrix of multiple molecules.
+ mol_data: molecule data, matrix of atom coordinates.
+ nc_data: nuclear charge data, array of atom data.
+ max_len: maximum amount of atoms in molecule.
+ as_eig: if data should be returned as matrix or array of eigenvalues.
+ bohr_radius_units: if units should be in bohr's radius units.
+ """
+ cm_data = np.array([c_matrix(mol, nc, max_len, as_eig, bohr_radius_units)
+ for mol, nc in zip(mol_data, nc_data)])
+
+ return cm_data
diff --git a/lj_matrix.py b/lj_matrix.py
index c99982731..40ff30d3d 100644
--- a/lj_matrix.py
+++ b/lj_matrix.py
@@ -31,7 +31,7 @@ def lj_matrix(mol_data,
as_eig=False,
bohr_radius_units=False):
"""
- Creates the coulomb matrix from the molecule data given.
+ Creates the Lennard-Jones Matrix from the molecule data given.
mol_data: molecule data, matrix of atom coordinates.
nc_data: nuclear charge data, array of atom data.
max_len: maximum amount of atoms in molecule.
@@ -162,3 +162,22 @@ def lj_matrix(mol_data,
return np.sort(eig(lj)[0])[::-1]
else:
return lj
+
+
+def c_matrix_multiple(mol_data,
+ nc_data,
+ max_len=25,
+ as_eig=False,
+ bohr_radius_units=False):
+ """
+ Calculates the Lennard-Jones Matrix of multiple molecules.
+ mol_data: molecule data, matrix of atom coordinates.
+ nc_data: nuclear charge data, array of atom data.
+ max_len: maximum amount of atoms in molecule.
+ as_eig: if data should be returned as matrix or array of eigenvalues.
+ bohr_radius_units: if units should be in bohr's radius units.
+ """
+ ljm_data = np.array([lj_matrix(mol, nc, max_len, as_eig, bohr_radius_units)
+ for mol, nc in zip(mol_data, nc_data)])
+
+ return ljm_data