Deterministic entangling gates with nonlinear quantum photonic interferometers

The quantum computing paradigm in photonics currently relies on the multi-port interference in linear optical devices, which is intrinsically based on probabilistic measurements outcome and thus non-deterministic. Devising a fully deterministic, universal, and practically achievable quantum computing platform based on integrated photonic circuits is still an open challenge. Here we propose to exploit weakly nonlinear photonic devices to implement deterministic entangling quantum gates, following the definition of dual rail photonic qubits. It is shown that a universal set of single- and two-qubit gates can be designed by a suitable concatenation of few optical interferometric elements, with optimal fidelities arbitrarily close to 100% theoretically demonstrated through a bound constrained optimization algorithm. The actual realization would require the concatenation of a few tens of elementary operations, as well as on-chip optical nonlinearities that are compatible with some of the existing quantum photonic platforms, as it is finally discussed.


I. INTRODUCTION
Universal quantum computation (QC) can be realized by combining arbitrary single-qubit rotations with two-qubit entangling gates, such as the controlled-NOT (CNOT) quantum gate.So far, there has been a lot of effort to build the theoretical model for a practical universal photonic quantum computer [1][2][3][4] harnessing non-classical interference and only employing linear optical elements, but this only allows to obtain a nondeterministic version of the desired entangling gate [5][6][7], i.e., this quantum gate can be implemented with arbitrarily high fidelity but only with probabilistic outcome.Even though a deterministic CNOT could be implemented, in principle, by exploiting strongly nonlinear optical elements at the level of single photons, [8][9][10][11] there are still considerable difficulties in realizing sufficiently large photon-photon interactions allowing to achieve the so-called "photon blockade" regime [12][13][14][15][16].Even if promising proof-of-concept demonstrations have been shown in solid state cavity QED [17][18][19][20][21][22], and interesting quantum photonic devices might be realized based on these outcomes [23][24][25], the actual possibility of exploiting single-photon nonlinearities for developing universal quantum computation has been debated in the past [26].Alternative proposals to implement deterministic two-qubit quantum gates have been recently put forward in various nonlinear photonic platforms [27][28][29][30][31], but no significant experimental proof-of-principle demonstration has been published, so far.Hence, the question naturally arises if deterministic QC in photonic platforms can be still considered a viable route, e.g., by exploiting basic interferometric elements, as in linear optics quantum computation, combined with weak values of photon nonlinearities.
Following the routes traced in [31], where integrated polariton interferometers were proposed to realize deterministic quantum gates using single-rail encoding, here * francesco.scala01@ateneopv.itwe go much further than the previous work by introducing a novel QC paradigm based on generalized quantum photonic interferometers, which are shown to allow for an efficient implementation of single and two-qubits gates based on dual-rail qubits encoding.The platform requirements can be reduced to a standard planar technology in which propagating single photons interact with realistically achievable degree of nonlinearity when simultaneously present in the same waveguide channel, and freely propagate otherwise.By nontrivially combining a few elementary layers, namely free propagation and hopping regions, we show by numerical optimization that deterministic two-qubit gate fidelities arbitrarily close to 100% can be achieved, despite the moderate values of photon-photon nonlinear coupling.We also notice that our approach does not require expanding the Hilbert space of the system by introducing, e.g., ancillary degrees of freedom [27].Interestingly, it is shown that the optimization algorithms achieve the most successful implementation of two-qubit gates for intermediate values of photon-photon nonlinearity, which is explicitly shown for the paradigmatic cases of CNOT and Mølmer-Sørensen (M-S) [32,33] entangling gates.These can be combined with arbitrary single-qubit rotations on the Bloch sphere (in particular, x− and z−rotations) to implement a universal set of quantum gates, and thus a full QC architecture.Finally, we discuss the practical feasibility of the proposed scheme, by carefully analysing the effects of losses, decoherence, fabrication tolerance of the expected gate fidelity, for which we report extensive results in the Appendix D and E. This result may ultimately open the route to the realization of deterministic quantum photonic computing.

