"""Compute the radial subAEV terms of the center atom given neighbors
"""Compute the radial subAEV terms of the center atom given neighbors
The radial AEV is define in https://arxiv.org/pdf/1610.08935.pdf equation 3.
The radial AEV is define in
The sum computed by this method is over all given neighbors, so the caller
https://arxiv.org/pdf/1610.08935.pdf equation 3.
of this method need to select neighbors if the caller want a per species subAEV.
The sum computed by this method is over all given neighbors,
so the caller of this method need to select neighbors if the
caller want a per species subAEV.
Parameters
Parameters
----------
----------
distances : torch.Tensor
distances : torch.Tensor
Pytorch tensor of shape (..., neighbors) storing the |Rij| length where i are the
Pytorch tensor of shape (..., neighbors) storing the |Rij|
center atoms, and j are their neighbors.
length where i are the center atoms, and j are their neighbors.
Returns
Returns
-------
-------
torch.Tensor
torch.Tensor
A tensor of shape (..., neighbors, `radial_sublength`) storing the subAEVs.
A tensor of shape (..., neighbors, `radial_sublength`) storing
the subAEVs.
"""
"""
distances=distances.unsqueeze(
distances=distances.unsqueeze(-1).unsqueeze(-1)
-1).unsqueeze(-1)# TODO: allow unsqueeze to insert multiple dimensions
fc=_cutoff_cosine(distances,self.Rcr)
fc=_cutoff_cosine(distances,self.Rcr)
# Note that in the equation in the paper there is no 0.25 coefficient, but in NeuroChem there is such a coefficient. We choose to be consistent with NeuroChem instead of the paper here.
# Note that in the equation in the paper there is no 0.25
# coefficient, but in NeuroChem there is such a coefficient.
# We choose to be consistent with NeuroChem instead of the paper here.