A Novel, Robust Quantum Detection Scheme

Protocols used in quantum information and precision spectroscopy rely on efficient internal quantum state discrimination. With a single ion in a linear Paul trap, we implement a novel detection method which utilizes correlations between two detection events with an intermediate spin-flip. The technique is experimentally characterized as more robust against fluctuations in detection laser power compared to conventionally implemented methods. Furthermore, systematic detection errors which limit the Rabi oscillation contrast in conventional methods are overcome.


Introduction
A standard protocol for quantum mechanics experiments is comprised of a three-step sequence: Firstly, the quantum system is initialized to a known quantum state, for instance by optical pumping in the case of atoms or ions. Secondly, external control fields, e.g. sequences of laser light pulses or radio-frequency radiation, are applied to implement the Hamiltonian of interest. Finally, the resulting state is read out by a projective measurement. In the case of single or few-atom quantum systems, repeating the experiment many times is necessary in order to accumulate statistics, such that the average measurement result represents the quantum state after the evolution according to the Hamiltonian, projected onto the measurement basis. Thus, the fidelity of state detection plays an essential role in the understanding of the underlying dynamics and, in addition to other constraints given by the experimental setup, imposes a limitation to the quality of the experimental findings.
Trapped ions are an ideal system to investigate quantum mechanical effects owing to the almost perfect control of the ion's internal and motional state preparation, manipulation and read-out [1]. This is demonstrated by both relevant theoretical and experimental progress, providing new insights in many fields of physics, to name a few: quantum computing [2], optical clocks [3,4], precision spectroscopy [5,6,7] and quantum simulations [8,9,10,11]. All underlying experimental schemes depend on the high fidelity of both the applied algorithm and the state detection of the ion.
The basic principle of state discrimination in ions relies on electron-shelving [12]. Two different energy states (qubit) are distinguished by their state-dependent fluorescence via coupling to a third level. In its simplest form, the number of collected photons during a single detection cycle determines whether the ion is assigned to a so-called bright (dark) state depending on this number being higher (lower) than a chosen threshold. This threshold detection technique has been successfully implemented in many experiments yielding an almost unity read-out fidelity for qubits stored in two optically separated meta-stable states ( 40 Ca + [13], 111 Cd + [14], 88 Sr + [15]). Detection fidelities can be further improved by taking into account photon arrival times, as opposed to only observing the integrated signal. This type of Bayesian inference or maximum likelihood detection has been successfully demonstrated in an optical qubit with 40 Ca + yielding fidelities of 99.991(1)% [13,16]. The detection fidelity is ultimately limited by the finite overlap between the bright and dark state photon distributions, resulting in an increased and asymmetric (bias) error in the assignment of qubit states. Long detection times reduce this error, but are ultimately limited in real physical systems by the finite lifetime of the qubit states due to spontaneous or induced transitions to other states. This effect is particularly prominent for hyperfine qubits, where the detection fidelity suffers from depumping of one of the qubit states ( 9 Be + [17,18], 171 Yb + [19], 25 Mg + [20]), effectively limiting the detection time and thus the number of observed photons. This can be overcome by implementing a quantum non-demolition measurement in which the qubit state to be detected is repeatedly transferred to an auxiliary ion, where detection is performed. A Bayesian state inference of the time series of photon detection events of such an experiment, implemented with an optical qubit in Al + , and read out by a hyperfine qubit in Be + , yielded a detection fidelity of 99.94% [21]. However, achieving such a high fidelity requires either an auxiliary ion to implement a quantum non-demolition measurement [21], or an optical qubit with a long excited state lifetime. Here, we demonstrate a novel state detection technique with improved state discrimination by combining two detection events of either threshold or Bayesian detection types with an intermediate well-controlled state inversion spin-flip. Observation of the correlated detection outcome acts as a post-selective statistical filter, significantly reducing the state assignment errors due to overlapping photon distributions. Owing to the symmetry of the π-detection scheme, the detection errors for the two qubit states are at the same time equalized, effectively reducing the bias error. Another implication of this effect is the robustness of the scheme against fluctuations of detection parameters, making it particularly well-suited for systems in which only very few photons are detected. Consequently, the π-detection scheme will always improve the detection fidelity of threshold and Bayesian detection schemes if the state inversion can be performed with sufficient fidelity. The scheme is also applicable to multi-particle systems, as long as individual atoms can be resolved. Furthermore, we imagine similar schemes to be applied to neutral atoms with nondestructive detection methods where the particle is not lost after a single detection cycle, such as measuring the state-dependent reflection and transmission signals of molecules or atoms in cavities [22,23].

