Homework for Metropolis sampling

First we copy things that we developed in the class.

This is implementation of the Lindhardt formula:

\begin{eqnarray} P(q,\omega) = -2 \int \frac{d^3k\; d\Omega_q}{(2\pi)^3} \frac{f(\varepsilon_{\vec{k}+\vec{q}})-f(\varepsilon_{\vec{k}})}{\omega-\varepsilon_{\vec{k}+\vec{q}}+\varepsilon_\vec{k}+i\delta} \end{eqnarray}

where $\varepsilon_\vec{k}=k^2-k_F^2$.

The input is momentum, where momentum[0,:] is $\vec{q}$ and momentum[1,:] is $\vec{k}$. It returns the value for array of frequencies.

Now we modify IntegrateByMetropolis so that func is allowed to return complex array of values. We marked all lines that require change by

# Next line needs CORRECTION for homework