Solution (source code)

= Solution

Let $D_n=\hat n_{n\uparrow}\hat n_{n\downarrow}$. On a site, empty and doubly occupied states have spin zero, while either singly occupied state has spin $1/2$. Thus
$$
\hat{\mathbf S}_n^2=\frac34(\hat n_n-2D_n),\qquad
\boxed{\hat{\mathbf S}_n^2-\frac34\hat n_n=-\frac32D_n=:\hat{\mathbf S}_n^2:.}
$$
The <on-site spin-square normal-ordering identity> rewrites the interaction as $3U\sum_nD_n$. Its contact coefficient is $3U$ in this parameterization, rather than the $U$ convention often used for the <Hubbard model>.

Using a <fermionic coherent-state trace> and time slicing, replace each normal-ordered monomial by its <Grassmann field> symbol. With $\xi_{\mathbf k}=\epsilon_{\mathbf k}-\mu$,
$$
\boxed{\mathcal Z=\int\mathcal D(\bar\psi,\psi)e^{-\mathcal S},\qquad
\mathcal S=\int_0^\beta d\tau\left[\sum_{\mathbf k\sigma}\bar\psi_{\mathbf k\sigma}(\partial_\tau+\xi_{\mathbf k})\psi_{\mathbf k\sigma}
+3U\sum_n\bar\psi_{n\uparrow}\bar\psi_{n\downarrow}\psi_{n\downarrow}\psi_{n\uparrow}\right].}
$$
The independent fields have antiperiodic thermal boundary conditions. <Normal ordering> is crucial: the explicit $3\hat n/4$ subtraction removes the spin-square contraction, so there is no extra chemical-potential shift from it.