system.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:describe 作者: SINGROUP 项目源码 文件源码
def get_inverse_distance_matrix(self):
        """Calculates the inverse distance matrix A defined as:

            A_ij = 1/|r_i - r_j|

        For periodic systems the distance of an atom from itself is the
        smallest displacement of an atom from one of it's periodic copies, and
        the distance of two different atoms is the distance of two closest
        copies.

        Returns:
            np.array: Symmetric 2D matrix containing the pairwise inverse
            distances.
        """
        if self._inverse_distance_matrix is None:
            distance_matrix = self.get_distance_matrix()
            with np.errstate(divide='ignore'):
                inv_distance_matrix = np.reciprocal(distance_matrix)
            self._inverse_distance_matrix = inv_distance_matrix
        return self._inverse_distance_matrix
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号