|
1 | 1 | import numpy as np
|
2 | 2 |
|
3 | 3 | from ..arad import get_local_kernels_arad, get_local_symmetric_kernels_arad
|
4 |
| -from .fkernels import ( |
5 |
| - fget_vector_kernels_gaussian, |
6 |
| - fget_vector_kernels_gaussian_symmetric, |
7 |
| - fget_vector_kernels_laplacian, |
8 |
| -) |
| 4 | +from .fkernels import fget_vector_kernels_gaussian, fget_vector_kernels_laplacian |
9 | 5 |
|
| 6 | +# TODO Duplicate function definition |
| 7 | +# def get_atomic_kernels_laplacian(mols1, mols2, sigmas): |
10 | 8 |
|
11 |
| -def get_atomic_kernels_laplacian(mols1, mols2, sigmas): |
| 9 | +# n1 = np.array([mol.natoms for mol in mols1], dtype=np.int32) |
| 10 | +# n2 = np.array([mol.natoms for mol in mols2], dtype=np.int32) |
12 | 11 |
|
13 |
| - n1 = np.array([mol.natoms for mol in mols1], dtype=np.int32) |
14 |
| - n2 = np.array([mol.natoms for mol in mols2], dtype=np.int32) |
| 12 | +# max1 = np.max(n1) |
| 13 | +# max2 = np.max(n2) |
15 | 14 |
|
16 |
| - max1 = np.max(n1) |
17 |
| - max2 = np.max(n2) |
| 15 | +# nm1 = n1.size |
| 16 | +# nm2 = n2.size |
18 | 17 |
|
19 |
| - nm1 = n1.size |
20 |
| - nm2 = n2.size |
| 18 | +# cmat_size = mols1[0].representation.shape[1] |
21 | 19 |
|
22 |
| - cmat_size = mols1[0].representation.shape[1] |
| 20 | +# x1 = np.zeros((nm1, max1, cmat_size), dtype=np.float64, order="F") |
| 21 | +# x2 = np.zeros((nm2, max2, cmat_size), dtype=np.float64, order="F") |
23 | 22 |
|
24 |
| - x1 = np.zeros((nm1, max1, cmat_size), dtype=np.float64, order="F") |
25 |
| - x2 = np.zeros((nm2, max2, cmat_size), dtype=np.float64, order="F") |
| 23 | +# for imol in range(nm1): |
| 24 | +# x1[imol, : n1[imol], :cmat_size] = mols1[imol].representation |
26 | 25 |
|
27 |
| - for imol in range(nm1): |
28 |
| - x1[imol, : n1[imol], :cmat_size] = mols1[imol].representation |
| 26 | +# for imol in range(nm2): |
| 27 | +# x2[imol, : n2[imol], :cmat_size] = mols2[imol].representation |
29 | 28 |
|
30 |
| - for imol in range(nm2): |
31 |
| - x2[imol, : n2[imol], :cmat_size] = mols2[imol].representation |
| 29 | +# # Reorder for Fortran speed |
| 30 | +# x1 = np.swapaxes(x1, 0, 2) |
| 31 | +# x2 = np.swapaxes(x2, 0, 2) |
32 | 32 |
|
33 |
| - # Reorder for Fortran speed |
34 |
| - x1 = np.swapaxes(x1, 0, 2) |
35 |
| - x2 = np.swapaxes(x2, 0, 2) |
| 33 | +# sigmas = np.asarray(sigmas, dtype=np.float64) |
| 34 | +# nsigmas = sigmas.size |
36 | 35 |
|
37 |
| - sigmas = np.asarray(sigmas, dtype=np.float64) |
38 |
| - nsigmas = sigmas.size |
39 |
| - |
40 |
| - return fget_vector_kernels_laplacian(x1, x2, n1, n2, sigmas, nm1, nm2, nsigmas) |
| 36 | +# return fget_vector_kernels_laplacian(x1, x2, n1, n2, sigmas, nm1, nm2, nsigmas) |
41 | 37 |
|
42 | 38 |
|
43 | 39 | def get_atomic_kernels_laplacian_symmetric(mols, sigmas):
|
44 | 40 |
|
45 |
| - n = np.array([mol.natoms for mol in mols], dtype=np.int32) |
| 41 | + raise NotImplementedError("x1 is missing definition") |
46 | 42 |
|
47 |
| - max_atoms = np.max(n) |
| 43 | + # n = np.array([mol.natoms for mol in mols], dtype=np.int32) |
48 | 44 |
|
49 |
| - nm = n.size |
| 45 | + # max_atoms = np.max(n) |
50 | 46 |
|
51 |
| - cmat_size = mols[0].representation.shape[1] |
| 47 | + # nm = n.size |
52 | 48 |
|
53 |
| - x = np.zeros((nm, max_atoms, cmat_size), dtype=np.float64, order="F") |
| 49 | + # cmat_size = mols[0].representation.shape[1] |
54 | 50 |
|
55 |
| - for imol in range(nm): |
56 |
| - x[imol, : n[imol], :cmat_size] = mols[imol].representation |
| 51 | + # x = np.zeros((nm, max_atoms, cmat_size), dtype=np.float64, order="F") |
57 | 52 |
|
58 |
| - # Reorder for Fortran speed |
59 |
| - x = np.swapaxes(x, 0, 2) |
| 53 | + # for imol in range(nm): |
| 54 | + # x[imol, : n[imol], :cmat_size] = mols[imol].representation |
60 | 55 |
|
61 |
| - sigmas = np.asarray(sigmas, dtype=np.float64) |
62 |
| - nsigmas = sigmas.size |
| 56 | + # # Reorder for Fortran speed |
| 57 | + # x = np.swapaxes(x, 0, 2) |
63 | 58 |
|
64 |
| - return fget_vector_kernels_laplacian(x1, n, sigmas, nm, nsigmas) |
| 59 | + # sigmas = np.asarray(sigmas, dtype=np.float64) |
| 60 | + # nsigmas = sigmas.size |
| 61 | + |
| 62 | + # return fget_vector_kernels_laplacian(x1, n, sigmas, nm, nsigmas) |
65 | 63 |
|
66 | 64 |
|
67 | 65 | def arad_local_kernels(
|
@@ -165,23 +163,24 @@ def get_atomic_kernels_gaussian(mols1, mols2, sigmas):
|
165 | 163 |
|
166 | 164 | def get_atomic_kernels_gaussian_symmetric(mols, sigmas):
|
167 | 165 |
|
168 |
| - n = np.array([mol.natoms for mol in mols], dtype=np.int32) |
| 166 | + raise NotImplementedError("nm1 not defined and x1 not used") |
| 167 | + # n = np.array([mol.natoms for mol in mols], dtype=np.int32) |
169 | 168 |
|
170 |
| - max_atoms = np.max(n) |
| 169 | + # max_atoms = np.max(n) |
171 | 170 |
|
172 |
| - nm = n.size |
| 171 | + # nm = n.size |
173 | 172 |
|
174 |
| - cmat_size = mols[0].representation.shape[1] |
| 173 | + # cmat_size = mols[0].representation.shape[1] |
175 | 174 |
|
176 |
| - x1 = np.zeros((nm, max_atoms, cmat_size), dtype=np.float64, order="F") |
| 175 | + # x1 = np.zeros((nm, max_atoms, cmat_size), dtype=np.float64, order="F") |
177 | 176 |
|
178 |
| - for imol in range(nm1): |
179 |
| - x[imol, : n[imol], :cmat_size] = mols[imol].representation |
| 177 | + # for imol in range(nm1): |
| 178 | + # x[imol, : n[imol], :cmat_size] = mols[imol].representation |
180 | 179 |
|
181 |
| - # Reorder for Fortran speed |
182 |
| - x = np.swapaxes(x, 0, 2) |
| 180 | + # # Reorder for Fortran speed |
| 181 | + # x = np.swapaxes(x, 0, 2) |
183 | 182 |
|
184 |
| - sigmas = np.array(sigmas, dtype=np.float64) |
185 |
| - nsigmas = sigmas.size |
| 183 | + # sigmas = np.array(sigmas, dtype=np.float64) |
| 184 | + # nsigmas = sigmas.size |
186 | 185 |
|
187 |
| - return fget_vector_kernels_gaussian_symmetric(x, n, sigmas, nm, nsigmas) |
| 186 | + # return fget_vector_kernels_gaussian_symmetric(x, n, sigmas, nm, nsigmas) |
0 commit comments