def Idag(v=None, cell=None):
"""Computes the complex conjugate of the `I` operator for Fourier basis.
Args:
v (numpy.ndarray): if None, then return the matrix :math:`\mathbb{I^\dag}`,
else, return :math:`\mathbb{I^\dag}\cdot v`.
cell (pydft.geometry.Cell): that describes the unit cell and
sampling points for real and reciprocal space.
"""
#It turns out that for Fourier, the complex conjugate only differs by a -1
#on the i (symmetric in R and G), so that we can return J instead.
cell = get_cell(cell)
def ifft(X):
FB = np.fft.ifftn(np.reshape(X, cell.S, order='F'))
return np.reshape(FB, X.shape, order='F')
return matprod(ifft, v)*np.prod(cell.S)
评论列表
文章目录