II. RESULTS
A general formalism to analyse quantum photonic interferometers in the presence of photon-photon nonlinearities has been previously introduced [31].There, the formalism was meant to theoretically describe integrated platforms in which exciton-polaritons are the propagat- x Hopping Region(HR) J(x) = J = 0 U paral U f ree U inter U f ree U down U f ree U up U f ree (c) FIG. 1. Deterministic photonic QC elements (a) Qubit logical states obtained with a dual-rail encoding of a pair of photonic channels, in which single-photon Fock states can be injected in each waveguide and measured at the output through single-photon detectors.(b) The hopping process of a single photon between two channels can be viewed as a RX gate (see text).(c) Single block of a two-qubit information processing unit: Multiple repetitions of such an elementary block can be concatenated to obtain the desired two-qubit gate.Hopping regions (HR) (green boxes) depend on two parameters, (Jm, tm), while free propagation (FP) (blue regions) depends only on a single parameter (tm), for a given value of the photon-photon nonlinearity, U .The FP layers within the Uinter, U down , and Uup regions are assumed to have fixed propagation time set by the corresponding HR terms, which is implicitly represented by a simple line in the sketch.
ing elementary excitations, owing to their superior nonlinear properties as compared to standard optoelectronics materials.However, the formalism can be generally transferred to any material platform possessing an intrinsic third-order nonlinearity, which may be suitably enhanced by dielectric confinement and being described by a Kerr-type nonlinear Hamiltonian in second quantization.Hence, in the present work we prefer to keep the theoretical discussion as general as possible and speak about "interacting photons"; we will specifically refer to the potentially targeted platforms in the Discussion section.
The model.The general case of N one-dimensional channels (with corresponding input/output ports) in which quantized photon states propagate at fixed wave vector k, interfere through space-dependent evanescent coupling, and nonlinearly interact when simultaneously present within the same channel can be described by the following Hamiltonian (ℏ = 1, see Appendix A and B for a detailed derivation of this model) with H ≡ H[{ω i }; {U i }; {J ij (x)}].In Eq. ( 1), the parameters ω i ≡ ω i (k) and U i ≡ U i (k) denote the energymomentum dispersion and the Kerr-type nonlinearity in the i-th channel, respectively.The space-dependent parameters {J ij (x)} denote the hopping terms between next neighboring channels, where x identifies the propagation direction in each one-dimensional (1D) waveguide.In particular, photons in the i-th channel are annihilated (created) by bosonic operators In general, the propagation channels might display different features in terms of energy-momentum dispersion as well as photon-photon nonlinearities.For our purposes, we will assume the channels to be identical hereafter.This allows to consider a unique dispersion relation, ω = ω(k), and the same nonlinearity in any propagation channel, U = U i .Generalizations of this scheme are always possible, of course.
N -channels circuits and qubits encoding.When many wave vector components are involved, the characterization of the action of a generic quantum circuit on a given initial many-photon state, ψ I , requires to evolve both in time and space such initial configuration to obtain the final state, ψ F , which contains the QC result.In the present case, where only monochromatic singlephoton states are considered, the description gets simplified.As discussed in Appendix A and B, and following Ref.[31], one obtains that the action of the generic circuit is encoded into a global unitary operator U tot such that with ij }]t m ) denoting the unitary propagator in the m-th spatial region of the circuit, i.e., for x ∈ [x m , x m+1 ], where the inter-channel hoppings can be treated as piecewise constant functions, i.e., J ij (x) = J (m) ij .In particular, the parameter t m , with t m = (x m+1 − x m )/v g , corresponds to the average time spent by photons traveling at group-velocity v g within the m-th sub-region of the circuit.As a final comment, let us stress that we hereby assume dual-rail encoding to implement single photonic qubits, at difference with Ref. [31].By doing so, a 2N -channel circuit fed with N single-photon states can be exploited to represent a N -qubits quantum state.As sketched in Fig. 1a, the two logical qubit states in a 2-channel device, hereby denoted as |0⟩ 2 and |1⟩ 2 , are defined by the two single-photon Fock states of two adjacent channels, |1, 0⟩ and |0, 1⟩ respectively, where the former describes a single propagating photon in the upper channel, while the latter describes a single photon propagating in the lower  12)) (a) and average gate fidelity (see Eq. ( 13)) (b) values for different values of nonlinearity after the optimization of the block structure.Free propagation and interaction times were both fixed to dimensionless values t = 1.(c) The best average gate fidelity is reported as a function of U/Jmax.For each point the number of blocks employed to reach the corresponding best value is also reported; the inset shows a close-up of the convergence towards maximal fidelity for 0.05Jmax ≤ U ≤ 0.5Jmax.
channel.Many-qubits states are straightforwardly obtained by taking the tensor products of the states above in a 2N -channel device.
Single-qubit gates.Elementary rotations of single qubits can be tailored by suitably combining, e.g., rotations around the x-and z-axes.As it is shown in the Appendix B, for N = 2 and in the single photon subspace, by means of the dual rail encoding one can directly map the dynamics of two coupled channels into the action of the RX(θ) rotation gate as multiplied by a global phase factor e −iωt , where σ X represents the Pauli X-matrix.In particular, as reported in Fig. 1b, the rotation angle, θ = 2Jt, depends on the system geometry as well as on the group velocity of the propagating photons.As it will be addressed in the Discussion section, it is reasonable to assume that the simple component depicted in Fig. 1b implements a RX(θ) gate, with tunable rotation angle.The universal gate set for single-qubit operations can be straightforwardly implemented by adding the RZ gate, obtained, e.g., from the addition of a simple phase shifter in one of the two coupled channels [3,34].Two-qubits gates.It is nowadays widely accepted that deterministic two-qubit gates cannot be devised by means of only linear optical components [1,2].Hence, it is reasonable to argue whether or not the usage of nonlinear components in photonic networks, such as those considered in the present work, could eventually help to achieve this goal.Here we report a theoretical analysis that allows to positively answer this question.In fact, we are going to show that the suitable combination of weakly nonlinear components with linear ones actually represents a key ingredient for the development of a universal QC paradigm based on photonic platforms.Nevertheless, to the best of our knowledge, there is no intuitive way to determine a priori which is the optimal arrangement of these elements to deterministically perform a given quantum gate.Therefore, we tackle such a problem by exploiting an inverse design strategy based on a multi-parameter optimization algorithm.In particular, we applied this approach to a class of 4-channel circuits constituted by the concatenation of a finite number of blocks, where each block is defined by combining multiple 2-channels hopping regions with free propagation regions of fixed length, as sketched in Fig. 1c (see Methods for further details on the definition of the single unitaries).Even though several other representations and optimization strategies can be devised, our numerical results suggest that the approach can successfully provide an approximate but highly faithful representation of at least two different entangling gates, namely the controlled-NOT (CNOT) and the Mølmer-Sørensen (M-S).Their matrix representation on the computational basis S = {|00⟩ 2 , |01⟩ 2 , |10⟩ 2 , |11⟩ 2 } is explicitly reported in the Methods section for completeness, in Eqs. ( 4) and (5), respectively.In particular, we show that in both cases it is possible to improve the precision of the representation, which is explicitly quantified by means of the average gate fidelity F , Eq. ( 13), by simply increasing the number of elementary blocks included in the variational ansatz.The optimization procedure is implemented as follows: we first parametrize a set of possible hopping parameters between the different channels, given in a matrix representation of the unitary evolution operator, i.e., the generalized time propagator in Eq. ( 2).Then we analyse the performances when increasing the number of sequentially concatenated blocks of the type represented in Fig. 1c, by letting the algorithmic optimizer to minimize the cost function.Details on the choice of the cost function are reported in Methods.
Optimization of the CNOT gate.In order to quantify the performances of the optimization scheme, we consider the values of the cost function and the average gate fidelity reached by the multi-parameter optimizer once at convergence, see Eqs. ( 12)- (13) in Methods.Numerical Best CNOT matrix Real and imaginary parts of the approximate CNOT matrix with all the possible two-photon input/output states, when using a 20 blocks structure with U = 0.5Jmax, for which we get F (θopt) ≈ 99.95%.Vertical and horizontal black lines divide the logic space from the one based on states that are not in the computational basis.The projection of logic states off the computational space is negligible, as clearly seen from the plot.The zoom highlights the gate matrix in the two-qubit logic space.
results for such quantities in the case of the CNOT gate are shown in Fig. 2a and Fig. 2b respectively .There, we report results for an increasing number of elementary blocks, and for different values of the photon nonlinearity, ranging from zero or very weak to ultra-strong.In order to keep the analysis on a general level, we assume the tunneling rate in each hopping region (the HR units in Fig. 1c) as an independent optimization variable such that 0 ≤ J ≤ J max , with J max = 1 in dimensionless units, and the propagation time in each sector to be a dimensionless parameter, also fixed as t = 1.A discussion of the actual dimensions and physical implementations will be given in the following Section.As it can be noticed at first glance from Fig. 2a, the loss function cannot be minimized for negligible values of the nonlinearity, always displaying values that are significantly larger than zero independently of the number of blocks.This behavior is compatible with the well established knowledge that two-qubit entangling gates cannot be realized only by means of linear (or approximately linear) components [1,2].On the other hand, we find that this conclusion holds true also in the U ≫ J max case, which has to be attributed to the onset of the photon blockade regime between neighboring channels preventing double occupancy of a single channel to a large extent [31].However, rela-tively weak nonlinearities (in particular, ranging between U/J max = 0.05 and 0.5, in normalized units) give rise to a reasonably fast convergence of the optimizer towards minimal cost function values.These numerical results suggest that the entanglement between qubit states in such platforms emerges as the result of the competition between hopping (i.e., Js) and the entity of the nonlinear shifts affecting two-photon states propagating within the same channel (i.e., U ). Indeed, even if the latter are never fed into the device as input states, and they do not belong to the computational basis, their excitation does occur during the time evolution within the circuit, and ultimately affects the computation outcome.Thus, the final output of the 4-channel system is the nontrivial result of the extra phase-shifts accumulated in the presence of such nonlinearities.
In fact, this is further evidenced by plotting the corresponding average gate fidelity as a function of the number of blocks, in Fig. 2b.Interestingly, for nonlinearities in the range 0.05 < U/J max < 0.5 the gate fidelity reaches values close to 100% for a number of elementary blocks in the order of 10, although for the lowest value U/J max = 0.05 convergence gets slower and oscillating (see also close-up in the inset of Fig. 2c).To better visualize this behavior, in Fig. 2c we report the best gate In the inset, the optimal M-S matrix is displayed for U/Jmax = 0.5 and 18 blocks, for which we calculate F (θopt) ≈ 99.95%.
fidelity results as a function of the nonlinearity, where it seems that the optimal nonlinearity value is U = 0.5J max , which allows obtaining a CNOT gate with high fidelity with reasonably compact structures, i.e., 13 elementary blocks are already sufficient to reach an average gate fidelity very close to 100% (see also inset).As an illustration of the actual performances to be expected, the real and imaginary parts of the optimized quantum gate matrix are explicitly shown for the best possible CNOT obtained with our numerical optimization procedure, in Fig. 3 (see upper panels for a close up).The real part seems to perfectly match the CNOT matrix, while the imaginary part is almost irrelevant, thus faithfully reproducing Eq. ( 4).In Fig. 3 we also show the full transfer matrix when taking into account all the possible configurations within the two-photon subspace, which spans, of course, also outside of the logic space of interest (e.g., when two photons simultaneously propagate within the same waveguide channel at the input or output port, respectively).This strongly supports the conclusion that such a gate is deterministic, since no logic state is basically mapped outside the logic space, i.e., with negligibly small amplitude.Interestingly, it should be noted that inside the entangling gate the quantum state can (and must) populate states lying outside the logic space, in order to have the two photons nonlinearly interacting with each other; on the other hand, the output must always be restricted to the logic space for the operation to be defined as deterministic.The optimal parameters found for this structure are fully reported in a dedicated table in the Appendix G, for a straightforward reproduction of our results from the interested reader.
Optimization of the M-S gate.While the optimization of the CNOT gate by concatenating a limited number of elementary operations in a weakly nonlinear quantum photonic interferometric circuit is a relevant result per se, here we also show that a similarly efficient algorithmic optimization is possible for other entangling operations on the two-qubits space.Namely, we focus here on the ideal quantum gate defined in Eq. ( 5), i.e. the Mølmer-Sørensen gate.The related numerical results are summarized in Fig. 4, where it is shown the behavior of the average gate fidelity as a function of the number of blocks for different values of the nonlinearity (Fig. 4a), as well as the best average gate fidelity obtained for the same values of U/J max (Fig. 4b).Similarly to what was observed for the CNOT gate, it is confirmed as a sort of general trend that convergence towards the ideal operation is reached quite fast for values of the nonlinear parameter in the range 0.05J max < U < 0.5J max .This is not the case for negligible or too large nonlinearity values, although the photon blockade for U/J max = 10 seems to have less of a detrimental effect here.A summary of this trend is reported in Fig. 4b.The inset of this panel shows the optimal M-S gate obtained for U/J max = 0.5, which deterministically implements an almost ideal RXX operation when restricting to the computational basis subspace.A plot of such an optimized M-S gate is explicitly reported in the Appendix F. Also in this case, a table reporting the optimal parameters for this structure is given in the Appendix G, for completeness.

