given by combinations of the phases of the off-diagonal matrix elements (in the Fock basis) of the reduced density matrix of the probe and trigger modes, $\rho_f(t) = \textrm{Tr}_{atoms}\{\rho (t) \}$.

The gate fidelity is given by [@NielsenChuang] $$\label{eq:fid}
{\mathcal F}(t) = \sqrt{\overline{{\left\langle\psi_{id}(t)\left|\rho_{f}(t)\right|\psi_{id}(t)\right\rangle}}},$$ where $$\begin{aligned}
 \label{eq:psi_id}
{\left|\psi_{id}(t)\right\rangle} &=& c_{00}\exp\{i\phi_{00}(t_{int})\} |0_p,0_t\rangle \nonumber \\ && + c_{01}\exp\{i\phi_{01}(t)\}|0_p,1_t\rangle \nonumber \\
&& + c_{10}\exp\{i\phi_{10}(t)\} |1_p,0_t\rangle \nonumber \\
&& + c_{11}\exp\{i\phi_{11}(t)\}|1_p,1_t\rangle\end{aligned}$$ is the ideally evolved state from the initial condition (\[iniz\]), with phases $\phi_{ij}(t)$ evaluated from $\rho_f(t)$ as discussed above. The overbar denotes the average over all initial states (i.e., over the $c_{ij}$, see Poyatos *et al.* [@Poyatos97]). The above fidelity characterizes the performance of the QPG as a deterministic gate. However, one could also consider the QPG as a *probabilistic* gate, whose operation is considered only when the number of output photons is equal to the number of input photons. The performance of this probabilistic QPG could be experimentally studied by performing a conditional detection of the phase shifts, and it is characterized by the *conditional* fidelity ${\mathcal F}^c(t)$, which will be discussed in Sec. \[sec:SSOperation\].

Perturbative Regime {#sec:perturbative}
===================

The conditional fidelity is always larger than the unconditional one, but they become equal 