Experimental Apparatus
The experiments discussed here have been carried out in a setup described in detail in [20]. Briefly, we trap a single 25 Mg + ion in a linear Paul trap at trapping frequencies ω ax ∼ 2π × 2.2 MHz in the axial and ω r ∼ 2π × 4.5 MHz in both radial directions. The qubit is encoded into two long-lived hyperfine ground states of the S 1/2 manifold, namely |F, m F = |3, 3 = | ↓ and |2, 2 = | ↑ , representing the bright and the dark state, respectively. For all measurements, a magnetic field of typically B ∼ 0.6 mT lifts the degeneracy between the magnetic sub-levels. A frequency-quadrupled solid-state fiber laser system provides light at 280 nm for laser cooling and detection using the cycling transition between the | ↓ and the |4, 4 = |e state of the P 3/2 manifold with a linewidth of Γ ∼ 2π ×40 MHz. The detection and Doppler cooling lasers are derived from the same source, their only difference being that the detection laser operates on resonance with the cycling transition, whereas the Doppler cooling laser is detuned by half the natural linewidth for optimal cooling performance.
The resulting resonance fluorescence scattered from the ion is collected by both an objective and a parabolic mirror and subsequently focused onto a photo-multiplier tube for quantitative readout on a µs time scale. The application of radio-frequency at 1.789 GHz, which corresponds to the hyperfine splitting in 25 Mg + , provides coherent coupling between the qubit states. The radio-frequency is supplied by a quarter-wave antenna at a distance of approximately 12 cm from the center of the ion trap. An overview of all relevant levels and transitions is shown in Figure 1   Doppler cooling (DC) is applied on the cycling transition between the S 1/2 and P 3/2 manifolds. An additional σ -repumper improves state initialization. The qubit levels | ↓ and | ↑ are coherently coupled by applying radio-frequency pulses (RF) at 1.789 GHz. (b) Experimental protocol. Three Doppler cooling and repumping pulses initialize the ion to the | ↓ state. After that, a radio-frequency spectroscopy pulse is applied. The sequence is concluded with a resonant detection pulse (same as the DC beam). To obtain sufficient statistics, the sequence is typically repeated for 300-1000 times.

Experimental Protocol and Quantum State Detection
After the ion is loaded into the trap, the experimental sequence comprises three steps (see Figure 1(b)) which are repeatedly applied to the ion: 1. Preparation and Cooling. The ion is initialized by optical pumping to | ↓ by means of a Doppler cooling laser which is applied for 600 µs. An additional repumping laser guarantees that no population remains in the upper manifold (S 1/2 F = 2). After Doppler cooling, the temperature of the ion is close to the Doppler limit of ∼ 1 mK [20].
2. Radio-Frequency Spectroscopy. A radio-frequency spectroscopy pulse is applied for a time τ spec to drive magnetic field induced Rabi oscillations between | ↓ and | ↑ . Due to the small Lamb-Dicke parameter of the radio-frequency transition η ∼ 10 −7 , the transition is independent of the motional state of the ion, which makes Doppler cooling sufficient for these experiments.
3. State Detection. The quantum state of the ion is read-out using different protocols, involving at least one detection laser pulse on resonance with the | ↓ ↔ |e transition. At the end of each experimental cycle the ion is projected into either the | ↓ or the | ↑ state. The ion's state is inferred by averaging over the results of many identical experimental cycles.
If the ion is in the | ↓ state, application of the detection laser at saturation intensity will let it reside in the cycling transition and scatter photons with a rate of approximately Γ/4 ∼ 6.425 × 10 7 s −1 , where Γ corresponds to the natural linewidth of the magnesium transition [24]. On the other hand, if the ion is in the | ↑ state , the detection laser is detuned by the ground state splitting of ∆ HF ≈ 2π × 1.789 GHz and photon scattering is suppressed by The collected number of photons are random variables. For the bright state, the random variable follows a Poissonian distribution [25]. The probability to measure k photons is given by whereξ = R · τ denotes the average photon number, R is the scattering rate and τ is the detection time.

