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
评论列表
文章目录