III. DISCUSSION
The relevance of the results reported in this work is mainly theoretical.Essentially, we have shown that relatively simple quantum photonic interferometers with weak photon-photon nonlinearities can be optimized to display universal quantum gate operations.However, it is equally relevant to discuss possible physical implementations, and related to that, any possible source of noise, loss, decoherence, fabrication tolerance, which we hereby address at the level of discussion while reporting all the relevant quantitative results in Appendix D and E.
Realization and material platforms.Several quantum photonic platforms have been put forward in the past few years, mostly based on conventional nonlinear materials in passive semiconductors, such as Si, SiN, glass, etc. [34].While the scheme we have presented in this work is general, and can be applied also outside the photonic realm, in principle, here we focus on discussing its realization in nonlinear photonic circuits.First, we notice that single-photon Fock states can be produced at high repetition rates and high purity levels from single quantum emitters [35], as well as detected at the output of the device through highly efficient single-photon detectors [36].In addition, injection of single-photon Fock states generated from quantum emitters into photonic integrated circuits does not constitute a technological bottleneck, nowadays [37].
Then, we notice that in view of devising a full QC platform the optimized circuits implementing two-qubit operations must be complemented with isolated two-channel circuits in which single-qubit rotations are performed.In this respect, the hopping rate J can be tuned by suitably choosing the spatial separation between two adjacent channels.On the other hand, the parameter v g can be tuned and externally controlled by properly shifting the working point along the photon dispersion.This task can be practically achieved, for instance, by local temperature tuning, which results in local refractive index changes.This would ensure, for instance, the flexibility to perform RX rotations with externally controlled rotation angles.In principle, the application of the optimization procedure described in this work might lead to the targeted design of a quantum photonic integrated circuit fulfilling the requirements to achieve deterministic quantum gate operations for each specific platform under consideration.
In terms of possible material platforms, besides the well-established silicon-on-insulator technology, where remarkable advances in quantum photonic experiments have been recently shown [38], a viable example might be the SiN platform, for which the high nonlinearity, low-loss, and mature fabrication of complex circuits [39] might turn out to be an optimal combination to realize a proof of principle demonstration, at least.More recently, exciton-polaritons in semiconductor nanostructures have been proposed as an interesting platform where quantum photonic applications could be realized [30,31], relying on the first experimental evidence for the quantum nature of the propagating polariton field excited from a single-photon Fock state [40], a key requirement of our theoretical scheme.The polariton nonlinearity is of the Kerr-type, as it is well established [13,19,20], and it allows to realize the model Hamiltonian in Eq. ( 1) with values of U that are compatible with the ones re-quired for the optimal operations identified in the previous Section.In fact, by assuming, e.g., typical excitation energies in the ℏω 1 eV range, hopping parameters can be assumed such that ℏJ max = 1 meV, as an order of magnitude estimate [41].Then, the single-photon nonlinearity depends on the actual field confinement [13,14], and for 1D propagating polariton wave-packets with spatial extension of the order of their wavelength it may range from 10 µeV (realistic, see, e.g., Refs.[19]) up to 100 µeV depending on the material (optimistic, including recent claims for enhanced nonlinearities of dipolar polaritons [42][43][44]).These values would then correspond to U/J max = 0.01 − 0.1, i.e., in the range where we have shown that two-qubit gates can actually be realized with large fidelity, in Figs. 2 and 4. In addition, J max can also be reduced in realistic samples (depending on the distance between neighbouring waveguide channels), thus making the optimal parameter (U/J max = 0.5) within reach.This would also allow to reduce the number of blocks required to achieve an optimal fidelity close to 100%, which is particularly relevant when losses have to be included in the discussion, as it will be addressed in the next paragraph.
Losses, decoherence, fabrication imperfections.We have introduced a scheme based on the implementation of a unitary Hamiltonian evolution, but realization of this paradigm in state-of-art photonic devices has to inevitably cope with the effects of losses and decoherence.Moreover, tolerance of the simulated figures of merit, such as gate fidelities, to fabrication imperfections or fluctuations of structure parameters has to be assessed.Here we provide a short discussion summarizing the main conclusions about these effects, as obtained from extensive numerical simulations within an open quantum system approach.The details are reported in the Appendix D and E. First, we address the issue of population losses.As already analysed before [31], propagation losses may affect the actual signal intensity detected at the output of the device, but correlations between single-photons properly normalized to the detected intensity are not affected by such loss mechanism.Also in this specific case, whenever the output signal is detected, the transfer operation is automatically realized with high fidelity, thus making the gate operations fully deterministic anyways.In fact, provided the whole interferometer length remains within the propagation lifetime, the quantum gate operation should be preserved (with a given efficiency due to the loss of signal).To check this conjecture numerically, we have solved the quantum master equation for our model, including population losses in a Lindblad term (see Appendix D).The outcome is strikingly straightforward: the absolute gate fidelity has an exactly exponential decay with a lifetime given by the inverse of the twophoton population decay rate, that is τ = 1/(2γ).Thus, by normalizing the fidelity to such exponential factor, the close-to-ideal fidelity is recovered.The effects of population decay can thus be fully mitigated by proper "renor-malization" of the output signal for a given decay rate γ.Other sources of noise, such as thermal noise or pure dephasing, can also be quantified through dissipative terms in the master equation (see Appendix D).First, photon number fluctuations can be considered absolutely negligible, given that low working temperatures in the Kelvin range produce negligible thermal photons in the visible/near-infrared range, and assuming pure Fockstate injection guarantees no presence of higher photon number states (as it would be the case, e.g., in an attenuated laser source).On the other hand, the effects of number-dependent dephasing might have an impact on the relative coherence between the qubit basis states.In order to properly quantify these effects, we have considered a number-dependent Lindblad term with a pure dephasing rate γ deph .Our numerical results (reported in Appendix D) suggest that a pure dephasing rate γ deph < 10 −2 γ has no practical effects on the qubits decoherence, thus preserving the overall fidelity of the two-qubit entangling operation.On the other hand, dual rail encoding naturally allows to minimize the effects of the loss of relative coherence between the two logical states of a single qubit, which are defined from single photons propagating in each channel.The results are interesting per se, and they might serve as a guide for experimentalists working on specific material platforms, once a proper characterization of dephasing rates is performed.Finally, we have also considered the effects of static fluctuations of the model parameters on the overall gate performances, as it might occur when fabrication imperfections or structural disorder come into play after the circuit realization.Also in this case, by considering realistic parameters fluctuations in state of the art semiconductor technology it is concluded that the optimal gate fidelities predicted in this work can be safely preserved against static noise.To conclude this Section we try to be specifically more quantitative on the estimation of loss parameters for prospective polariton integrated circuits, and see where we actually stand in terms of achievable results.First, let us notice that intrinsic exciton polaritons lifetime in inorganic semiconductor nanostructures has been measured in the order of 100 ps [45].Moreover, exploiting the concept of bound-state in the continuum in a patterned waveguide geometry to suppress out-of-plane radiation losses, lifetimes in the order of 300 ps have been measured in polariton condensates (see, e.g., additional material of Ref. [46]).Recently, such propagation lifetimes have been also confirmed in a polariton waveguide geometry [44].Based on these results, it is very likely that combining suitably engineered photonic lattices with single-quantum well samples, propagating single-polariton states with large group velocities and ultra-long propagation lengths might be engineered [47].With these numbers in mind, we can estimate the single polariton decay rate in the ℏγ ∼ 1 − 10 µeV range, i.e., same order of magnitude expected for ℏU .For the re-sults shown, e.g., in Figs. 2 and 4, a sequence of 15 blocks with an average duration of about 8 ps per block (i.e., assuming a 1 ps average propagation time in each of the 8 sectors schematically represented in Fig. 1c) amounts to an estimated total propagation time of 120 ps when considering the realistic U/J max = 0.05 case.This would allow to achieve a two-qubit entangling gate with fidelity in excess of 99.5% in a propagation time well within the polariton lifetime of, e.g., 200 ps.
Summary.We have proposed a quantum computing model based on the realization of a universal gate set of qubit operations in nonlinear photonic interferometers, where a dual-rail type of qubit encoding is assumed.We have shown that weak single-photon nonlinearities within the same propagating channel allow to build robust deterministic entangling gates between two such photonic qubits with high average gate fidelity, whose quest has been one of the major issues in the field for years.The optimal realization of this operation on-chip is achieved by a suitable concatenation of something between 10 and 20 elementary blocks, each containing all the possible combinations of propagation unitaries defined on a 4-port device, without the need for additional ancillary waveguides.On the quantitative side, we have shown that optimal CNOT and M-S quantum gates can be designed with 99.95% theoretical fidelities.It is worth noting, for comparison, that currently available QC devices have state-of-the art CNOT fidelities in the order of 99.77% with superconducting circuit architectures [48], and M-S fidelities of 99.6% with trapped ion few qubits devices1 .Finally, our optimal operations have been tested against the main sources of loss, thermal noise, pure dephasing, also showing a good resilience to static parameters fluctuations derived from, e.g., fabrication imperfections in actual devices.In conclusion, we believe these results might foster further research towards the realization of quantum devices to be used as building blocks of a canonical model of quantum computation employing single propagating photons as information carriers.