State Detection Errors
There are several sources of systematic errors which yield false state information. They impose limits on the detection time and the read-out fidelity. In the following, these errors are briefly described. Afterwards, different detection methods which help overcome these limitations are discussed. A detailed theoretical discussion on detection errors of the threshold and Bayesian methods is found in [26].

Depumping and Decay of the Upper Qubit State.
In the case of a qubit encoded into two hyperfine ground states, as for 25 Mg + , the finite detuning of the detection laser pulse with respect to the |↑ state results in off-resonant excitation of the ion with a rate of approximately where s 0 = I/I s is the saturation parameter, I the laser intensity and I s the saturation intensity of the Doppler cooling transition in 25 Mg + . Consequently, for long detection times, the ion is off-resonantly pumped into the | ↓ state, where it enters the cycling transition. Once there, a significantly larger amount of photons is scattered, which leads to a wrong assignment of the ion to the bright state, although it was initially dark. This results in a bias error of the state assignment [13,16,21], thus imposing a limit on the detection time. The effect of depumping on the number of scattered photons is depicted in Figure 2 (a). The average number of detected photons for the bright state is where R B is the scattering rate of the bright state. For the dark state, the depumping effect is taken into account in the following way: If the ion remains in the dark state during the detection interval, only background countsξ ∞ = R ∞ · τ are measured. Here, R ∞ corresponds to the background scattering rate and τ to the detection time. In case the ion is depumped at a time t during the detection interval, the number of photons depends on the time [27] and Section 3.2). Both processes are weighted exponentially by the function w(t) = exp(−t/T )/T , where T denotes the 1/e-decay time. The average number of detected photons for the dark state then reads The fit of the measured data yields a decay time of T ≈ 61 ± 4 µs (see Figure 2(a)), which is consistent with the expected depumping rate of Eq. 2.
In principle, the bright state can also be depumped to the dark state if the polarisation of the detection light is not pure. However, this effect can be easily eliminated and will not be considered here. By comparing the initial bright state preparation in the optical pumping cycle with and without the σ -repumper laser, we typically observe an estimated infidelity of 1-2 % in the polarization of the detection light.
One possibility to circumvent the depumping process is to map the hyperfine qubit in a state-selective way onto an optical qubit encoded in a ground and a meta-stable excited optical state. Since the magnitude of the detuning of the detection laser is in the optical regime, offresonant depumping can be neglected. However, the finite lifetime of the excited meta-stable state also imposes a limitation on the detection time since the ion eventually decays back to the ground state by spontaneously emitting a photon. In addition to that, the finite fidelity of the mapping protocol has to be taken into account [13]. The solid red line corresponds to a fit to Eq. 3. For an ion in the dark state (black circles), the count rate reflects only the background photon counts for short times. The detection laser eventually depumps the ion to the bright state, thus the count rate asymptotically approaches the rate of the bright state for long detection times. The solid black line corresponds to a fit to Eq. 4 and yields a decay time of T ≈ 61 ± 4 µs. The dashed green line reflects the asymptotic behaviour of the dark fluorescence for large detection times. (b) Measured normalized example photon histograms of the bright and the dark state for a detection time of 10 µs for a single 25 Mg + ion. The measured scattering rates for the bright (dark) state are R B ∼ 249 · 10 3 s −1 (R ∞ ∼ 11 · 10 3 s −1 ). Figure 2 (b), the measured probability distributions of the collected fluorescence photons for both bright and dark states of the 25 Mg + ion in 10 µs are shown. As a consequence of the limited detection time and the depumping events, the distributions exhibit a finite overlap. If the number of detected photons lies in the overlapping region, it cannot be unambiguously decided to which state the number of collected photons should be assigned, leading to false state assignments with a bias that depends on the fraction of the photon histograms below (above) the threshold for the bright (dark) state.

