quantum states where the mode is the corresponding spectral shape of the light pulse. Let us consider two single-mode coherent beams $$\begin{aligned}
& & |\alpha \rangle=\exp \left( -\frac{|\alpha|^2}{2} \right)
\sum_{n=0}^{\infty} \frac{\alpha^n \left(
A^{\dagger}\right)^n}{n!}|0\rangle \nonumber \\
& & |\beta \rangle=\exp \left( -\frac{|\beta|^2}{2} \right)
\sum_{n=0}^{\infty} \frac{\beta^n \left(
B^{\dagger}\right)^n}{n!}|0\rangle,\end{aligned}$$ where $A$ and $B$ are the two modes $$\begin{aligned}
& & A^{\dagger}=\int d\Omega F(\Omega) a^{\dagger}(\Omega) \nonumber \\
& & B^{\dagger}=\int d\Omega G(\Omega) a^{\dagger}(\Omega),\end{aligned}$$ and $|\alpha|^2$ and $|\beta|^2$ are the mean number of photons in modes $A$ and $B$, respectively. The mode functions $F$ and $G$ are assumed to be normalized, i.e., $\int d\Omega
|F(\Omega)|^2=\int d\Omega |G(\Omega)|^2=1$. The overlap between the quantum states, $|\langle \beta|\alpha \rangle|^2$, reads $$\label{overlap1}|\langle \beta|\alpha \rangle|^2=\exp \left(
-|\alpha|^2-|\beta|^2 + \rho \alpha \beta^{*}+\rho^{*}\alpha^{*}
\beta\right),$$ where we introduce the mode overlap $\rho$ that reads $$\label{overlap2} \rho=\int d\Omega F(\Omega) \left[ G(\Omega)
\right]^{*}.$$ In order to obtain Eq. (\[overlap1\]) we have made use of $\langle 0|B^n \left[ A^{\dagger}\right]^m |0 \rangle=n! \rho^n
\delta_{nm}$. For $\rho=1$ (coherent beams in the same mode but with possibly different mean photon numbers) we recover the well-known formula for single-mode coherent beams [@glauber1963]: $|\langle \beta|\alpha
\rangle|^2=\exp\left(-|\alpha-\beta|^2 \right)$.

Making use of Eqs. (\[modes\_input\]), (\[overlap1\]) and (\[overlap2\]) we obtain $$\begin{aligned}
& & |\langle 