def Jdag(v=None, cell=None):
"""Computes the complex conjugate of the `J` operator for Fourier basis.
Args:
v (numpy.ndarray): if None, then return the matrix :math:`\mathbb{J^\dag}`,
else, return :math:`\mathbb{J^\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 I instead.
cell = get_cell(cell)
def fft(X):
FF = np.fft.fftn(np.reshape(X, cell.S, order='F'))
return np.reshape(FF, X.shape, order='F')
return matprod(fft, v)/np.prod(cell.S)
评论列表
文章目录