mir-group / flare_pp

A many-body extension of the FLARE code.
MIT License
35 stars 7 forks source link

Bk descriptors #19

Open YuuuXie opened 3 years ago

YuuuXie commented 3 years ago

This pull request wraps up B1, B2, B3 descriptors into a Bk descriptor module. And should be merged after #12

  1. When initializing the descriptor, previous setting
    descriptor_settings = [n_species, n_max, l_max]
    desc = B2(..., descriptor_settings)

    is equivalent to current setting

    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.

  1. 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:

  1. 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.

  2. The original b1/2/3.cpp are kept for unit test, but we could delete them and might find better way of doing this.

Todo

The lammps code can be further optimized: