Deterministic preparation of superpositions of vacuum plus one photon by adaptive homodyne detection: experimental considerations

The preparation stage of optical qubits is an essential task in all the experimental setups employed for the test and demonstration of Quantum Optics principles. We consider a deterministic protocol for the preparation of qubits as a superposition of vacuum and one photon number states, which has the advantage to reduce the amount of resources required via phase-sensitive measurements using a local oscillator ('dyne detection'). We investigate the performances of the protocol using different phase measurement schemes: homodyne, heterodyne, and adaptive dyne detection (involving a feedback loop). First, we define a suitable figure of merit for the prepared state and we obtain an analytical expression for that in terms of the phase measurement considered. Further, we study limitations that the phase measurement can exhibit, such as delay or limited resources in the feedback strategy. Finally, we evaluate the figure of merit of the protocol for different mode-shapes handily available in an experimental setup. We show that even in the presence of such limitations simple feedback algorithms can perform surprisingly well, outperforming the protocols when simple homodyne or heterodyne schemes are employed.


I. INTRODUCTION
Technologies based on quantum effects have been shown to exhibit advantages over their classical counterparts in a variety of settings including quantum communications e.g. [1,2], quantum information processing e.g. [3] and quantum metrology [4]. Optics is a natural physical system for many quantum technologies and the advent of Linear Optics Quantum Computation (LOQC) [5] has made quantum optics an effective platform for many demonstrations of fundamental quantum information processing tasks e.g. [6,7].
LOQC involves the propagation of optical quantum bits (qubits) through a network of linear optical elements, with photon counting at certain locations in the quantum network being used to achieve non-linear operations [8]. LOQC is inherently non-deterministic, and so the consumption of quantum resources is a critical issue in LOQC systems [9].
A number of proposals for ways to encode optical qubits have been made, most of which fall into two main categoriessingle rail logic or dual rail logic. In the former, a single-mode system is used, and the qubit is encoded as superposition of the single mode n-photon Fock states |0 L = |0 and |1 L = |1 . In the latter, a twomode system is used, and the qubit is encoded as superposition of the logic mode |0 L = |0 |1 and |1 L = |1 |0 , with |n |m the tensor product between the two singlemode Fock states.
To date, many important experimental demonstrations of optical quantum information processing concepts have been made with dual-rail systems using for example polarisation modes [6,7], spatial modes [10] or "time-bin" modes [11]. Single-rail implementations of LOQC are of fundamental interest because of the different, and potentially less resource-intensive, ways in which errors occur and are corrected [12]. However, single-rail LOQC is yet to be actively explored in an experimental setting because of the relative experimental difficulty associated with producing single-rail superposition states compared to dual rail schemes. The original proposals [12,13] and pioneering demonstration-of-principle experiments [14] to prepare single-rail qubits considered non-deterministic single qubit gates. But, by virtue of being non-deterministic, those protocols required many resources and had low probability of success. Instead, in [15] it was shown that adding dyne detection and feedback makes it possible to prepare an arbitrary single-rail qubit via a deterministic protocol, thereby reducing dramatically the resource consumption and making single-rail LOQC an important quantum information architecture to explore.
In this paper, we study the deterministic protocol for the preparation of a qubit in single rail encoding in more detail from the experimental perspective. We first define a figure of merit for the protocol and then investigate how various simplified versions of the protocol perform. We show that simple feedback algorithms can perform surprisingly well, even in the presence of time-delays in the feedback loop.
The paper is arranged as follows. We define fidelity as the figure of merit for phase measurement in Section II and then show how to calculate that figure of merit for dyne measurements in Section III. We then present an analytically calculable approximation to the fidelity in Section IV and show how to calculate that approximate 50:50 To begin, we recapitulate the protocol presented in [15] for the deterministic preparation of an arbitrary pure qubit state within the single rail photonic encoding (see Fig. 1). Consider for the moment the preparation of the equal superposition state, i.e.
Assuming we can generate a single photon deterministically, we can send this through a 50:50 beam splitter, generating two out-coming entangled modes in the state where the subscripts 1, 2 indicates the output ports of the beam splitter. Suppose that on the first mode we perform a canonical phase measurement described by the POM which is normalized according to where the identity1 is restricted to the subspace of interest, spanned by {|0 1 , |1 1 }. As a result of the measurement, we obtain the outcome θ, drawn randomly with a uniform probability distribution in the range [0, 2π). After this measurement, the quantum state on the other mode collapses to Then, by using classical feed-forward from the phase measurement, we can undo the random phase θ + π by passing the state through a phase modulator to create (1). This protocol is easily generalizable to arbitrary qubit states. We can prepare non-equal superpositions by employing a beam splitter with intensity reflectivity η, to get at the output of the beam splitter the quantum state Again, measuring the first mode with a canonical phase measurement, we can correct the phase on the second mode, and apply any desired additional phase ϕ, to obtain B. Non-ideal phase measurement It is not easy in optics to implement the canonical POM (3), as we will investigate. The problem of efficiency is an obvious one, but this is simply equivalent to loss, and so can be incorporated into the final analysis by applying loss to the state. A more interesting problem is how to project onto the state |θ , with its equal superposition of |0 and |1 . This equal superposition is essential for ensuring that all outcomes lead to a state that is only a phase shift away from the desired qubit state. More generally, an optical measurement will involve projecting onto an unnormalized state where R ∈ C. The POM describing such a measurement isÊ where ℘ ost (R) is a positive, normalized distribution satisfying This ensures that the POM obeys the completeness relation as required. The notation ℘ ost (R) is because we call this an ostensible probability distribution for R [16]. The actual probability distribution for R is, for an input state |Ψ , ℘ (R) = Tr |Ψ Ψ|Ê(R) = ℘ ost (R) Ψ|R R|Ψ . (12) As we will see, the properties of ℘ ost are critical to the performance of the protocol. Given the result R, the best estimate of the phase is always Thus, the POM for this phase measurement iŝ where Clearly, F is a figure of merit expressing how close the measurement is to canonical. It is also directly related to the fidelity of the qubit preparation protocol above. Considering the 50:50 case for simplicity, and defining This has a purity of Tr (ρ 2 ) 2 = (1 + F 2 )/2 and a fidelity with the desired state of ψ|ρ 2 |ψ = (1 + F )/2. Thus we can use (15) as figure of merit to evaluate the protocol.

III. PHASE MEASUREMENT BY DYNE DETECTION
The non-ideal phase measurement for single rail qubits described in the preceding section can be applied to all forms of "dyne" [17,18] detection schemes: homodyne, heterodyne, or adaptive dyne detection. Following [18], we can describe all of them in the same framework of the quantum trajectories (see Fig. 2).
Consider a single optical mode with mode-shape u(t), u(t) ≥ 0 (shortened later as u t ), for t ∈ R, such that Coming out from the first port of the beam splitter, the optical mode |ψ 1 is mixed through a balanced beam In the case of adaptive phase measurement, the phase of the local oscillator is adjusted during the measurement with the gain λ(t).
splitter with a mode-matched local oscillator (LO) with phase Φ(t) (shortened to Φ t ). In the limit of a large LO amplitude, all of the information is contained in the difference J(t) between the photocurrents detected at each output port of the beam splitter. We will normalize this so that for a vacuum input (|ψ 1 = |0 ), where this denotes a Wiener increment satisfying Not only does Eq. 19 describe the photocurrent statistics for a vacuum input, it also defines the ostensible statistics for an arbitrary qubit state. That is, it is the appropriate equation to use to define the ostensible distribution ℘ ost (R) introduced above. As we have seen, the properties of ℘ ost (R) are all that are needed to define the quality of the preparation. The relation between J(t) and R is [15,17,19] Note that the LO phase Φ(t) is completely arbitrary, and may even be made dependent upon the measurement record up to time t, J t = {J(s) : s ≤ t}. This makes the measurement adaptive and allows for better phase estimation than is otherwise possible [17,19].
In the following, we use the notation ξ(t) instead of J(t), for calculating ostensible probabilities, with ξ(t)dt equal to the Wiener increment dW (t). Then the figure of merit is where for adaptive detection Φ(t) will depend upon ξ t = {ξ(s) : s ≤ t}.

A. Homodyne measurement
In the homodyne detection, the LO phase Φ(t) is constant in time, i.e. Φ(t) = Φ 0 . In this case, the definitions of R becomes This is a real Gaussian random variable with zero mean and hence, as required by Eq. (10), unit variance. Therefore, the ostensible distribution for X is and we can calculate

B. Heterodyne measurement
In the heterodyne detection, the LO is detuned, i.e. outside the bandwidth of the optical mode. That is, the phase Φ(t) is linearly increasing in time at a rate This is a complex Gaussian random variable with zero mean and in the limit of ∆ → ∞ gives a rotationally symmetric variable A with From this, we can evaluate showing that heterodyne results in a better phase measurement than homodyne.

C. Adaptive measurement
To do even better than heterodyne detection it is necessary to implement adaptive dyne detection. In particular, Ref. [20] introduced the following adaptive algorithm: This gives the stochastic differential equation for R t and the deterministic differential equation for |R t | 2 Solving this, we get R(t) = e iθ(t) , with The ostensible statistics for θ = θ(∞) are those of which has a divergent variance because U (−∞) = 0. This means that, as in the heterodyne case, ℘ ost (R) is rotationally invariant. But in this case, since |R| = 1, we have immediately and hence this adaptive dyne protocol realizes the canonical phase measurement.

D. Non-optimal adaptive measurement
The adaptive algorithm (31) gives the optimal expression (38) to use in the feedback loop for our qubit preparation protocol. Remembering that Eq. (34) is equal to arg(R t ), Eq. (31) can be re-expressed as integral feedback with the time-dependent gain A time-dependent gain in the feedback loop is difficult to implement experimentally, and a divergent gain (as required for most mode-shapes when the pulse first turns on) is impossible to implement experimentally. Also, Eq. (31) assumes zero time delay in the feedback loop, which is unrealistic. These considerations motivates the focus of the remainder of this paper, which is to consider a feedback protocol of the form for a gain function λ subject to some physical restrictions.
In the absence of delay, applying the feedback (31), we can attain F = 1. In presence of the delay the optimal gain λ(t) to apply for the feedback is not known. Indeed, it is likely that the optimal feedback in this case cannot be written in the form (39), and instead some more complex algorithm would be optimal. However, the expression (39) still allows for a great deal of flexibility, even when choosing λ(s) from a restricted class of functions, as we will find in Sec. VI.
With such a general expression as Eq. (39) there will no longer be any simple expressions for the ostensible statistics of R t . Instead, one has to evaluate the moments of the stochastic integral with Φ(t) given by We will see in the next Section how to develop an approximation for F from the ostensible moments of R.

IV. APPROXIMATE FIGURE OF MERIT
In this section, we develop an approximation,F , for the figure of merit F . Due to the non-analytic nature of |R| as function of R, we cannot calculate exactly F even given an expression for R. However, since we are interested in the limit of good phase measurements, |R| ost ≈ 1, we can approximate R to its second order in a Taylor series about R = 1 to get where we have used Eq. (10). Thus we define our new figure of meritF Here, and in the remainder of this paper, we have dropped the 'ost' subscript on the average, since all averages we will be considering are ostensible averages.  Before determiningF for non-ideal adaptive dyne measurement, we first apply the approximation (44) to the cases where we have already evaluated F = |R| , in order to test the validity of the approximation. In the case of homodyne detection, we have, from Eq. (26), |X| 4 = 3, and hence For the heterodyne measurement, we obtain |A| 4 = 2 from Eq. (29), and hence Finally, in the case of ideal adaptive dyne detection we get |R| = 1 deterministically, and hence we get exactly Comparing the exact values (27) and (30) with the approximations (46) and (47), we find a good agreement, as shown in Table I. In the remainder of the paper we useF , rather than F , to compare the different schemes.

V. DERIVINGF FOR ADAPTIVE DYNE DETECTION
We derive a general expression forF as functional of the gain λ(t) and the pulse shape u(t), first for zero delay, τ = 0, and then for τ > 0.

A. Zero delay
Consider for simplicity a rectangular pulse shape, which is zero everywhere except so that we can restrict the integrals to the domain [0, 1]. By the definition of (40), we have where Note that x must vanish since |R| 2 = 1. In terms of x, our new figure of merit (45) is thus The integrand function cos(Φ t − Φ s ), as well as others that follow, depends on the stochastic process that is non-anticipating in t, but correlated with dW (v), v ∈ [s, t). The increment ξ t is hence uncorrelated from the other integrand function, allowing one to factor the expectation by the stochastic Itō calculus. As noted above, this result is necessary, so we have the first check on the consistency of our approach.
The term x 2 is On the range of integration where t = v, ξ t and ξ v are uncorrelated, the expectation factorizes, and hence these regions do not contribute to the integral. Equation (58) thus reduces to By again splitting the range of integration [0, t) × [0, t) in the variables ds, dz into three regions, i.e. s = z, s < z and s > z, and then using the symmetry of the integrand on the regions s < z and s > z, we obtain two terms: (60) The functions cos 2 (Φ t −Φ s ), cos(Φ t −Φ s ) and cos(Φ t − Φ z ) are not uncorrelated with ξ s and ξ z . However, we can apply the following general rule (see Appendix A) where F is an arbitrary functional of ξ, to get for the term (59) Finally, we can calculate the integrand function using their Taylor series and the moments for a Gaussian stochastic process of mean 0 and standard deviation σ, to obtain Altogether, the final expression for (54) is The second expression here is the generalization for an arbitrary mode-shape u(t).
If we substitute the optimal adaptive gain λ opt (t) of (38), the two integral terms in expression (71) cancel identically, givingF = 1 as it should be. Given how complicated (71) is, this is a powerful check on its correctness.

B. Non-zero delay
In this section we generalize (71) for a delay τ in the feedback scheme, by defining (73) As before, the term x vanishes, while after some algebra the term x 2 becomes The three terms in the integral comes from splitting the range of integration opportunely, in order to identify regions where only a few of the stochastic process Φ t − Φ t−∆ , Φ t − Φ t−∆−δ , ξ t−∆ , ξ t−δ are correlated. Then, we use the rule (61) to get rid of the ξ t−∆ , ξ t−δ . Finally, we resolve the expectation employing (68), to obtain (75).
As check, the limit for τ → 0 returns the expression (71).

VI. EVALUATING AND OPTIMIZINGF
We now evaluateF as a function of τ , for four different mode-shapes (see Sec. VI A), with two different types of gain. The simplest assumption is constant gain, which we consider in Sec. VI B. As one step (and two parameters) beyond constant gain we then consider piecewiseconstant gain, with a single discontinuity, in Sec. VI C. While this feature (a discontinuity in the gain) is not particularly realistic, we expect the results for that section to give a reasonable idea of how much improvement may be gained by the most basic improvements over the simplest case of constant gain.

A. Modeshapes
In order to test the performances of the protocol against the delay, we consider four different mode-shapes: rectangular shape bilateral exponential shape falling unilateral exponential shape rising unilateral exponential shape Some of these mode-shapes arise naturally in an experimental setup. The rectangular mode-shapes can easily be obtained to a very good approximation with weak coherent light, which could be used to test phase measurements at a single-photon level. The bilateral modeshape appears with a single signal photon coming from spontaneous parametric down conversion (SPDC), conditioned on a click in the idler mode at time t = 0. The falling unilateral exponential shape is the mode of a photon from an initially excited atom. It is less obvious how the risingunilateral exponential shape might be obtained experimentally, but has a very nice theoretical property as will be explained below.
When we introduce a delay τ , we want to compare what effect it has on schemes using these four different mode-shapes. To make a fair comparison we need the characteristic times of these pulses to be the same. Since all but one of the above mode-shapes do not have compact support, we cannot simply use the pulse duration. Instead, we adopt the following measure of characteristic duration: For the four mode-shapes above, this evaluates respectively to 1, 4 κ , 2 k , and 2 k . Thus we normalize these all to have w = 1 by setting κ = 4 and k = 2.

B. Constant gain
We first consider the case λ(s) = λ. We substitute the various mode-shapes into Eq. (74), in order to obtain analytical expressions forF . These expressions (which are lengthy and not very informative) are reported in Appendix B. We then numerically optimize over λ. The results are shown in Fig. 3, along with the performance of heterodyne detection (the best non-adaptive scheme).
For all the mode-shapes, adaptive measurement outperforms heterodyne detection at zero delay, but the performances decrease monotonically with delay, as expected. The rising exponential mode-shape (79) outperforms all other modes. In fact, for τ = 0, this modeshape yields a perfect phase measurement for constant gain. This can be verified analytically, as the optimal solution of (38) is λ = 4 √ 2/κ for this mode-shape. The bilateral exponential is second-best, which is heartening for experiments based upon SPDC. The order in terms ofF at τ = 0 is preserved for τ > 0, and the rising exponential mode-shape is particularly robust to delay, with constant gain feedback still showing an improvement over heterodyne detection for τ as large as 1/3 of the characteristic pulse time.
In Fig. 4, the values of constant gain employed in the feedback are plotted with respect to the delay, for the different mode-shapes. A common trend can be identified: as the delay increases the optimal λ decreases. Also, the size of the optimal gain is, for the most part, inversely related to the effectivenessF of the phase measurement.