Fluctuations of experimental parameters.
Temporal fluctuations in the atomic scattering rate induced by intensity or frequency fluctuations of the detection laser or a change in the bias magnetic field alter the photon distributions of both dark and bright states from shot-to-shot. If the state detection method depends on either form or average value of the photon distribution, the result of the state assignment will be biased by a change in the scattering rate.

Threshold Detection Technique
In this method, state discrimination is achieved by imposing a threshold σ and assigning all detection events which yield a photon number higher than the chosen threshold to the bright state and all events with equal or lower photon numbers to the dark state. The advantage of this method lies in its simplicity and the fact that a single detection cycle suffices to determine the state the ion was projected onto.
The state detection error for the bright state is given by For the dark state, it reads in the absence of depumping where Γ(σ ,ξ ) and γ(σ ,ξ ) are the incomplete upper and lower gamma functions Since depumping is neglected the photon counts of the dark states correspond to the background, i.e. ξ D = ξ ∞ . The depumping changes only the dark state and is again included by weighting the probability distributions with an exponential decay w(t) again The first term describes the case in which a depumping event took place during the detection time τ. This effectively changes the mean value of the Poissonian photon distribution tō [27]. The second term accounts for the case where only background counts are measured, i.e. the depumping took place after the detection. The expression can be further simplified to with the definitions β = (ξ B −ξ ∞ ) · T /τ and α = 1 − 1 β . In Figure 3 (a), the average detection error for the threshold technique is shown as a function of the detection time τ and the threshold σ . An increase in the detection time leads to smaller errors for the bright state, but the probability of a depumping event increases, resulting in larger errors for the dark state detection. On the other hand, a higher threshold decreases the dark state error, but larger parts of the bright state photon distribution are wrongly assigned to the dark state. For this reason, there is an optimum detection time for each chosen threshold which minimizes the threshold detection error.
Among the main error sources of the threshold technique is the fact that the bright and dark state photon distributions overlap. We find that replacing the chosen threshold by an interval (σ − δ , σ + δ ) which excludes all detection events in the overlapping region does not solve this issue. Instead, in this scenario, the distributions are truncated asymmetrically, especially with an average low number of detected photons, leading to a bias in the assigned state of the ion (see also Section 3.4).

Distribution-Fit Detection
In this detection method, the full distribution of the photon histograms of both bright and dark states are taken into account for state discrimination. Prior to the experiments, two calibration photon histograms are taken: one where the ion is prepared in the | ↓ state by means of optical pumping (p c (k|ξ B )) and a second one where the resonant Doppler-cooling laser is either switched off or the ion is released from the trap and only background counts are observed (p c (k|ξ ∞ )) [20]. Here, p c (k|ξ ) corresponds to the calibrated probability distribution of measuring k photons given an average number of photons ofξ . The bright state amplitude a is then determined by a least-square fit to a superposition of both distributions The expected detection error of this distribution-fit detection can be determined by Monte-Carlo simulations and is shown in Figure 4 as a function of the number of total detection events. As postulated by the law of large numbers, the error decreases with the squareroot of the number of experiments. For our experimental parameters of typical 300-1000 experiments, a value of 2-4% is expected, which is consistent with the standard deviation of the measurement result using the distribution-fit technique.  While the predicted error under the assumption of our typical experimental parameters is smaller than the error of the threshold detection, a sufficient number of measurements is required to fit the photon distributions. This detection method does not provide single-shot results.

