fourierTransform.py 文件源码

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

项目:qmflows-namd 作者: SCM-NV 项目源码 文件源码
def calculate_fourier_trasform_primitive(l: int, ks: Vector, alpha: float) -> complex:
    """
    calculate 1D Fourier transform of single gausian primitive function centred in zero
     for given ste of kpoints "ks"
    """
    gauss = np.exp(-(pi ** 2 / alpha) * ks ** 2)
    if l == 0:
        return np.sqrt(pi / alpha) * gauss
    elif l == 1:
        c = -1j * np.sqrt((pi / alpha) ** 3)
        return c * ks * gauss
    elif l == 2:
        c = np.sqrt(pi / alpha ** 5)
        return c * ((alpha / 2.0) - (pi ** 2) * (ks ** 2)) * gauss
    else:
        msg = ("there is not implementation for the primivite fourier "
               "transform of l: {}".format(l))
        raise NotImplementedError(msg)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号