Two qubit gates.
In this work we have targeted twoqubit operations defined as controlled-NOT (CNOT) and Mølmer-Sørensen (M-S) [32,33], which are paradigmatic entangling quantum gates.In particular, the CNOT is described by the following ideal operation in matrix representation on the two-qubits basis [49] Its action is such that the state of the second (target) qubit is flipped when the first (control) qubit is in its logical state |1⟩ 2 .The M-S gate [33] is an alternative entangling operation consisting of a RXX gate with a fixed angle of π/2.Differently from the CNOT, the M-S gate has a non-trivial imaginary part: where In the present implementation these two gates are realized by exploring the time propagation of a pair of single-photon states into a 4-port quantum photonic interferometer.The general Hamiltonian describing such a system is Eq. ( 1) with N = 4, which accounts for two main phenomena, i.e., two-photon nonlinear phase shifts and hopping of photons between adjacent channels, respectively.Hence, all possible time-evolution unitary operators can be written as a tensor product of a single channel operator, U F P , accounting for nonlinear propagation, and a two-channel one describing hopping events, U HR .The matrix form of these two operators is reported in the Appendix B, where the explicit dependence on the parameters of the Hamiltonian model, as well as on the propagation time in each sector, can be appreciated.In light of these considerations, these two matrices can be used to define the set of elementary 4-channel operations, that is {U f ree , U paral , U inter , U down , U up }, needed for the parametrization of the fundamental block depicted in Fig. 1c.In particular, their explicit expressions read where ⊗ denotes the tensor product.For our purposes, it is worth noticing that the two U HR operators in Eq. ( 7) are defined, in general, with different values of J ij .This degree of freedom is exploited in the optimization procedure.Once the unitary operator U b describing the single block depicted in Fig 1c is parametrized, the total timepropagator U tot for a structure with M blocks is obtained by considering the ordered product of such block operators, that is where {θ s } denotes the set of physical parameters used for representing the M -block system.Cost function, minimization scheme, and gate fidelity.In this section we briefly describe the main ingredients used in the optimization scheme, namely the cost function, the numerical optimizer, and the average gate fidelity used to assess the gate performances described in the previous sections.The cost function considered in the present work is defined as where is the computational basis, while U tot ({θ s }) and T denote the total unitary operator describing the 4-channel system and the target ideal operation (either the CNOT or the M-S in Eqs. ( 4)-( 5)), respectively.By definition, the cost function is a non-negative quantity, and it should go to zero only if the parametrization provided by U tot is exact.As a consequence, the optimization procedure aims at finding the best approximation of the target operator T by looking for the set of values of the physical parameters {θ s } that minimizes C({θ s }).In practice, this task is performed by means of numerical routines.In particular, we make use of the Scipy [50] implementation of L-BFGS-B [51,52] optimizer (whose execution has been accelerated with JAX [53,54]), which is a limited-memory algorithm for solving large nonlinear optimization problems subject to simple bounds on the variables.Once at convergence, the routine returns the optimal set of physical parameters {θ opt s } that miminimizes C({θ s }) for a given value of the nonlinearity and number of blocks.The actual performances of the optimization procedure are subsequently quantified by computing the average gate fidelity, F ({θ opt s }).The explicit expression of this figure of merit reads Similarly to what reported above, the matrix T in Eq. ( 13) denotes one of the two target operators, as defined, e.g., in Eqs. ( 4)- (5).Consequently, the particular values {θ opt s } depend explicitly on the chosen T .An explicit derivation of Eq. ( 13) is reported in Appendix C. For each numerical result reported in the manuscript (corresponding to a given value of nonlinearity U and to a given number of blocks), we have sampled 20 different initial sets of hopping parameters {J ij } recorded as one-dimensional vectors, and 20 different optimization procedure are then executed.Among them we select the best final configuration in terms of the achieved accuracy, i.e. the one leading to the minimal value of the cost function.The initial set of hopping parameters is sampled from a Gaussian distribution centered in 0.5J max with standard deviation 0.1J max .As a final comment, we notice that it might sound appealing to try using the average gate fidelity as a cost function.However, since this quantity is only sensitive to the squared modulus of the overlap amplitudes, it cannot be actually used to optimize U tot ({θ s }).Indeed, if on the one hand, it is easy to show that on the other hand, the converse statement does not hold true, in general.
In fact, real and imaginary parts may compensate each other to maximize |⟨i|U † tot ({θ opt s })T |i⟩| 2 .In other words, there exist sets of parameter values that maximize the fidelity, without simultaneously minimizing C({θ s }).
where U m (t m ) ≡ exp(−iH[ω; U ; {J (m) }]t m ) denotes the unitary propagator in the subregion x m−1 < x < x m , and with t m = (x m − x m−1 )/v g .Eq. (A3) can be considered as a definition of U tot , that is the unitary operator describing the action of the 2-channel structure on a generic state.
Appendix B: The UF P operator, the RX(θ) gate, and the UHR operator In this section we discuss how to derive the explicit expression of the U F P , RX(θ) and U HR operators.As a starting point of our discussion, we observe that U F P is a single-channel operator, while the latter two correspond to two-channel transformations.On top of that, the RX(θ) operator is a single-qubit transformation, while the U HR accounts, in general, for the case where one or more particles are propagating in adjacent channels, so it describes the evolution of quantum configurations that cannot always be mapped into single-qubit states.This means that such three operators are represented by matrices having different sizes.Notice, however, that we are interested in describing scenarios where at most two single-photon states are injected within the whole 4-channel system (two-qubit case).This means that (i) the relevant single-channel states for our purposes are given by {|0⟩, |1⟩, |2⟩}, and that (ii) the description of two photons propagating into a N -channel platform requires at most 3 N configurations, corresponding to the set of states {|0⟩, |1⟩, |2⟩} ⊗N , where and with denoting the tensor product of {|0⟩, |1⟩, |2⟩} with itself (which gives the basis set we used to describe a two-channel system).With all these considerations in mind, given that it is straightforward to obtain for instance U F P .Indeed, since for N = 1 the Hamiltonian H is diagonal, one has where we assumed particles to propagate on a region of length l = v g t.
As in the previous section, let us now consider the general model in Eq. ( 1) of the main text restricted to the case N = 2. Depending on the number of particles that are assumed to propagate within the structure, one ends up with the expression of RX(θ) or U HR .When considering a single particle propagating in the structure, the Hamiltonian simplifies to In particular, in every region where the hopping coupling is constant, that is J(x) = J, by expanding such operator onto the single-photon basis {|1, 0⟩, |0, 1⟩}, one has that its exponential reads U with 1 and σ x being the identity and the Pauli-X matrices respectively.The superscript "(1)" in Eq. (B6) is used to stress that such expression holds true only in the single-photon subspace.
For what concerns the expression of U HR , since the Hamiltonian preserves the number of particles, its structure can be determined by exploring the different subspaces with fixed photon number.In the single-photon sector, one obtains the operator reported in Eq. (B6).In a similar fashion, into the two-photon subspace spanned by {|1, 1⟩, |0, 2⟩, |2, 0⟩}, one obtains after a little algebra that with where Ω = √ 4J 2 + U 2 and ϕ = U + 2ω.
The final expression of U HR is obtained by combining the results reported in Eq. ( B6) and (B7), with those describing the dynamics in the 3-and 4-particles sectors.However, even if the coefficients related to these latter Fock subspaces appear in the final form of U HR , we do stress that they are not involved in the system dynamics considered in the main text, that is when at most 2-photons are injected in the system.In particular, by using the following ordering prescription which associates an integer i(a, b) ∈ [1,9] to each two-channel state |a, b⟩ of the basis set {|0⟩, |1⟩, |2⟩} ⊗2 (so that |0, 0⟩ corresponds to the first row/column, |0, 1⟩ to the second row etc), one obtains that U HR is represented by the following 9 × 9 operator: where where the highlighted blocks correspond to coefficients coming from single-(blue) and two-photon (orange) dynamics, respectively.
in which Equation (D2) describes a general scenario where the system is perturbed by a number N ch of different noise sources, each one characterized by its own rate and system Lindblad operator, i.e., γ j and Ôj respectively.

