K = 2 # body order. K = 1 -> B1, K = 2 -> B2, K = 3 -> B3
descriptor_settings = [n_species, K, n_max, l_max]
desc = Bk(..., descriptor_settings)
The lammps files are changed correspondingly.
Another feature: add atom_indices to sparse_gp.py/update_db and sparse_gp.cpp/add_training_structure to allow adding a subset of force labels, such that the Kuf matrix is smaller in the "f" dimension
Notes:
To add descriptors with higher body order, just need to add coefficients (l1, l2, l3 ...; m1, m2, m3, ...) to coeffs.cpp and add indices (n1 l1 m1, n2 l2 m2, ... nk lk mk) in indices.cpp.
The original b1/2/3.cpp are kept for unit test, but we could delete them and might find better way of doing this.
[x] Finish unit test for lammps
[x] Change compute command for variance to Bk descriptors
Todo
The lammps code can be further optimized:
The trick as #12 is not implemented
The search of neighbor list and the computation of single bonds are duplicated for each kernel. But we can do it only once by using the maximal cutoff, n_max and l_max
This pull request wraps up B1, B2, B3 descriptors into a Bk descriptor module. And should be merged after #12
is equivalent to current setting
The lammps files are changed correspondingly.
atom_indices
tosparse_gp.py/update_db
andsparse_gp.cpp/add_training_structure
to allow adding a subset of force labels, such that the Kuf matrix is smaller in the "f" dimensionNotes:
To add descriptors with higher body order, just need to add coefficients (l1, l2, l3 ...; m1, m2, m3, ...) to
coeffs.cpp
and add indices (n1 l1 m1, n2 l2 m2, ... nk lk mk) inindices.cpp
.The original
b1/2/3.cpp
are kept for unit test, but we could delete them and might find better way of doing this.compute
command for variance to Bk descriptorsTodo
The lammps code can be further optimized: