How do I get the amplitude for the one-loop photon self-energy? I am studying Maggiore's book on QFT and I am stuck in the amplitudes of one-loop corrections in QED. Could someone clearly explain me how do I get the following amplitude from the respective diagram? 

$$
i\Pi_{\mu\nu}(q) = \int\frac{d^4 k}{(2\pi)^4}Tr\left[(-ie\gamma_\mu)\frac{i(\require{cancel}\cancel k+m)}{k^2-m^2+i\epsilon}(-ie\gamma_\nu)\frac{i(\cancel p-\cancel k+m)}{(p-k)^2-m^2+i\epsilon}\right].
$$ 
In particular, I don't understand why does not appear the polarization $\varepsilon_\mu(p)$ (and its complex conjugate), since there are photons external legs, and how the trace comes up. I have a similar problem with the fermion self-energy because does not appear any spin wave function either and still there are external fermion legs. So maybe by understanding the photon case I am able to reproduce the fermion's result.
 A: The photon polarization vectors have been factored out. The full expression is
$$
\Pi=\epsilon_\mu\,\epsilon_\nu^*\,\Pi^{\mu\nu}
$$
where $\Pi^{\mu\nu}$ is the tensor described in the OP. We don't bother writing the vectors $\epsilon_\mu,\epsilon_\nu^*$ because they are irrelevant for the present discussion. But they are there.
The trace comes from contracting spinor indices. The first time you see this it is best to be as explicit as possible. The rules are


On the other hand, the Feynman diagram with all spinor indices made explicit is

Now let us follow the fermionic lines counterclockwise. You can begin wherever you want, say the left vertex. This vertex leads to $\gamma^\nu_{\alpha\beta}$. Next we see the lower fermion propagator, that leads to $(\not k-\not q+m)^{-1}_{\beta\delta}$. Next we see the right vertex, with rule $\gamma^\mu_{\delta\gamma}$. Finally we see the upper fermion propagator, with value $(\not k+m)^{-1}_{\gamma\alpha}$. Putting everything together we get
$$
\gamma^\nu_{\alpha\beta}(\not k-\not q+m)^{-1}_{\beta\delta}\gamma^\mu_{\delta\gamma}(\not k+m)^{-1}_{\gamma\alpha}
$$
Finally, note that by definition of matrix product, $A_{\alpha\beta}B_{\beta\gamma}=(AB)_{\alpha\gamma}$, and therefore this becomes
$$
=(\gamma^\nu(\not k-\not q+m)^{-1}\gamma^\mu(\not k+m)^{-1})_{\alpha\alpha}
$$
which is nothing but the trace of the matrix inside,
$$
=\operatorname{tr}(\gamma^\nu(\not k-\not q+m)^{-1}\gamma^\mu(\not k+m)^{-1})
$$
which agrees with the expression in the OP.
Note that, thanks to the cyclic property of the trace, it doesn't really matter where in the diagram you start looking at.
