Skip to content
This repository was archived by the owner on Dec 8, 2024. It is now read-only.

Atom centered symmetry functions (#64) #65

Merged
merged 4 commits into from
Jul 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions test/test_symm_funct.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def fort_acsf_gradients(mols, path, elements):
Xgrad_test = np.concatenate([mol.gradients.reshape(mol.natoms**2, mol.gradients.shape[1]*3)
for mol in mols])
Xgrad_ref = np.loadtxt(path + "/data/acsf_gradients.txt")
assert np.allclose(X_test, X_ref), "Error in ACSF gradients"
assert np.allclose(Xgrad_test, Xgrad_ref), "Error in ACSF gradients"

# Generate atom centered symmetry functions representation
# and gradients directly from the representations module
Expand All @@ -160,13 +160,20 @@ def fort_acsf_gradients(mols, path, elements):
rep.append(r)
grad.append(g)

# Reshape the gradients to fit the test format
for i, mol in enumerate(mols):
g = grad[i]
natoms = mol.natoms
repsize = g.shape[1]
grad[i] = g.reshape(natoms ** 2, repsize * 3)

X_test = np.concatenate(rep)
X_ref = np.loadtxt(path + "/data/acsf_representation.txt")
assert np.allclose(X_test, X_ref), "Error in ACSF representation"

Xgrad_test = np.concatenate([mol.gradients.reshape(mol.natoms**2, mol.gradients.shape[1]*3)])
Xgrad_test = np.concatenate(grad, axis = 0)
Xgrad_ref = np.loadtxt(path + "/data/acsf_gradients.txt")
assert np.allclose(X_test, X_ref), "Error in ACSF gradients"
assert np.allclose(Xgrad_test, Xgrad_ref), "Error in ACSF gradients"

if __name__ == "__main__":
test_acsf()
Expand Down
124 changes: 0 additions & 124 deletions tests/data/atom_centered_symmetry_function_representation.txt

This file was deleted.

8 changes: 0 additions & 8 deletions tests/data/compound_test.exyz

This file was deleted.

Binary file removed tests/data_test_acsf.npz
Binary file not shown.
Binary file removed tests/grad.npz
Binary file not shown.
Binary file removed tests/rep.npz
Binary file not shown.
306 changes: 0 additions & 306 deletions tests/test_acsf.py

This file was deleted.