\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[retainorgcmds]{IEEEtrantools}
\usepackage[numbers]{natbib}
\usepackage{mathtools}
\usepackage{braket}
\usepackage{booktabs}
\usepackage{indentfirst}
%\usepackage[parfill]{parskip}


\renewcommand{\thefigure}{S\arabic{figure}} %figure labels start with S
\newcommand{\lev}[3]{\textit{#1}$_{#2/#3}$}
\newcommand{\hflev}[4]{\textit{#1}$_{#2/#3}$, \textit{F}=#4}

\renewcommand{\arraystretch}{1.1}

%opening
\title{Supplementary Material}
\author{}

\begin{document}
\maketitle

\section{Heralded single photon generation}
\subsection{Four-wave Mixing}
\begin{figure}[b]
\centering
  \includegraphics[width=0.4\columnwidth]{figures/suppl_fwm/level_scheme.eps}
  \caption{ \label{fig:level_scheme} Energy level scheme for the FWM process in $^{87}$Rb}
\end{figure}

The four-wave mixing (FWM) energy level scheme is shown in Fig.~\ref{fig:level_scheme}. Two copropagating pump beams at 795\,nm and 762\,nm excite the atoms from 5D$_{3/2}, F=3$ level via the 5S$_{1/2}, F=2$ D1 line to generate photon pairs at 776\,nm (signal) and 780\,nm (idler).
The detection of a signal photon heralds the presence of a single photon in the idler mode with an exponentially decaying temporal shape.

The FWM setup cycles between two steps:
(1) 140\,$\mu$s of magneto-optical trap (MOT) cooling, where the MOT is turned on to cool and replenish the atom cloud; 
(2) 10\,$\mu$s of photon pair generation: the MOT beams are turned off, and the pump beams are turned on.
There is an additional 1$\mu$s gap between each step to ensure that no residual MOT fluorescence reaches the single atom (see \S\ref{sec:aom}). 

The 795nm pump laser is horizontally polarized, has a typical power of 0.55mW, and is $\Delta_{1}$=-30\,MHz red detuned from the the D1 transition. 
The 762nm pump laser is vertically polarized, and has a power between 6-10mW. As a trade-off between minimizing coherent scattering and having a high heralding efficiency and pair rate, the 2-photon detuning is set to $\Delta_{2}$=3.6\,MHz.
To suppress the beating between different decay channels through the 5P$_{3/2}$ level [Gurpreets beat paper], 
we only collect horizontally polarized signal photons and vertically polarized idler photons.

We characterize the performance of the FWM source via the heralding efficiency $\eta_h$ and the detection rate of signal photons at APD D$_\textrm{h}$ (signal rate). The heralding efficiency is the probability of detecting a photon at D$_\textrm{f}$ within a coincidence window $T_c$ (see \S\ref{sec:extinction}) given a click at D$_\textrm{h}$. Table~\ref{table:photon_data} shows the measured performance for different experimental parameters.

The idler photon bandwidth $\Gamma_p=1/\tau_p$ is typically adjusted by changing the strength of the MOT quadrupole magnetic field, which changes the optical density (OD) of the cloud[Bharath]. In general, a higher OD leads to shorter idler decay times $\tau_p$ and an increased signal rate. In order to acheive a $\tau_p$\,=\,4.4\,(2)ns, we additionally increase the 2-photon detuning to $\Delta_{2}$=??, which results in a decreased signal rate.



\begin{table}[ht]
\label{table:photon_data}
\begin{tabular}{@{}llll@{}}
Decay time $\tau_p$ & Bandwidth $\Gamma_p$ & Heralding efficiency $\eta_h$ & Signal rate (s$^{-1}$)\\
\hline
13.4(9)\,ns &  2$\pi\,\cdot\,$11.9(8)\,MHz &  0.0039(6)  &  377(87)\\
REVERSED    &        ??         &  0.0040(6)  &  351(78) \\
10.1(1)\,ns &  2$\pi\,\cdot\,$15.8(2)\,MHz  &  0.0035(5)  &  1955(466) \\
7.1(2)\,ns  &  2$\pi\,\cdot\,$22.4(6)\,MHz  &  0.0049(4)  &  2485(344) \\ 
5.6(3)\,ns  &  2$\pi\,\cdot\,$28.4(2)\,MHz  &  0.0043(6)  &  3785(629) \\
4.4(2)\,ns  &  2$\pi\,\cdot\,$36.2(2)\,MHz  &  0.0052(2)  &  1174(292)
\end{tabular}
\caption{Performance of the FWM source for different experimental parameters.}
\end{table}

\subsection{Generating exponentially rising idler photons}
To generate exponentially rising idler photons, we send the 776\,nm heralding photons onto a resonant bandwidth-matched asymmetric Fabry-P\'{e}rot cavity before detection at D$_\textrm{h}$.[cavity paper] 
The cavity parameters are:
\begin{center}
\begin{tabular}{ll}
Length & $125()$\,mm\\
Mirror radius of curvature & 200\,mm\\
Reflectivity M$_1$ (in-coupling mirror) & 0.943\\
Reflectivity M$_2$ & 0.9995\\
Finesse & $103(5)$\\ 
Cavity decay time $\tau_c$ & $13.6 (0.5)$\,ns \\
\end{tabular}
\end{center}
We use an auxiliary 780\,nm laser (omitted in Fig.1) to stabilize the cavity length using the Pound-Drever-Hall technique. During the $10\,\mu$s pair generation step, the auxiliary laser is switched off to reduce background detection events on the heralding detector~$D_\textrm{h}$.  

The transmission of the heralding photon through the cavity setup (Fig. 1, top right) is $\approx$\,40\%. To reduce losses and measurement time, the cavity is only 1used for $\tau_p$=13.5\,ns; otherwise the heralding photon bypasses the cavity setup and goes straight to $D_\textrm{h}$. The slight timing differences in photon and signal propagation are accounted for during the data analysis. 

\subsection{Alternating between temporal shapes}

Direct comparisons between coincidence histograms for exponentially rising and decaying photons (Fig. 2) is only possible if the heralding efficiencies are comparable between the two measurements. In order to do so without postprocessing corrections, we minimize systematic differences in efficiencies by alternating between the two temporal shapes approximately every 20 mins. This is done by changing the cavity detuning from 0 (for exponentially rising idler photons) to 70\,MHz (for exponentially decaying idler photons). 

There are imperfections in the cavity operation: we observe residual contributions to the coincidence histograms (Fig. 3) for $\Delta t_{hf}$ below (above) 0 for exponentially decaying (rising) idler photons. These are caused by drifts in the photon decay times lead to a mismatch with the fixed cavity bandwidth, imperfect coupling of the heralding photon to the resonant cavity, and leakage of the heralding photon into the cavity when it is detuned.

\subsection{Monitoring decay times}

In order to track the drifts in the idler photon decay time $\tau_p$, data is accumulated in periods of $\tau_m$ and the D$_\textrm{h}$-D$_\textrm{f}$ coincidence histogram is fitted to an exponential function. 
A small $\tau_m$ is desirable for effective monitoring and timely feedback, and typically varies between 30\,-\,60 mins ($\approx$\,200\,-\,400 atom loading events) depending on the rates and efficiencies, limited by the need to accumulate sufficient statistics for a sensible fit. 
As the atom alters the profile of the tranmitted photon, only the reference data measured without the trapped atom is used. If necessary, the optical density of the atomic cloud is adjusted to maintain $\tau_p$ within a reasonable range. If a measured value of $\tau_p$ lies outside this range, the data obtained within that window is discarded. The standard deviation of the resulting distribution is shown in Table~\ref{table:photon_data} and Fig.~4.

The inversion of an exponentially decaying to rising idler photon with the same decay time $\tau_p$ assumes the idler bandwidth matches that of the cavity, i.e. $\tau_p=\tau_\textrm{cavity}$. Drifts in the photon bandwidth do not translate directly into the measured $\tau_p$ for exponentially rising idler photons (as the temporal profile is no longer strictly exponential\textbf{??}) and thus are harder to quantify. As such, for $\tau_p$=13.5\,ns, we only refer to decay time measurements for the exponentially decaying idler photons as we alternate between the two shapes, and assume that the photon bandwidth does not vary significantly between successive measurements. We then obtain one value for $\tau_p$ every 2\,$\tau_m$, during which we perform the alternating cycle 2 to 3 times.

\section{Optical switch for idler photons}\label{sec:aom}
\begin{figure}[ht]
  \includegraphics[width=\columnwidth]{figures/suppl_aom_window/aom_window.eps}
  \caption{ \label{fig:aom_window}
  Coincidence probability between D$_\textrm{h}$ and D$_\textrm{f}$ for $\tau_p=13.5$\,ns, plotted on a semi-log scale to highlight the two different offset levels and the 600\,ns AOM window. }
\end{figure}
Besides shifting the central frequency, we also use the AOM for the idler photon (see Fig. 1 of main text) as an optical switch for several reasons:
\begin{itemize}
  \item{The single atom should not receive any light from the FWM setup until its state is correctly prepared and the system is ready for measurements.}
  \item{The FWM setup continually cycles between MOT cooling and pair generation phases. Fluorescence from the MOT during the cooling phase will interfere with the atom.}
  \item{During the pair generation phase, we want to minimize the effect of unheralded photons (singles) on the atom.}
 \end{itemize}
As such, the AOM is turned on for a 600\,ns window only when the following coniditions are met: 
\begin{itemize}
  \item{The experimental sequence is at a measurement window (see \S\ref{sec:seq}).}
  \item{The FWM setup is in the pair generation step.}
  \item{There is a detection event on the heralding detector APD D$_\textrm{h}$.}
\end{itemize}

Fig.~\ref{fig:aom_window} shows an extended temporal profile of the idler photon ($\tau_p=13.5$\,ns) together with the AOM window. Accidental counts result in a constant offset in the coincidence probability. Therefore, the window is chosen to be considerably wider than the duration of the idler photon so that the intervals within the AOM window which are far away from the photon can be used to correct for this offset (see \S\ref{sec:modeling}). 

\section{Experimental sequence}\label{sec:seq}

\begin{figure}[ht]
\centering
  \includegraphics[width=\columnwidth]{figures/suppl_exp_sequence/exp_sequence.eps}
  \caption{ \label{fig:exp_seq}
    The upper figure shows the experimental sequence for the single atom setup. The lower figure shows the FWM sequence, which continuously cycles between the two steps and is not synchronized with the single atom sequence, although it is only relevant during the measurement window. Q. field: quadrupole magnetic field.}
\end{figure}

The experimental sequence is illustrated in Fig.~\ref{fig:exp_seq}. 
It begins when an atom is loaded into the optical dipole trap from the MOT. The steps are as follows:
\begin{enumerate}
  \item{10ms of molasses cooling with the MOT beams.}
  \item{A bias magnetic field (B field) of $\approx7$\,Gauss is applied along the optical axis and we wait 20ms for the field to stabilize. The bias field sets the quantization axis and increases the lifetime of the optically-pumped state.}
  \item{We carry out two measurment cycles. Each cycle consists of:}
  \begin{enumerate}
    \item{5ms of optical pumping to the 5\hflev{S}{1}{2}{2}, $m_F$=-2 dark state. Two beams are used: a $\sigma-$ polarized optical pumping beam resonant to the 5\hflev{S}{1}{2}{2} -- 5\hflev{P}{3}{2}{2} transition, and a repump beam red-detuned to the 5\hflev{S}{1}{2}{1} -- 5\hflev{P}{1}{2}{2} transition (detuning = ??). Both beams are focused onto the atom with the aspheric lens}
    \item{100ms measurement window. Upon a detection event on the heralding APD D$_\textrm{h}$, the AOM is turned on for 600\,ns (see Fig.~\ref{fig:sync}). APD clicks are recorded within this window.}
  \end{enumerate}
  \item{Check for the presence of the atom in the trap by turning off the bias B field, turning on the MOT beams, and measuring atomic fluorescence on $D_f$. If the count rate surpasses a threshold, the atom is still present. This step typically lasts a few 10\,ms.}
  \begin{itemize}
    \item{If the atom is still present, the data collected in this sequence is considered valid. Repeat sequence.}
    \item{If the atom is lost, the data colleceted in this sequence is discarded. Perform a background measurement without an atom in the trap, using a measurement window (similar to step 3b) of 2\,s. The bias B field is also turned on to replicate the experimental conditions when the atom was present. After that, turn on the MOT and wait for another atom to be loaded.}
  \end{itemize}
\end{enumerate}

The beams are switched on/off using AOMs. To account for the switching time and to allow the intensity to stabilize, there are further gaps of 10\,$\mu$s in the sequence each time a beam is switched on/off before the next step commences. (Note that this is not inconsistent with the 100\,ns rise time mentioned earlier; 10\,$\mu$s was chosen merely for convenience).

Although the idler photon excites a closed transition and no other light beams are turned on during the measurement window, we repeat the optical pumping at the start of each measurement sequence. This acts as a safeguard against the unlikely scenario of the atom not remaining in the prepared 5\hflev{S}{1}{2}{2}, $m_F$=-2 state due to off-resonant scattering, stray light fields or intrinsic decoherence etc.

We choose to carry out two measurement cycles per sequence in order to maximize the collection rate of valid data. Having more cycles per sequence decreases the time spent checking for the presence of the atom, but a higher atom loss probability would lead to more data being discarded. The atom remains trapped for an average of $\sim 7$ sequences before it is lost. The overall duty cycle, i.e. time during which an atom is in the trap and the sequence is running, is $\sim 50\%??$.

\section{Synchronization of signals}

\begin{figure}
  \includegraphics[width=\columnwidth]{figures/suppl_sync/sync.eps}
  \caption{ \label{fig:sync}
  Signal handling scheme for the experiment. During the measurement window, the single atom setup signals the AND gate to admit clicks from D$_\textrm{h}$. The admitted clicks are recorded and used to trigger the AOM and the gate unit, which transmits clicks from D$_\textrm{f}$ and D$_\textrm{b}$ to the timestamp unit within a 2\,$\mu$s window from the trigger. The inset shows these events on a timeline starting from a click from D$_\textrm{h}$ arriving at the AND gate.}
\end{figure}


In this section we present how we handle various data signals and timing delays. 
The signal handling schematic is shown in Fig.\ref{fig:sync}.

At the single atom setup, the receipt of a click from D$_\textrm{h}$ within the measurement window triggers the following actions:
\begin{itemize}
  \item{The trigger is recorded on the timestamp unit, which is located at the single atom setup.}
  \item{The AOM is turned on for 600\,ns.}
  \item{A gate unit is turned on for 2\,$\mu$s. The timestamp records clicks from D$_\textrm{f}$ and D$_\textrm{b}$ only during this window, thus preventing the raw data files from getting unnecessarily huge.}
\end{itemize}

The FWM setup is located in a separate room from the rest of the setup. To allow for sufficient time for the trigger signal to travel between the setups ($\approx$150\,ns) and for the AOM to switch on ($\approx$\,400\,ns for the acoustic signal to travel across the crystal + $\approx$\,100\,ns rise time), the idler photon travels through a 230\,m delay fiber before reaching the AOM. 

\section{Numerical modelling and data processing}\label{sec:modeling}
Ref~\cite{Wang:2011} considered a propagating single-photon wave packet interacting with a two-level system in the Weisskopf-Wigner approximation
and found the following set of coupled differential equations:
\begin{equation}
 \dot{\mathbf{s}}(t) = M \mathbf{s}(t) + \mathbf{b}
\end{equation}
with
\begin{IEEEeqnarray}{C}
 M = 
\begin{pmatrix}
 -\Gamma_0  & -2g(t) & -2g(t)^* \\
 0 & -\Gamma_0/2  & 0 \\
  0 & 0 & -\Gamma_0/2  \\
\end{pmatrix}
,~~\mathbf{b} = 
\begin{pmatrix}
 -\Gamma_0  \\
 -g^*(t)\\
  -g(t)   \\
\end{pmatrix}
, \nonumber\\
%\end{equation}
%and
%\begin{equation}
\mathbf{s}(t)= 
\begin{pmatrix}
 \bra{g,1_p,0_e}\hat{\sigma}_z(t)\ket{g,1_p,0_e} \\
 \bra{g,0_p,0_e}\hat{\sigma}_+(t)\ket{g,1_p,0_e} \\
  \bra{g,1_p,0_e}\hat{\sigma}_-(t)\ket{g,0_p,0_e}  \\
\end{pmatrix}
%\end{equation}
\end{IEEEeqnarray}
where $\bra{g,1_p,0_e}$ describes the two-level system in the ground state, the pulse mode as a single-photon Fock state, and the environment in the vacuum state; 
the atomic operators are $\hat{\sigma}_+=|e\rangle\langle g|$, $\hat{\sigma}_-=|g\rangle\langle e|$, $\hat{\sigma}_z=|e\rangle\langle e|-|g\rangle\langle g|$~;
$g(t)=\sqrt{\eta_p \Gamma_0} ~\xi(t)$, where $\xi(t)$ is the photon temporal shape~,~ $\Gamma_0$ is the natural linewidth, and $\eta_p$ is the spatial overlap between the excitation mode and the atomic dipole emission.

We are interested in the dynamics following the initial state $\ket{g,1_p,0_e}$, i.e.
\begin{equation}
\mathbf{s}^T(t_0)= \left( -1,~ 0,~ 0 \right). \label{eq:init_cond}
\end{equation}
The excited state population is given by the first component of the vector $\mathbf{s}$:
\begin{equation}
P_e(t) = \tfrac{1}{2} \left[ s_1(t) + 1 \right].
\end{equation}
Further assuming that $g(t)$ is real, we simplify the differential equations to Eq.~2 of the main paper:
\begin{align}
 \dot{P}_e(t) &= -\Gamma_0 P_e(t) - 2g(t) s_2(t)\label{eq:Pedot}\\
 \dot{s_2}(t) &= -\frac{\Gamma_0}{2} s_2(t) - g(t)\label{eq:s2dot} 
\end{align}
where in the main paper we refer to $s_2(t)$ as $s(t)$. 
From Eq.~(\ref{eq:Pedot}) we consider the rate of change of the excited state population $\dot{P}_e(t)$, and further identify $-\Gamma_0 P_e(t)$ as the instantaneous atomic emission, which is always negative; %and hence describes the rate at which the atom losses energy . 
and $-2g(t)s_2(t)$ as the instantaneous atomic absorption, which is always positive (from Eq~(\ref{eq:init_cond}),(\ref{eq:s2dot}) we see that $\dot{s}_2(t)$ is always negative).  %and hence describes the rate at which the atom gains energy (in units of quanta per second).

\subsection{Atomic emission}
To measure the atomic emission $-\Gamma_0 P_e(t)$, we collect the scattered photons in the backwards channel and consider the coincidence histogram between D$_\textrm{h}$ and D$_\textrm{b}$ (Fig. 2). The detection probability is
\begin{equation}
  P_b(t) = \eta_0 \Gamma_0 P_e(t)
\end{equation}
where $\eta_0$ is the overall detection efficiency. Accounting for time-binning and an offset caused by accidental coincidences $\alpha_b$, we calculate the solid line in Fig.~2 given by
\begin{equation}
  P^{\prime}_b(\Delta t_{hb}) = \eta_0 \Gamma_0 P_{e,\textrm{bin}}(\tau,\Delta t_{hb}) + \alpha_b
\end{equation}
where $\Delta t_{hb}$ is the detection time delay between D$_\textrm{h}$ and D$_\textrm{b}$, and
\begin{equation}
  P_{e,\textrm{bin}}(\tau,\Delta t_{hb}) = \frac{1}{\tau}\int^{\Delta t_{hb}+\tau/2}_{\Delta t_{hb}-\tau/2} P_e(t)\;dt
\end{equation}
is the excited state population where we account for the time-binning of width $\tau$.
The overall detection efficiency is given by:
\begin{equation}
  \eta_0 = \left(\frac{\eta_h}{\eta_f}\right)\cdot\eta_b
\end{equation}
where $\eta_h$ is the heralding efficiency, $\eta_f$ is the detection efficiency of the excitation mode (mainly fiber coupling losees and APD efficiencies), and $\eta_b$ is the overall collection and detection efficiency in the backwards channel. $\eta_h/\eta_f$ gives the probability of having a photon in the excitation mode at the position of the atom for each detection event at D$_\textrm{h}$. We independently measure $\eta_f=0.25$ and $\eta_b=0.0078$ \textbf{should we elaborate on the sat curve and how we get $\eta_b$? also, errors on these values?}.

We obtain $\alpha_b$ by averaging the measured histogram over a 300\,ns interval at faraway values of $\Delta t_{hb}$, where the idler photon does not contribute. We note that the main contributions to $\alpha_b$ are dark counts from D$_\textrm{b}$, and is unaffected by the opening of the 600\,ns AOM window.

%To get the probability to observe a coincidence event in the backwards channel ($D_h$-$D_b$) we calculate $P_e(t)$ and apply the same time-binning as in the experiment $P_{e,bin}(t)$ ($\Delta t=5$\,ns time bins).
% The solid line in Fig.2 of the main text is then:
% \begin{equation}
% f(t) =  \Delta t~ \Gamma_0 ~ \xi ~ P_{e,bin}(t-t_0) + y_0
% \end{equation}
% where $\xi$ is the overall detection efficiency of the backward channel $D_b$, $y_0$ are the background detection events in $\Delta t$ and $t_0$ is the start (end) of the exponentially decaying (rising) photon.
% The solid lines in Fig.2 are calculated assuming ideal input shapes $g_{dec}(t)$ and $g_{ris}(t)$ and  $\xi=,~y_0=,~t_0=,~\tau_p=$.
% \begin{align}
%  g_{dec}(t)  &=  0 ~~~&\text{for}~~ t<t_0\\
%   &= \sqrt{\frac{ \eta \Gamma_0}  {\tau_p} } \exp{\left( -\frac{1}{2\tau_p} (t-t_0) \right) } ~~~ &\text{for} ~~ t>t_0
% \end{align}
% \begin{align}
%  g_{ris}(t)  &=  0 ~~~&\text{for}~~ t>t_0\\
%   &= \sqrt{ \frac{ \eta \Gamma_0}  {\tau_p}} \exp{ \left( \frac{1}{2\tau_p} (t-t_0) \right) } ~~~ &\text{for} ~~ t<t_0
% \end{align}

\subsection{Transmission}\label{sec:trans}

The atom alters the transmission of the excitation mode via its absorption $2g(t)s_2(t)$ and the small portion of re-emission into the pulse mode $\eta_p \Gamma_0  P_e(t)$. Thus the probability of a photon being transmitted through the atom is  
\begin{equation}
 %P_D (t) = \left|\xi(t)\right|^2 -  W(t) + \eta_p \Gamma_0 P_e(t) 
 P_f (t) = P_{f,0}(t) + 2g(t)s_2(t) + \eta_p \Gamma_0 P_e(t) 
\end{equation}
where $P_{f,0}(t)=\left|\xi(t)\right|^2$ is the probability distribution of the incoming photon.
%In our numerical treatment 
We ignore any interference between the incoming photon and the atomic emission because of the weak atom-photon interaction, and the small spatial overlap $\eta_p$; the intensity of the excitation light at detector $D_f$ is $10^3$ times larger than the atomic re-emission.

We collect the light in the excitation mode and consider the coincidence histogram between D$_\textrm{h}$ and D$_\textrm{b}$ (Fig. 3). Similarly, taking time-binning and accidental coincidences into account, we can calculate
\begin{IEEEeqnarray}{rCl}
  P^{\prime}_{f}(\Delta t_{hf}) & = & |\xi(\Delta t_{hf})|^2 + 2g(t)s_2(t) + \eta_p\Gamma_0 P_{e,\textrm{bin}}(\tau,\Delta t_{hf}) + \alpha_{f} \\
  P^{\prime}_{f,0}(\Delta t_{hf}) & = & |\xi(\Delta t_{hf})|^2 + \alpha_{f,0}
\end{IEEEeqnarray}
where $\Delta t_{hf}$ is the detection time delay between D$_\textrm{h}$ and D$_\textrm{f}$, and $\alpha_{f}$,$\alpha_{f,0}$ are offsets caused by accidental coincidences.
To illustrate the effect of the atom, we calculate the lines in Fig.~3 (bottom) given by 
%$P^{\prime}_{f}(\Delta t_{hf})/P^{\prime}_{f,0}(\Delta t_{hf})$ 
$\frac{P^{\prime}_{f}(\Delta t_{hf})}{P^{\prime}_{f,0}(\Delta t_{hf})}$. 
The solid lines are calculated without accidental corrections ($\alpha_{f}=\alpha_{f,0}=0$), while for the dashed lines we obtain $\alpha_f,\alpha_{f,0}$ by averaging the measured histograms (taken with and without the trapped atom respectively) over intervals within the AOM window (total duration 300\,ns) where the idler photon does not contribute significantly. We note that $\alpha_{f}$ and $\alpha_{f,0}$ are slightly different, possibly due to scattering of uncorrelated idler photons by the atom.

\subsection{Extinction}\label{sec:extinction}
We define the extinction $\epsilon$ as the overall probability for the atom to scatter the incoming photon outside of the excitation mode. 
We can obtain $\epsilon$ by integrating the instantaneous emission $\Gamma_0P_e(t) $ and subtract the fraction emitted back into the excitation mode:
\begin{equation}
 \epsilon = \int^\infty_{-\infty}  P_e(t) \Gamma_0 (1-\eta_p)\; dt
\end{equation}
which is equivalent to 
\begin{equation}
 \epsilon = \int^\infty_{-\infty}  -\frac{2g(t)s_2(t) + \eta_p\Gamma_0 P_e(t)}{|\xi(t)|^2}\; dt
\end{equation}
in our model. From the transmission histogram data, we can calculate the extinction via
\begin{equation}
 \epsilon = 1 - \frac{\left[\sum_{T_c}G_{f}(\Delta t_{hf})\right]-\alpha_f}{\left[\sum_{T_c}G_{f,0}(\Delta t_{hf})\right]-\alpha_{f,0}}
\end{equation}
where the summation is performed over a coincidence window $T_c$. 
The summation is performed over the interval $T_c=-\,\tau_p \leq \Delta t_{hf} \leq 5\,\tau_p$ for exponentially decaying photons, and $T_c=-5\,\tau_p \leq \Delta t_{hf} \leq \,\tau_p$ for exponentially rising photons, where $\Delta t_{hf}=0$ corresponds to the peak of the photon distribution. 
Despite accidental corrections, it is still necessary to limit the width of $T_c$ to 6\,$\tau_p$ to reduce noise while considering almost all contributions from the idler photon.

Drifts of the heralding efficiency directly affect the measured coincidences as well as the accidental contributions. In order to reduce such systematic errors in our evaluation of $\epsilon$, we sort the measurement data into sets of 100 atom loading events (corresponding to $\approx$\,20\,mins) and recalculate $\alpha_f$,$\alpha_{f,0}$ and $\epsilon$ within each set. The accidental offsets are obtained in the same way as described in \S\ref{sec:trans}. The overall value and uncertainty of $\epsilon$ are obtained from the unweighted mean and standard error of the values obtained across all data sets.


\bibliographystyle{apsrev4-1}
\bibliography{safwm.bib}{}
\end{document}
