thomson.py 文件源码

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

项目:sims_featureScheduler 作者: lsst 项目源码 文件源码
def ang_potential(x0):
    """
    If distance is computed along sphere rather than through 3-space.
    """
    theta = x0[0:x0.size/2]
    phi = np.pi/2-x0[x0.size/2:]

    indices = np.triu_indices(theta.size, k=1)

    theta_i = np.tile(theta, (theta.size, 1))
    theta_j = theta_i.T
    phi_i = np.tile(phi, (phi.size, 1))
    phi_j = phi_i.T
    d = _angularSeparation(theta_i[indices], phi_i[indices], theta_j[indices], phi_j[indices])
    U = np.sum(1./d)
    return U
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号