tools.py 文件源码

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

项目:qmflows-namd 作者: SCM-NV 项目源码 文件源码
def dephasing(f):
    """
    Computes the dephasing time of a given function using optical response
    formalisms:
    S. Mukamel, Principles of Nonlinear Optical Spectroscopy, 1995
    About the implementation we use the 2nd order cumulant expansion.
    See also eq. (2) in : Kilina et al. Phys. Rev. Lett., 110, 180404, (2013)
    To calculate the dephasing time tau we fit the dephasing function to a
    gaussian of the type : exp(-0.5 * (-x / tau) ** 2)
    """
    ts = np.arange(f.shape[0])
    cumu_ii = np.stack(np.sum(f[0:i]) for i in range(ts.size)) / hbar
    cumu_i = np.stack(np.sum(cumu_ii[0:i]) for i in range(ts.size)) / hbar
    deph = np.exp(-cumu_i)
    np.seterr(over='ignore')
    popt = curve_fit(gauss_function, ts, deph)[0]
    xs = np.exp(-0.5 * (-ts / popt[0]) ** 2)
    deph = np.column_stack((deph, xs))
    rate = popt[0]
    return deph, rate
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号