classes.py 文件源码

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

项目:RoboBohr 作者: bhimmetoglu 项目源码 文件源码
def pairFeatureMatrix(self, elementList):
    """ Construction of pair-distance matrices """

    # Initiate
    nSpecies = len(elementList)

    # Get the molecular structure 
    pos = np.array(self.molecule.positions, dtype = float) # Atomic positions  
    elInd = np.array(self.molecule.elInd, dtype = np.intc) # Element indices matching to elementList
    natoms = len(self.molecule.names) # Total number of atoms in the molecule

    # Initiate the matrix
    dim1 = natoms * (natoms -1)/2 # First dimension (pairwise distances)
    dim2 = nSpecies * (nSpecies + 1)/2 # Number of possible pairs
    featMat = np.zeros((dim1,dim2)) # To be passed to fun_pairFeatures (compiled C code)

    # Call the C function to store the pairFeatures
    pairFeatures.fun_pairFeatures(nSpecies, natoms, elInd, pos, featMat)

    # Return featMat
    return featMat
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号