Where does the Feynman rule for "taking the trace over the matrix product arising from a fermion loop" come from?
I can not derive it in the "usual way", that is writing the correlator all the way from position space to amputated Fourier space. In the following two examples in QED of what I mean.
Electron self energy at 1-loop
This is $\langle \Omega | \, \psi(x) \, \bar{\psi}(y) \, | \Omega\rangle $ at second order in the coupling, with QED interaction $-eA_{\mu}\bar{\psi}\gamma^{\mu}\psi$. No minus sign arises, because the fields can be arranged into the $\psi\bar{\psi} \, \psi\bar{\psi} \, \psi\bar{\psi}$ structure with an even number of inversions. There is no fermion loop, so no trace is expected.
In position space the diagram thus is
$$ (-ie)^2 \int d^4z \, d^4w \, S_F(x-z) \, \gamma^{\mu} \, S_F(z-w) \, \gamma^{\nu} \, S_F(w-y) \, D_F^{\text{photon}}(z-w) $$
Now one plugs in the explicit propagators $S_F (x-y) = \int \frac{d^4 p}{2\pi^4} \, \frac{i ( \require{cancel}\cancel{p} + m ) }{p^2-m^2} e ^{-ip(x-y)} $ and $D^{\text{photon}}_F (x-y) = \int \frac{d^4 p}{2\pi^4} \, \frac{i (-\eta^{\mu\nu}) }{p^2} e ^{-ip(x-y)} $, then goes to Fourier space and at the end drops the external legs propagators (amputation), giving eq. 7.16 in Peskin-Schroeder:
$$ e^2 \int \frac{d^4 k}{2\pi^4} \, \frac{\gamma^{\mu} (\cancel{k} + m ) \gamma_{\mu}}{(k^2-m^2)(p-k)^2}$$
This all works fine.
Vacuum polarization at 1-loop
Now the troubling part. I would apply exactly the same reasoning to $\langle \Omega | \, A^{\mu}(x) \, A^{\nu}(y) \, | \Omega\rangle $. At 1-loop order there is a closed fermion loop. An extra minus sign arises because $\bar{\psi}_z \psi_z \, \bar{\psi}_w \psi_w = - \psi_z \bar{\psi}_w \, \psi_w \bar{\psi}_z $. Thus I would write something like $$ (-ie)^2 (-1) \int d^4 z \, d^4w \, D_F^{\text{photon}}(y-w) \, \underbrace{\gamma^{\alpha} \, S_F(w-z) \, \gamma^{\beta} \, S_F(z-w)}_{(*)} \, D_F^{\text{photon}}(z-x) $$
Now $(*)$ along with the $\int d^4z \, d^4w$ actually resembles the sought after trace, but the photon propagators are there and screw it up.
The same procedure of plugging in the correlators, going to fourier space and at the end dropping the external legs contributions (in this case just a factor $1/q^4$) provides
$$ e^2 \int \frac{d^4k}{2\pi^4} \frac{\gamma^{\mu} \, (\cancel{k}+m) \, \gamma^{\nu} \, (\cancel{k}+\cancel{q}+m)}{(k^2-m^2)\left((k+q)^2-m^2 \right)} $$
which is wrong with respect to the above equation 7.71: the overall sing is different and the trace is missing.
So again, how does the trace arise from this procedure?