I'm studying Lattice QCD and got stuck in understanding the process of going from a Minkowski space-time to an Euclidean space-time. My procedure is the following:
I considered the Wick rotation in quantum mechanics $x_0 \to -i x_4$. From this, I thought it would be reasonable to assume that for the potential vector, the Wick rotation would be $A_0 \to -i A_4$, since $A_\mu$ is a four-vector like $x_\mu$. This implies $F_{0 i}F^{0 i} \to -F_{4 i}F_{4 i}$ and assuming a metric $g^{\mu \nu} = \;\mbox{diag}(1,-1,-1,-1)$, this results in $F_{\mu \nu}F^{\mu \nu} \to -F_{\mu \nu}F_{\mu \nu}$. Now, considering that $d^4x = dt\, d^3x \to -i d\tau\, d^3x$ the action should transform as
\begin{equation} i S = -\frac{i}{2}\int d^4x \;\mbox{Tr}(F_{\mu \nu}F^{\mu \nu}) \to \frac{1}{2}\int d^4x \;\mbox{Tr}(F_{\mu \nu}F_{\mu \nu}) = S_E\,, \end{equation} where $S_E$ is the Euclidean action, which is a positive number. So, $iS \to S_E$ instead of the expected $iS \to -S_E$. I am obviously doing something wrong. I suspect it could be in the transformation of $d^4x$, but I cannot see why it would be wrong. One thing that I noticed is that if I use the metric $g^{\mu \nu} = \;\mbox{diag}(-1,1,1,1)$, then I get the proper signal. But this is changing the metric in the middle of the calculation, which would be wrong without compensating with an appropriate minus signal and then the issue would persist.
I have issues with the Fermionic sector as well. I considered $\partial_0 \to -i\partial_4$ following the transformation of $x_0$. Also, I saw in the books (Gattringer, Rothe) that it was needed that $\gamma^0 \to \gamma_4$ and $\gamma^i \to i \gamma_i$ so the definition for the $\gamma$ matrices could change from $\{\gamma^\mu,\gamma^\nu\} = 2 g^{\mu \nu} \to \{\gamma_\mu, \gamma_\nu\} = 2 \delta_{\mu \nu}$. It seens reasonable. The problem is that the transformation in the action becomes
\begin{equation} iS = i\int d^4x \; \bar{\psi}(i\gamma^\mu \partial_\mu + g_0 \gamma^\mu A_\mu - m)\psi \to \int d^4x \;\bar{\psi}(\gamma_\mu \partial_\mu - i g_0 \gamma_\mu A_\mu - m)\,, \end{equation}
which is not the Euclidean action. I tried using $A_0 \to i A_4$ in the hope I could have made some mistake in the logic above, but with no luck. So what is the prescription to perform the Wick rotation? How to figure out which transformations I should perform in a wick rotation?