How to derive this Kubo formula expressed with Green functions? Kubo formula $\sigma_{ab}(\textbf{q},\omega)=\frac{1}{\omega} (\pi_{ab}(\textbf{q},\omega) - \pi_{ab}(\textbf{q},0))$ is usually given in terms of the current-current correlation function
$$\pi_{ab}(\textbf{q},\omega)=\int_0^\infty dt e^{i\omega t}\langle[\hat{J}_a^\dagger(\textbf{q},t),\hat{J}_b(\textbf{q},0)]\rangle.$$
Sometimes I see another form
$$\pi_{ab}(\textbf{q},\omega)=\frac{ie^2}{\beta}\sum_{\textbf{k},\omega_n}\mathrm{tr}\left[\hat{\textbf{v}}_a(\textbf{k}+\frac{\textbf{q}}{2}) G_0(\textbf{k},\omega_n)\hat{\textbf{v}}_b(\textbf{k}+\frac{\textbf{q}}{2}) G_0(\textbf{k}+\textbf{q},\omega_n+\nu_m)\right]\bigg\rvert_{\nu_m\rightarrow\omega+i0^+}$$
where $\hat{\textbf{v}}=\partial_\textbf{k}h_\textbf{k}$ is the velocity operator of the Hamiltonian $h_\textbf{k}$ and $G_0$ is the (single-particle) Green's function. E.g., its $\textbf{q}=0$ version is given as Eq. (3) in this paper and as Eq. (6) in this one. My question is how to derive this formula and optionally to what extent it holds (only for quadratic Hamiltonian or even beyond).
 A: I suggest checking the Mahan's book - the notation seems resembling his derivation.
Generally, when the Kubo formula is written in terms of one-particle Green's functions, it means that we are either dealing with a non-interacting case or one of the vertices has been "dressed" by the interactions. Non-interacting case in this context is much more ubiquitous than it may seem at first - it figure extensively in all kinds of impurity-related problems (where an averaging over the impurities enters at a later stage).
A: partial answer: $\pi$ is the vacuum polarization tensor  since its kubo you want only one loop calculation
assume we have feynman rules

let this$=e\hat{\mathbb{v}}_a$

now let this $=G_{ab}$
finally the vacuum polarization tensor is

now assume periodic imaginary time we have
$$\pi_{ab}(\textbf{q},\omega)=\frac{ie^2}{\beta}\sum_{\textbf{k},\omega_n}\mathrm{tr}\left[\hat{\textbf{v}}_a(\textbf{k}+\frac{\textbf{q}}{2}) G_0(\textbf{k},\omega_n)\hat{\textbf{v}}_b(\textbf{k}+\frac{\textbf{q}}{2}) G_0(\textbf{k}+\textbf{q},\omega_n+\nu_m)\right]\bigg\rvert_{\nu_m\rightarrow\omega+i0^+}$$
the mistake you make is you do not include hamiltonian to your question but its important,  hamiltonian has basically an interaction term $$eAc^\dagger c v$$ that's why we have that vertex rule than we write the partition function taylor expand that interaction term you get this.
$\frac{i}{\beta}$ comes from the fact that its one loop. Trace comes from contraction.