C. Piecewise constant gain
The results above were obtained under the assumption of constant gain. This is the simplest model to consider, having only a single parameter to optimize over. It is natural to ask how much improvement is possible with a slightly more complicated model, as this will give a guide to what might be expected with even more careful tailoring of the feedback algorithm. This motivates considering a piecewise constant gain λ(t), with three parameters: Again, we find the analytical expression forF for the four different mode-shapes by substituting the feedback (81) into Eq. (71). The analytical expression forF are not reported here due to their length and complexity. Next, we optimize over the values λ 1 , λ 2 and t 1 .
In Fig. 5 the performances of the phase measurement with the optimized feedback are plotted in continuous lines, while in dashed lines the previous performances with constant gains are reported. We can see quite substantial improvements for the bilateral, rectangular and falling unilateral exponential mode-shapes, although the improvement lessens for longer delays. The opposite is true for the rising exponential mode-shape, as expected since constant gain is optimal at τ = 0 for this case. In Fig. 6 the family of the optimized piecewise constant feedback λ(t) are plotted, as a function of the delay τ . In each figure, black stripes has been plotted parallel to the time (t) axis, to indicate the shape of the function λ(t) corresponding to a specific parameter τ . In all cases except the rising unilateral exponential, λ(t) decreases with time; that is, λ 1 ≥ λ 2 . In the case of the rectangular and bilateral exponential shapes (Figs. 6a and 6b respectively), λ 2 and t 1 shows almost no dependence, while λ 1 decreases with the delay. A similar behavior is exhibited in Fig. 6c for the falling unilateral exponential, with a little dependance of t 1 on the delay. By contrast, in the case of the rising unilateral exponential shape, Fig. 6d, λ(t) increases with time; that is, λ 1 ≤ λ 2 . As the delay increases λ 1 and t 1 decrease, while λ 2 initially decreases but then increases. Fig. 7 shows the same data as Fig.  6d, plotted as λ 1 , λ 2 and t 1 versus τ for clarity.

VII. CONCLUSION
It has previously been shown possible to use adaptive homodyne detection to deterministically prepare an arbitrary single-rail qubit. The protocol take advantage of the result that a phase measurement on one half of a entangled state will collapse the other half into a known state, whose phase can be corrected if required. In this paper, we have studied that idea in detail from the experimental perspective. We have defined a figure of merit for the adaptive homodyne state-preparation protocol and then investigated how various versions of the protocol perform. In deriving an analytically calculable version of the figure of merit, we have made use of a useful formula (see Appendix A) that we have not been able to find elsewhere and which could be useful for others seeking to evaluate stochastic integrals.
We have shown that ideal implementations of the protocol require the use of time-dependent gain in a realtime feedback loop in general. Unfortunately a timedependent gain in the feedback loop is difficult to implement experimentally, and a divergent gain -as required for most mode-shapes when the single photon pulse first turns on -is impossible to implement experimentally. Also the ideal feedback algorithm assumes zero time delay in the feedback loop, which is unrealistic in general and particularly unrealistic in situations requiring implementation of complex, time-dependent feedback gain. Therefore much of the paper was focused analysing the performance non-ideal, but experimentally feasible feedback algorithms in the adaptive homodyne state-preparation protocol. In particular, we considered the performance of time-delayed constant or piecewiseconstant feedback applied to a variety of different singlephoton input wave-packets. We have shown that these simple feedback algorithms can perform surprisingly well, thereby lending weight to the experimental viability of this scheme as a protocol for deterministically producing single-rail optical qubits. Dynamics at Griffith University, where part of this work was performed.
Dividing time into discrete intervals of duration ∆t, as in the Itō calculus, the functional F becomes a multivariate function of the Wiener increments at different time: F = F (∆W −∞ , . . . ∆W k−1 , ∆W k , ∆W k+1 , . . . ∆W ∞ ). (A3) Here ∆W k = W (t k+1 )−W (t k ), where t k+1 = t k +∆t. By a Taylor expansion with respect to ∆W k , it is clear from the independence of the different Wiener increments that The last step is because the difference between any functional with ∆W k = 0 and with it not is of order of √ ∆t. The rule (A2) comes by taking the continuum limit.

Appendix B: Constant gain Expressions
In this appendix we report the analytical expressions evaluated from Eq. (71) employing a constant gain feedback and the mode shapes introduced in Section VI A. These closed form solutions of the term x 2 of Eq. (54) allow to easily set up a numerical optimization of the feedback gain and maximize the figure of meritF . The result of the optimization has been discussed in Section VI B and are depicted in Fig. 3 and 4.
In the case of the rectangular mode-shape, we have different expressions depending upon the value of the delay.
We are interested in the range 0 < τ < T /2, since for larger delays the adaptive dyne scheme does not lead to any improvements with respect to the heterodyne measurement. With these assumptions, the term x 2 reduces to expression (B3).