π-Detection
In order to overcome the described limitations of the previous methods, two detection events which use the threshold technique are combined with an intermediate spin-flip and anticorrelations of both detection results are analyzed. The detection pulse sequence is shown in Figure 5 (a). If both events yield the same state result, the detection is identified as false and discarded. For instance, assume the ion is in the bright state before detection, but is assigned to the dark state since the number of detected photons is below the threshold. The spin-flip brings the ion into the dark state where it is detected for a second time. If this measurement (correctly) yields a dark state again, the whole detection process is discarded, since a false detection was recognized. Thus, the π-detection method effectively acts as a statistical filter for the measured data.
The detection error for this scheme is determined by combining the errors of two threshold detection events and a finite fidelity of the intermediate spin-flip of 1 − ε rf , while neglecting discarded events. All possible paths of the whole detection process are shown in Figure 6, assuming that the ion is initially in the dark state. The decision tree for the bright state is similar. Summing over all possible events yields for the dark state error including depumping effects On the other hand, if the ion is initially in the bright state, the error is given by The advantage of this method is that two small probabilities are multiplied, yielding an overall smaller error than the pure threshold detection method. In Figure 3 (b), the average detection error of bright and dark states as a function of the chosen threshold σ and the detection time τ is shown. While the error is almost an order of magnitude smaller than for the threshold technique and tends to zero for very small detection times, it should be noted that this is at the expense of the usable data, also shown in the figure. For this calculation, the intermediate radio-frequency transition was assumed to have a fidelity of 98%, which is a conservative lower bound of the actual fidelity [28]. If necessary, the implementation of different, more robust techniques that are independent of the area of the radio-frequency pulse, such as rapid adiabatic fast passage [29] or STIRAP [30] can improve the fidelity even further. While the post-selective analysis for the π-detection method reduces the detection error by discarding all photon counting events in the overlapping region of the histograms, events which undergo depumping during detection introduce a remaining bias in the resulting state amplitude. This type of error is already taken into account in the above calculation, but shall be analysed here in more detail. As described in Section 3.2, an asymmetric discarding of events with respect to both the bright and the dark states will introduce a bias towards the state with less discarded events. This bias is thus readily determined by comparing the difference in the probabilities of correctly detecting either the bright or the dark state. Neglecting the infidelity of the interleaved spin-flip, it reads In the case of the π-detection, a sum over all possible correct detection events yields for the bias Both biases b th and b π are plotted in Figure 7 as a function of the decay time T . Evidently, the threshold method introduces a systematic bias to the measurement result. The bias is shifted towards the dark state with increasing decay time and levels at approximately 20 % for T → ∞, for the parameters described previously. In contrast to that, the π-detection method operates at a smaller bias and culminates in a bias-free detection for systems with large decay times. This is a result of the symmetric approach of comparing two consecutive and inverted detection events. The decay time of the 25 Mg + qubit system being approximately T ≈ 60 µs, the πdetection method is estimated to have a bias of −5.2 %, whereas the bias of the conventional threshold method is estimated to be 13.1 %.

Bayesian and π-Bayesian Detections
In the previously discussed methods, the collected number of photons integrated over the detection time τ was considered. This neglects all information which could be gained from ) £s x ¥ Figure 6. Decision tree for π-detection. Assuming the ion to be initially in the dark state, all possible paths of both detection events with their corresponding probabilities are shown. Also included is a possible error in the spin-flip by assuming a finite fidelity of 1 − ε rf for a successful inversion. The first branches are marked for clarity: I) Off-resonant excitation II) Threshold detection III) Spin-flip. Circles correspond to the actual state of the ion, whereas rectangular boxes denote the detection result (1 for the bright and 0 for the dark state). The color coding distinguishes between correct detection events (green), discarded events (yellow) and detection errors (red). the arrival times of the photons. This information can be included by dividing the detection interval into N sub-intervals of length t s . The state of the ion is then inferred from the timeresolved series of detected photons {ξ i }, where i = 1, . . ., N. The likelihoods p({ξ i }|B,D) of observing a particular series of photons given that the ion is in either bright (B) or dark states (D) are calculated and the ion is assigned to the state with the highest likelihood [13,21].
The likelihood of the photon series originating from the bright state is given by In case of the dark state, it reads where it was assumed that depumping events only happen at the end of a sub-interval. The detection error is determined by Bayes' theorem, i.e. the probability that the bright state is wrongly deduced to be dark reads [13] p B Bay, err = 1 − p( and vice versa for the dark state. This can be used to determine the detection error in real time and stop the measurement as soon as the desired error level is reached [21]. In an identical way as for the threshold detection method, the Bayesian detection can be extended to a π-Bayesian detection, as shown in Figure 5 (b). Here, two detection events which use the maximum likelihood to determine the state of the ion are combined with an intermediate spin-flip. This again serves as a statistical filter and discards correlated events. The detection error is similarly calculated. For instance, while neglecting the imperfect fidelity of the spin-flip, the error of the bright state detection reads In Figure 8 (a), calculations of the average detection error ε th, π of both the threshold and π-detection are shown in comparison as a function of the detection time, illustrating the effect of depumping on the detection error. While there is an optimal point for the threshold technique due to an increase in error from depumping for longer detection times, the πdetection yields smaller single-shot errors at the expense of the number of used events, as shown by the dashed blue curve. Consequently, the statistical error which results from the quantum projection noise increases as the number of used events decreases [31]. This is shown by the plotting the 95% confidence interval ε th, π ± 1.96 a(1 − a)/n (shaded areas in the plots), where a represents the bright state amplitude, similar to Eq. 11. The number of experiments is n = 1000 for the threshold technique and is scaled by the percentage of used events for the π-techniques. Furthermore, we use a = 0.5 as a conservative estimate, owing to the maximal quantum projection noise if the ion is in an equal superposition of bright and dark state.
Although the π-detection discards many events, the resulting statistical spread still yields a smaller overall detection error than the threshold technique. Nevertheless, it should be noted that applying the π-detection in a quantum algorithm with several consecutive detection steps, the algorithmic sequence needs to be repeated in case of a single inconclusive result. It is worthwhile mentioning that the non-zero single-shot error of the threshold technique leads to a bias that fundamentally does not average to zero, whereas the statistical uncertainty can be improved by increasing the number of measurements.
The same holds for the Bayesian techniques. In Figure 8 (b), Monte-Carlo simulations of both Bayesian and π-Bayesian technique are shown in comparison. The threshold technique yields similar results to the Bayesian method for short detection times. The observation of the photon series only improves for detection times longer than 20 µs. Applying the π-method to the Bayesian scheme additionally decreases the detection error for short detection times at the expense of the used events.
Choosing an optimal threshold for each detection time for both threshold and π-detection decreases the error for both methods further. Although smaller single-shot errors are achieved for longer detection times with an optimal threshold, there is a trade off by discarding more events with the π-technique.

