test_fourier.py 文件源码

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

项目:dft 作者: rosenbrockc 项目源码 文件源码
def test_E_real(adjcube):
    """Tests that the result of the calculation is real.
    """
    from pydft.bases.fourier import E
    from numpy.matlib import randn
    cell = adjcube

    #Single columns of random complex data
    W = np.array(randn(np.prod(cell.S), 4) + 1j*randn(np.prod(cell.S), 4))
    #Setup a harmonic oscillator potential
    V = QHO(cell)
    En = E(V, W, cell, forceR=False)

    assert np.imag(En) < 1e-14
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号