One of the Feynman rules of QED is the following:
For a closed fermionic loop, the Feynman rule is to start at an arbitrary vertex or propagator, follow the line until we get back to the starting point, multiply all the vertices and the propagators in the order of the line, then take the trace...