Computing a Gaussian path integral with a zero-mode constraint I have the following partition function:
\begin{equation}
Z=\int_{a(0)=a(1)} \mathcal{D}a\,\delta\left(\int_0^1 d\tau \,a -\bar{\mu}\right)\exp\left(-\frac{1}{g^2}\int_0^1d\tau\, a^2\right)
\end{equation}
where $\bar{\mu}$ is a constant. How can I explicitly compute this partition function? In particular, I do not know how to deal with that Dirac delta containing an integral. Of course if the Dirac delta wasn't there, the calculation would be very easy, since it would reduce to the usual computation of a propagator.
The final result should be
\begin{equation}
Z=\frac{1}{g}\exp\left(-\frac{\bar{\mu}^2}{g^2}\right).
\end{equation}
Edit: I understood Prahar's method. I would like to get to the same answer using zeta function regularization, as proposed by ɪdɪət strəʊlə. So, how do we apply the zeta function regularization here?
 A: $a(\tau)$ is a function on $[0,1]$ so you can expand it in a Fourier series
$$
a(\tau) = c \tau +  a_0 + \sum_{n=1}^\infty a_n \cos( 2\pi n \tau) + \sum_{n=1}^\infty b_n \sin( 2\pi n \tau)
$$
In your question, you have not specified any boundary conditions on $a(\tau)$ so I don't know if it's periodic or not. The aperiodicity of $a(\tau)$ is captured by the first term above. Given your final answer, I think it's supposed to be periodic so I'm going to set $c=0$.
Using this, we find
$$
\int_0^1 d\tau a^2 = a^2_0 + \sum_{n=1}^\infty    a_n^2  + \sum_{n=1}^\infty b^2_n , \qquad \int_0^1 d\tau a = a_0
$$
The path integral measure is
$$
\int {\cal D} a = {\cal N} \int_{-\infty}^\infty da_0\prod_{n=1}^N\int_{-\infty}^\infty da_n db_n
$$
${\cal N}$ is an overall normalization which we will fix by renormalizing the path integral. Note that we have also introduced a UV cut-off $N$. The $N \to \infty$ limit will be taken after renormalizing.
Putting it all back into the path integral, we have
\begin{align}
Z &= \int {\cal D} a \delta \left( \int_0^1 d\tau a - {\bar \mu} \right) \exp \left( - \frac{1}{g^2} \int_0^1 d\tau a^2 \right) \\
&= {\cal N}  \int_{-\infty}^\infty da_0\prod_{n=1}^N \int_{-\infty}^\infty da_n db_n \delta ( a_0 - {\bar \mu}) \exp \left( - \frac{a_0^2}{g^2} - \frac{1}{g^2} \sum_{n=1}^N   a_n^2  - \frac{1}{g^2} \sum_{n=1}^N b^2_n ] \right) 
\end{align}
The integral over $a_0$ localizes due to the Delta function. The remaining integrals are simple Gaussians. Therefore,
\begin{align}
Z &= {\cal N} ( g^2 \pi )^N  \exp \left( - \frac{{\bar \mu}^2}{g^2} \right) 
\end{align}
We can now set ${\cal N} = \alpha ( g^2 \pi )^{-N}$ where $\alpha$ is an arbitrary finite constant and then take the $N \to \infty$ limit so we get
\begin{align}
Z &= \alpha  \exp \left( - \frac{{\bar \mu}^2}{g^2} \right)  .
\end{align}
Now, without any extra information, the normalization $\alpha$ of $Z$ cannot be fixed. However, OP seems to asking this question in the context of the paper 2112.03793 (this was clarified to me in the comments by @ɪdɪətstrəʊlə) where the authors impose the normalization condition
$$
\frac{1}{\sqrt{\pi}}\int d {\bar \mu}  Z = 1  \quad \implies \quad \alpha = \frac{1}{g}. 
$$
In summary,
$$
Z = \frac{1}{g} \exp \left( - \frac{{\bar \mu}^2}{g^2} \right) 
$$
A: While @Prahar's answer is correct when it comes to the exponential behaviour, i.e. the zero-mode, I disagree with their way of obtaining the prefactor. The $\frac{1}{g}$ behaviour is crucial and not a matter of normalisation. In particular, they disregard that in such computations one must zeta-function regularise the resulting determinants$^*$.
Before delving into the non-zero-mode sector let me outline the effect of the zero-mode for the sake of completeness. If we decompose $a$ into $a= a_0 + a'$, where $a_0$ is a constant (the zero-mode) and  $a'$ are non-constant, non-winding, periodic functions (and thus  $\int_0^1 \mathrm{d}\tau \;a' = 0$), it is clear that
$$\int_0^1\mathrm{d}\tau a = a_0$$
and $\mathrm{D}a=\mathrm{d}a_0\; \mathrm{D}a'$. Then the delta-function will only affect the zero mode, and hence
$$Z=\int \mathrm{d}a_0\ \delta\left(a_0-\bar{\mu}\right)\  \mathrm{e}^{-{a_0^2}/{g^2}}\ Z_\text{non-zero-mode}[g] = \exp\!\left(-\frac{\bar{\mu}^2}{g^2}\right)\ Z_\text{non-zero-mode}[g].$$
Now, the non-zero-mode sector is Gaussian and free of constraints and reads simply
$$\begin{aligned} Z_\text{non-zero-mode}[g] &= \int \mathrm{D}a' \exp\!\left(-\frac{1}{g^2}\int \mathrm{d}\tau \ a^2\right) = \\ &= \left[\det'\!\left(\frac{1}{g^2}\mathbb{I}\right)\right]^{-1/2} = \\ &= \left(\prod_{n\neq 0} \frac{1}{g^2}\right)^{-1/2} =  \prod_{n=1}^\infty g^2 \overset{\zeta}{=} \frac{1}{g}.\end{aligned}$$
where $\mathbb{I}$ is the identity operator acting on the space of periodic functions and $\det'$ excludes the zero mode, which is treated separately above. The last equality is understood in zeta-function regularisation$^\dagger$
In total we have
$$\begin{aligned}Z[g,\bar{\mu}] &=\int\mathrm{D}a\ \delta\left(\int_0^1\mathrm{d}\tau a - \bar{\mu}\right)\ \exp\!\left(-\frac{1}{g^2}\int\mathrm{d}\tau a^2\right)=\\ 
&=Z_\text{non-zero-mode}[g,\bar{\mu}]\ Z_\text{zero-mode}[g,\bar{\mu}] = \\
&= \frac{1}{g}\ \exp\!\left(-\frac{\bar{\mu}^2}{g^2}\right),
 \end{aligned}$$
getting the desired answer.

$^*$ As indeed noted by @Prahar in a comment, one can use a different regularisation method and should get the same $g^{-1}$ behaviour. One cannot however simply set the normalisation of the partition function to get the desired result, as the normalisation is already fixed in this case.
$^\dagger$ Remember that $\prod_{n=1}^\infty \text{constant} \overset{\zeta}{=} \exp(\log(\text{constant})\  \zeta(0))=\frac{1}{\sqrt{\text{constant}}} $.
