lime/fft.py
def dft(x, f, k):
    '''
    Discrete Fourier transfrom at specified momentum
    '''

    dx = (x[1] - x[0]).real

    g = np.zeros(len(k), dtype=np.complex128)

    for i in range(len(k)):
        g[i] = np.sum(f * np.exp(-1j * k[i] * x)) * dx

    return g

    Discrete Fourier transfrom at specified momentum
    
Discrete Fourier transfrom at specified momentum
Discrete Fourier transfrom at specified momentum
def dft(x, f, k):
    dx = (x[1] - x[0]).real
    g = np.zeros(len(k), dtype=np.complex128)
    for i in range(len(k)):
        g[i] = np.sum(f * np.exp(-1j * k[i] * x)) * dx
    return g
def dft ( x , f , k ) : dx = ( x [ 1 ] - x [ 0 ] ) . real g = np . zeros ( len ( k ) , dtype = np . complex128 ) for i in range ( len ( k ) ) : g [ i ] = np . sum ( f * np . exp ( - 1j * k [ i ] * x ) ) * dx return g
Discrete Fourier transfrom at specified momentum
Discrete Fourier transfrom at specified momentum
'''
    Discrete Fourier transfrom at specified momentum
    '''
x
f
k