Particle loss and thermal noise
In this theoretical framework, terms leading to particle losses and thermal noise have the same origin and can be regarded as the two sides of the same coin.Usually, the former is pictured by means of Lindblad operators that destroy single-particle excitations in the system.Similarly, thermal noise terms account for the finite probability of having an excitation injected into the system due to the thermal mean-occupation associated with the configuration of the environment, thus controlled by Lindblad operators that create an excitation in the open quantum system.Therefore, the most reasonable choice is to assume the two effects to be controlled by annihilation and creation operators of the system, in the present case given by the set of {a j } and {a † j }, where the j index labels the propagation channel.The rates at which single quanta can escape or are injected within the system do depend on both the spectral properties of the quantum circuit, i.e., theh energy-momentum dispersion of the propagation channels, as well as the environment properties.When a system is primarily coupled to the surroundings through radiative interactions (as it is the case, e.g., in polariton systems), the environment can be treated as a continuum of free-propagating electromagnetic modes at finite temperature, T env , thus represented by an ensemble where a mode at energy E = ℏω contains a mean-number of photons given by the Bose distribution, that is where k B is the Boltzmann constant.In particular, as extensively discussed in Ref. [56], one can express rates associated to particle losses and thermal noise affecting the system occupation at energy ℏω through Eq.D4.More explicitly, one obtains that and where γ denotes the zero-temperature particle loss rate, and γ − and γ + describe the rates at which a single-particle excitation at energy ℏω is lost (−) or injected (+, thermal noise) in the system due to the finite temperature occupation of the environment.In particular, whenever n B (ω, T env ) → 0 and the expression above can be approximated by their zero-temperature limits, i.e., and We notice that at temperatures in the range of few Kelvin, that is T env ≃ 1 − 10 K, the typical energy scale introduced by thermal fluctuations is k B T env ≃ 10 −4 − 10 −3 eV.Therefore, whenever the quantum system is excited at an energy scale in the eV range (as assumed in the main text), the zero-temperature limit can be considered as an excellent approximation.In fact, such a condition is usually met in standard exciton-polariton experiments, where the working point on the energy-momentum dispersion is chosen slightly below the quantum-well exciton resonance, usually located at the eV scale in standard materials, and the samples are kept at constant temperature T env in the few K range (see, e.g., [40,44,46]).In other words, as far as the typical scenarios considered in this manuscript, thermal fluctuations can be safely neglected and noise terms introduced by particle loss in the channel j can be sketched by means of the following operator with a single-particle loss rate given by the zero temperature limit, γ, in each propagation channel (we assume identical propagation channels, without loss of generality).
In order to understand whether the presence of single-particle loss might affect the results discussed in the main text, we consider the effects of a dissipator term as in Eq. (D10) on a system characterized by the Hamiltonian obtained by numerical optimization of the quantum circuit parameters.In particular, since the main target of the present analysis is to show how such terms might affect the quantum circuit response when fed with two single-photon states, i.e., defining the computational basis states in the dual-rail encoding, we first pay attention to the behavior of the average occupation of such states at the end of the quantum circuit as a function of γ.More explicitly, results reported below have been obtained by means of the following protocol.At t = 0, we consider a pure density-operator (input state) defined as The given state is then evolved in time with the Lindblad master equation reported in Eq. (D2) (in particular, by means of an explicit Runge-Kutta 4(5) scheme), and the output state at ρ OUT ≡ ρ(t = t tot ) is then analyzed and information about the results of the computation are extracted.We stress that the particular form of ρ OUT depends on ρ (0) .A few results obtained for the quantum circuit implementing the CNOT gate are reported in Fig. 5, in particular, the one with the highest average gate fidelity obtained with our optimization scheme.In Fig. 5 we report the behavior of the populations of the output state ρ OU T (i.e., diagonal entries), as a function of the ratio γ/γ 0 , in which we define γ 0 = 1/t tot (where t tot is the total propagation time of the quantum circuit), for the different input states reported in Eq. (D11).This choice is motivated by the expression of the fidelity reported in Eq. (C5), which connects the average gate fidelity to output populations.Indeed, when the state σ = |CN OT (ψ (0)) )⟩⟨(ψ (0)) )CN OT | describes the action of the ideal CNOT gate on the input state ρ (0) corresponding to one of the computational basis states, the output state can be defined as we can express the fidelity with respect to the numerically calculated output state in the lossy quantum circuit as which is the population in ρ OUT associated to |ψ CN OT ⟩.Due to the high average fidelity, in the absence of singleparticle losses (γ/γ 0 = 0), the optimized structure behaves essentially as the ideal CNOT gate, with an almost perfect unit transfer of population from the input state to the output state (IN → OUT, as detailed in the legend of Fig. 5a).
When the γ/γ 0 ratio increases, the output population decreases accordingly.In particular, numerical results show that the very same trend in population decay is observed for all the input density operators representing the four states in the computational basis.In addition, in agreement with the discussion provided in Ref. [31], such a decay is compatible with an exponential decay solely depending on the number of particles in ρ(t = 0), which is 2 in our case (as evidently shown by the dashed line in Fig. 5a), and on the ratio γ/γ 0 .Furthermore, as confirmed by the results reported in Fig. 5b, in the presence of single-particle loss the only twoparticle component in ρ OUT is exactly the one expected for the ideal CNOT gate (i.e., for γ = 0).Specifically, in this panel we report data obtained when the initial pure state is given by In the unitary regime, such configuration is mapped with the highest fidelity into the computational basis state |1, 0⟩ 2 = |0, 1, 1, 0⟩, and any other basis state remains empty.In particular, this happens for single-particle states (namely, |1, 0, 0, 0⟩,|1, 0, 0, 0⟩, |0, 0, 1, 0⟩ and |0, 0, 0, 1⟩), as well as any other state belonging to the computational basis.On increasing the γ, the population of the initial configuration is not perfectly transferred to |1, 0⟩ 2 , as it is evident from the plot in Fig. 5b, in which other states other than |1, 0⟩ 2 = |0, 1, 1, 0⟩ become populated, but only belonging to the vacuum or single-particle sector.As already mentioned, the crucial point here is that the other states belonging to the two-particle sector and defining the computational basis remain unpopulated.Similar behaviors are observed when considering as ρ (0) a pure state corresponding to the other computational basis states (not shown).Hence, this trend in numerical data suggests that the average gate fidelity in the presence of losses can be expressed as  5. Numerical results showing the gate fidelity for the optimized quantum circuit implementing the CNOT gate in the presence of single-particle loss, assuming here the best architecture optimized, i.e. for U/Jmax = 0.5 and 20 blocks (without loss of generality).We explicitly show (a) the behavior of the numerically calculated output state population (OUT) on increasing γ/γ0, for any initial state preparation belonging to the computational basis (IN), see the legend, and plot of the exponentially decaying function for the fidelity.The explicit expression of the parameter C is given by C = |⟨ψ (0) |U † tot {θ opt s }|ψ CN OT ⟩| 2 .In the present case, C ≃ 1 for all the input states.Then, we also show (b) the behavior of the populations in all the basis states (see the legend) on increasing γ/γ0.Data in this panel correspond to an initial input state given by ρ(t = 0) = |1, 1⟩2⟨1, 1|2 = |0, 1, 0, 1⟩⟨0, 1, 0, 1|, and the output produced by the ideal CNOT is |1, 0⟩2 = |0, 1, 1, 0⟩2; in the legend, output states in the left column are outside the computational basis, while the ones on the right column are the 4 computational basis states.
where Fγ=0 ({θ opt }) = F ({θ opt }) corresponds to the average gate fidelity used in the main text for the given U/J max value.Conversely, we can state that from Eq. (D15) certainly follows the general expression for the "renormalized" output fidelity In summary, if on the one hand particle losses affect the absolute gate efficiency, on the other hand, once the output signal is properly normalized, our results suggest that the quantum circuit still behaves like a CNOT gate on the computational basis, i.e., pairs of photons emerging from the structure correspond always to the output state produced by the ideal CNOT gate, as requested from the deterministic computational protocol: any time two-photons are simultaneously detected via single-photon detectors at the output ports of the 4-channel interferometer, the two qubit gate is realized with almost 100% fidelity.

