implementation of central and neighbour mask for spherical expansions #420
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the work extracted from the feat/plumed branch to limit the computation only on specific species similar as the central atoms mask feature, but this supports gradient computation. It does not change the size of the gradients and features. It will just return zeros for atoms that are not masked. It also supports the limitation on species neighbour species.
The reason why I did not want to extend the central atoms mask feature was that this implies a change in the object size (number of samples changes), which causes more places in the code than just one file. To support the computation of the gradients, we also need to consider the computation of central atoms that are not in the mask, but have a neighbour in the mask in their environment. Currently the central atoms mask is applied in the center structure manager, but to consider neighbours we would need to move it to adapter strict. This causes to deal with multiple files, the structure manager object, and the change in the property size made several other places in the code complain, such that I did not wanted to go further with this approach.
Also one advantage is that the interface does not need to be updated (the interface does not need to add a central atom mask into the structure). For the scope of this, using it for 2-3 projects I think it is the best solution.
For spherical invariants a bit more work has to be done. But it should already profit from the mask applied on spherical expansions
I mean it is like Michele said a straightforward change.
The tests work, tested locally on IMX cluster, because our CI tests here are broken