diff options
author | David Luevano <55825613+luevano@users.noreply.github.com> | 2019-12-12 03:51:16 -0700 |
---|---|---|
committer | David Luevano <55825613+luevano@users.noreply.github.com> | 2019-12-12 03:51:16 -0700 |
commit | d0635e04971e3ee3b951d1c74c43b755b0096bb2 (patch) | |
tree | cd5d502f3b68319d5d11cc161cc9870bc20ef07f /c_matrix.py | |
parent | a3a758d03c6c9f7839495e9a379a010e7116d9bd (diff) |
Add function for multiple molecules and fix spelling
Diffstat (limited to 'c_matrix.py')
-rw-r--r-- | c_matrix.py | 21 |
1 files changed, 20 insertions, 1 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 |