Pure dephasing in the presence of particle loss
In order to account for other sources of decoherence, we now consider incoherent effects on the fidelity related to pure dephasing noise.In the context of open quantum systems in the Lindblad master equation formalism [57], these dissipation terms can be taken into account by means of a Lindblad operator proportional to the photon number in each propagation channel, n j = a † j a j , i.e., in which γ deph corresponds to the pure dephasing rate (hereafter assumed to be the same in each channel).Some numerical results concerning the circuit response in the case of the CNOT gate are shown in Fig. 6.There, we report the behavior of the average gate fidelity as a function of the dephasing rate γ deph /γ 0 , rescaled by the factor e 2γ/γ0 , which accounts for the single-particle loss associated to population decay (as just detailed in Sec.D 1).In particular, numerical results are obtained by means of the protocol discussed in the previous section, and describe the interplay between particle loss and noise due to pure dephasing on the structure leading to the best average gate fidelity in the unitary regime, i.e. for γ = γ deph = 0.It is worth noting that realistic pure dephasing rates might strongly depend on the specific material platform employed to encode these photonic qubits.Working with passive photonic integrated circuits (e.g., in silicon or SiN) at low temperature and at visible/telecom wavelengths would ensure negligible contribution to the dephasing of single propagating photons.On the other hand, alternative platforms based, e.g., on exciton polaritons might suffer from phonon-induced dephasing of the excitonic component.For single quantum well excitons, low temperature coupling to the phonon bath as well as spectral diffusion (due, e.g., to small resonance fluctuations due to inhomogeneities in the quantum well thickness) lead to pure dephasing rates that have been measured in the 0.1 µeV/exciton range [see, e.g., Rohan Singh, PhD thesis, University of Colorado Boulder, 2015].We further notice that these effects are expected to be reduced by the strong light-matter coupling of exciton and photon fields giving rise to propagating polaritons.Also, considering that an excitonic fraction of 20%-30% can be employed to have a reasonable compromise between nonlinearity (due to the excitonic component) and polariton speed (i.e., a group velocity mainly determined by the photonic component), we may expect a polariton pure dephasing rate in the order of γ deph < 0.01γ ≃ 0.001γ 0 , which according to the results shown in Fig. 6 gives us confidence that such decoherence mechanism should not appreciably affect the performance of the optimal two-qubit quantum gates proposed in this work.
Appendix E: Tolerance to fabrication defects: static parameters fluctuations In this section we provide further details about the robustness of the theoretical results reported in the manuscript against another possible source of error, namely static noise due, e.g., to parameters fluctuations of the model, as the ones that might be induced, e.g., from fabrication imperfections or non-ideal realization of the designed structures.Indeed, while we believe that the optimization of a multi-port quantum photonic interferometer displaying an almost ideal deterministic two-qubit gate for QC is already an interesting result, it would be of little practical use if not tolerant to static parameters fluctuations with respect to the optimal scenario.Here, we perform a sample test on our optimal structure to show its robustness to different sources of static noise.We restrict the discussion of this statistical analysis to the CNOT operation, with straightforward generalization to the MS gate.The main results are summarized in Fig. 7 for the circuit performing the best CNOT discussed in the manuscript.In particular, we consider perturbations on the model structure that gives the results reported in Fig. 2c of the main text.
Due to possible fabrication imperfections, the set of parameter values {θ * s } characterizing the fabricated interferometer will deviate from the optimal ones {θ opt s }.In addition, since fabrication might also affect the system geometry, even the free propagation and interaction times, i.e., T F P and T HR in our definition, might deviate from the nominal values optimized through the minimization procedure.In what follows, we are going to consider different scenarios.However, for the sake of simplicity, we assume that fabrication leads to uniformly distributed imperfections with respect to a fraction N max of the reference values θ ref ∈ {J max , T F P , T IR } used in our discussion, and we study the FIG. 9. Best M-S matrix Real and imaginary parts of the approximate M-S matrix with all the possible two-photon input/output states, when using a 18 blocks structure with U = 0.5Jmax, for which we get F (θopt) ≈ 99.95%.Vertical and horizontal black lines divide the logic space from the one based on states that are not in the computational basis.The projection of logic states off the computational space is negligible, as clearly seen from the plot.The zoom highlights the gate matrix in the two-qubit logic space.

