# Getting a Trace Out of Spinor Contractions in Quantum Field Theory

I am a bit confused by some point in the calculation of the electron-electron scattering amplitude in Zee's QFT in a Nutshell, Section II.6. He extracts this quantify to work it out separately:

$$\tau^{\mu\nu}(P,p) = \frac{1}{2} \sum_s \sum_S \bar{u}(P,S) \gamma^\mu u(p,s) \bar{u}(p,s)\gamma^\nu u(P,S)$$ where the $$u$$ function is the electron function from the planewave solution for the Dirac equation. All Zee tells me about $$u$$ are its properties:

$$\bar{u}(p,s)u(p,s) = 1$$ $$\sum_s u(p,s)\bar{u}(p,s) = \frac{\gamma^\mu p_\mu +m}{2m}$$

I can perform an intermediate step (that Zee skips) using the second property of $$u$$:

$$\tau^{\mu\nu}(P,p) = \frac{1}{2(2m)} \sum_S \bar{u}(P,S) \gamma^\mu (\gamma^\rho p_\rho + m)\gamma^\nu u(P,S)$$

But Zee goes one step further and introduces a trace without any explanation, in order to obtain:

$$\tau^{\mu\nu}(P,p) = \frac{1}{2(2m)^2} \mathrm{Tr}\left[(\gamma^\lambda P_\lambda + m) \gamma^\mu (\gamma^\rho p_\rho + m)\gamma^\nu \right]$$

This got me completely confused. Where did the trace come from? How did the $$(\gamma^\lambda P_\lambda + m)/(2m)$$ appear, considering that the $$\bar{u}$$ is on the left in the intermediate step and there are also gamma matrices in between them?

This is a common trick when working with fermions, but it can be a bit obscure in the first time you see it. I'll work out the steps with an analogous example by writing explicitly the spinor indices of $$u$$ and $$\gamma$$ (i.e., the matrix indices of them in the spinor space). A similar equation would read
$$\bar{u} \gamma^\mu u = \sum_{a,b} \bar{u}_a \gamma^\mu_{ab} u_b,$$
\begin{align} \sum_{s} \bar{u} \gamma^\mu u &= \sum_{s,a,b} \bar{u}_a \gamma^\mu_{ab} u_b, \\ &= \sum_{s,a,b} u_b \bar{u}_a \gamma^\mu_{ab}, \\ &= \frac{1}{2m}\sum_{a,b} (\gamma^\rho p_\rho + m)_{ba} \gamma^\mu_{ab}, \\ &= \frac{1}{2m}\sum_{b} ((\gamma^\rho p_\rho + m)\gamma^\mu)_{bb}, \\ &= \frac{1}{2m}\mathrm{Tr}((\gamma^\rho p_\rho + m)\gamma^\mu). \end{align}
Essentially, you can just rearrange the product "sandwiched among vectors" as a matrix trace. The first steps of my calculation are just rearranging the entries of the spinorial matrices and then I start to write them as matrices themselves and eventually realize I'm computing the trace of the matrix. Notice also that the mass $$m$$ is always accompanied implicitly by an identity matrix.