def approx_fprime_cs(x, f, epsilon=None, args=(), kwargs={}):
    # From Guilherme P. de Freitas, numpy mailing list
    # May 04 2010 thread "Improvement of performance"
    # http://mail.scipy.org/pipermail/numpy-discussion/2010-May/050250.html
    n = len(x)
    epsilon = _get_epsilon(x, 1, epsilon, n)
    increments = np.identity(n) * 1j * epsilon
    # TODO: see if this can be vectorized, but usually dim is small
    partials = [f(x+ih, *args, **kwargs).imag / epsilon[i]
                for i, ih in enumerate(increments)]
    return np.array(partials).T
Size is the size of the QFT matrix
dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/tools/numdiff.py/approx_fprime_cs--crossover with--dataset/ETHPy150Open sympy/sympy/sympy/physics/quantum/qft.py/Fourier.size