Robustness and Sensitivity of Detection Schemes
A major difference among the detection methods is their sensitivity to the chosen threshold and to fluctuations in the atomic scattering rate from technical noise. While the Bayesian and distribution-fit detection methods are inherently threshold free, the threshold and π-detection schemes may be affected by choosing the wrong threshold. This is discussed in detail in Appendix A.
Fluctuations of experimental parameters, such as the power and frequency of the employed detection laser or the strength of the external magnetic field, are a major experimental challenge since they change the fluorescence rate of the atom and introduce further errors into the measurement process. Thus, it is highly desirable to aim for robust detection methods. Here, sensitivity with respect to power fluctuations was measured for the different detection techniques.
In order to simulate power fluctuations, the ion was initialized in an equal superposition of the |↓ and |↑ states by means of a π/2 radio-frequency pulse. The power of the detection laser was scanned over ±5 dB around its optimal value of 0 dB (corresponding to saturation intensity), as shown in Figure 9. At each point, 3 × 250 measurements were taken. Since a change in laser power alters the photon distributions, one expects the detection methods that depend on the threshold to be especially sensitive towards power changes. This is confirmed in the experiment. While the threshold, distribution-fit and Bayesian techniques tend to over-and underestimate the actual | ↓ population of the ion by 30%, both π-detection techniques show no significant dependency on power fluctuations, since wrongly assigned events are systematically discarded. Given a typical detection time of 10 µs, the Bayesian and the threshold techniques yield comparable results, which is consistent with the fact that their individually expected error is similar, as shown in Figure 8 (b). Additionally, the expected statistical error due to the finite number of measurements, similarly to Figure 8, is indicated by the shaded areas. A linear fit to the interval between -1 dB and +1 dB yields the following changes of the amplitude for the different techniques: (a) threshold technique: 0.032 ± 0.011/dB, (b) π-detection: −0.009 ± 0.016/dB and (c) distribution-fit technique: 0.037 ± 0.015/dB.
It is important to stress that the systematic bias found in the conventional detection methods dominates the overall error in comparison to the statistical error. Although the statistical error can be decreased by obtaining more measurements, the systematic bias is only corrected in the π-detection methods.

