$\rho(t)$ is the solution of the master equation (\[eq:mastercoll2\]). The unconditional fidelity quantifies the performance of the QPG as a *deterministic* gate for single-photon qubits.

The dot-dashed line in Fig. \[fig:CPSlong\] (*right*) refers to the *conditional* fidelity ${\mathcal F}^c(t)$, which is evaluated according to Eq. (\[eq:fid\]), but with $\rho_f(t)$ replaced by $\rho_f^c(t)={\rm Tr}_{at}\{|\psi_{nj}(t)\rangle \langle \psi_{nj}(t)|\}/\langle \psi_{nj}(t)|\psi_{nj}(t)\rangle $, where $|\psi_{nj}(t)\rangle$ is the (non-normalized) evolved atom-field state conditioned to the detection of no quantum jumps [@Carmichael93], i.e., of no photon loss by spontaneous emission. This fidelity can be measured by post-selecting those measurement results that conserve photon number, i.e., discarding those data sets where at least a photon from the initial two-qubit state has been lost to the environment. The conditional fidelity quantifies the performance of the QPG as a *probabilistic* two-qubit gate.

![image](CPS)![image](AvFidelity.eps)

In Fig. \[fig:CPSlong\], we have found at best a CPS of $\sim\pi$ in correspondence with fidelities ${\mathcal F}(t_{int})$ and ${\mathcal F}^c(t_{int})$ equal to $60\%$ and $80\%$, respectively. This is due to the general presence of a *trade-off between the size of the CPS and of the gate fidelity*, as well as to the atomic dephasing [^1]. This is an important result of our paper, which actually holds true 