FIG. 2 .
FIG. 2. CNOT optimizationComparison of the best cost function (see Eq. (12)) (a) and average gate fidelity (see Eq. (13)) (b) values for different values of nonlinearity after the optimization of the block structure.Free propagation and interaction times were both fixed to dimensionless values t = 1.(c) The best average gate fidelity is reported as a function of U/Jmax.For each point the number of blocks employed to reach the corresponding best value is also reported; the inset shows a close-up of the convergence towards maximal fidelity for 0.05Jmax ≤ U ≤ 0.5Jmax.
FIG.3.Best CNOT matrix Real and imaginary parts of the approximate CNOT matrix with all the possible two-photon input/output states, when using a 20 blocks structure with U = 0.5Jmax, for which we get F (θopt) ≈ 99.95%.Vertical and horizontal black lines divide the logic space from the one based on states that are not in the computational basis.The projection of logic states off the computational space is negligible, as clearly seen from the plot.The zoom highlights the gate matrix in the two-qubit logic space.

FIG. 4 .
FIG.4.Mølmer-Sørensen gate optimization (a) Best average gate fidelity values comparison after the optimization of the block structure.Free propagation and interaction times were fixed to 1 ps.(b) Plot showing the best average gate fidelity value as a function of U/Jmax.In the inset, the optimal M-S matrix is displayed for U/Jmax = 0.5 and 18 blocks, for which we calculate F (θopt) ≈ 99.95%.
FIG.6.Behavior of the rescaled average gate fidelity on as a function of the pure dephasing rate, γ deph /γ0, for the quantum circuit having the best average gate fidelity in the unitary case, i.e., corresponding to U/Jmax = 0.5 and 20 blocks.The different set of points correspond to alternative scenarions in which a different particle loss rate, γ/γ0, is assumed (see the legend).The inset shows a close up on the region where the fidelity starts to decrease, e.g., around γ deph /γ0 ∼ 10 −3 .