Conclusion
We demonstrated a novel qubit detection technique which combines two detection events with an intermediate state inversion. The expected anti-correlation of both detection events is used in a post-selective statistical filtering. As a consequence, a higher detection fidelity is achieved at the expense of the number of usable events. Although this results in an increase of the statistical error due to quantum projection noise, the systematic bias error Figure 9. Robustness with respect to power fluctuations for all detection methods. The ion is initialized in an equal superposition of bright and dark states and the nominal detection power is 0 dB, corresponding to the saturation intensity. Detection methods that depend on the threshold experience large systematic deviations from the initial state result. Both π-detection techniques are almost independent of the laser power at the expense of usable events. Shaded areas depict the statistical error as in Figure 8. The detection time for the threshold detection and both threshold events of the π-detection was τ = 10 µs. In the case of the Bayesian detections five sub-bins with a length t s = 2 µs were used.
of the conventional threshold technique is in comparison significantly larger and does not average to zero. We compared the π-detection to other methods in terms of their sensitivity to fluctuations of experimental parameters. In particular, the π-detection method shows no significant dependence on the detection time, the chosen threshold or power fluctuations of the detection laser, which makes it a rather robust experimental tool. Furthermore, especially in a regime of low photon count rate, the overlap of the photon histograms for bright and dark state imposes a limitation on the achievable contrast of Rabi oscillations to the conventional threshold technique, whereas almost full contrast is observed using the π-detection (see Appendix A).
Another advantage of this method is its simplicity, requiring only an rf-induced state inversion for qubits encoded in hyperfine ground states. This technique applied to optically encoded qubits would require a narrow-bandwidth laser for coherent manipulation, which is often available in ion trap quantum computing and precision spectroscopy experiments.
The π-detection method could also be applied to multiple qubit systems where the qubits are individually accessible for detection, as e.g. in ion traps where multiple ions are spatially resolved [32]. Furthermore, the concept of this detection scheme is very general and can be applied to a multitude of systems for which non-destructive detection methods can be implemented, such as neutral atoms in deep optical lattices [33,34], measurements of the state-dependent reflection and transmission signals of molecules or atoms in cavities [22,23], and nitrogen vacancy centers [35,36].

Acknowledgments
We would like to thank Rainer Blatt for generous loan of equipment and support. We further acknowledge the technical support of P.-C. Carstens and S. Klitzing. We gratefully acknowledge financial support by the Austrian START program of the Austrian Ministry of Education and Science, the Cluster of Excellence QUEST, Hannover, and the Physikalisch-Technische Bundesanstalt, Braunschweig. We would like to thank D Leibfried for helpful comments on the manuscript.

Appendix A. Threshold Sensitivity
We investigated the sensitivity of the detection methods to the threshold by observing the contrast of radio-frequency induced Rabi oscillations. Figure A1 shows a single experimental data set analyzed with different detection techniques. In subplot (a), Rabi oscillations are shown for the threshold and the distribution-fit method for a threshold of 1 photon. Clearly, the contrast resulting from the threshold technique is degraded, owing to the non-optimal threshold; subplot (b) depicts the analysis of the data with the π-detection compared to the threshold method for the same threshold of 1 photon. The π-detection yields almost unity contrast by discarding over 50% of the events. These correspond to the events that were wrongly assigned to the dark state by the threshold method. This effect can be understood by considering the amount of statistics used by the π-detection. Neglecting the fidelity of the radio-frequency and the depumping effect for simplicity, the percentage of used statistics is given by In a regime where the threshold is so high that the error of the dark state detection is negligible, the remaining statistics correspond to p π, stat ≈ 1 − p(ξ B ≤ σ ). On the other hand, applying the threshold technique in this regime, the amplitude of the Rabi oscillations is determined by the error of the bright detection, i.e. A th = p π, stat which is confirmed by the measurements in Figure  A1 (b). Similarly, the π-Bayesian detection filters correlated events and yields an almost unity contrast as opposed to the pure Bayesian detection. Both are depicted in Figure A1 (c). In subplot (d), the dependence of all methods is summarized by plotting the fitted contrast of the Rabi oscillations as a function of the threshold. While the distribution and both Bayesian techniques are fundamentally threshold free, the threshold method experiences a strong decrease of the contrast with increasing threshold. On the other hand, the π-detection discards many events and the resulting contrast is almost independent of the threshold.