Qubits, the fundamental carriers of information in quantum computing, can be encoded in the states of two-level systems1. In order to harness their full potential towards quantum supremacy, substantial numbers of such qubits have to be jointly manipulated and coherently controlled2,3. In analogy to conventional binary logic, so-called quantum gates serve as standardized operations to perform specific operations. Whereas, for example, the Hadamard, Pauli (X, Y, Z), and phase shift gates act on individual qubits, two-qubit operations include SWAP, square-root-SWAP, Controlled-Not (C-Not), and Toffoli gates, among others1,4. These, and many others, have to be experimentally implemented on a variety of technological platforms ranging from superconducting circuits5, trapped ions10 to spin chains11 and quantum optics in free-space as well as integrated-photonic systems6–9. Among the appealing features of linear optical schemes are extreme coherence times and the comparable ease handling afforded by the robustness of photons against external perturbations12–14. More importantly, optical devices such as beam splitters and phase shifters, and even single-photon sources and photodetectors can be readily integrated and miniaturized15–17.
As the number of involved qubits is scaled, the SWAP gate becomes an ever-more important component of quantum architectures, as it facilitates the systematic and unadulterated exchange of states across a set of qubits as a generalization of the operation \(|{Q}^{\left(1\right)}⟩|{Q}^{\left(2\right)}⟩\underrightarrow{\text{S}\text{W}\text{A}\text{P}}|{Q}^{\left(2\right)}⟩|{Q}^{\left(1\right)}⟩\) between the input qubits \(|{Q}^{\left(1\right)}⟩\) and \(|{Q}^{\left(2\right)}⟩\).
A two-qubit SWAP gate can be readily designed based on the protocol developed by Vatan and Williams23, which outlines that optimal circuits for general two-qubit quantum computations can be constructed with a combination of C-NOT gates and elementary single-qubit gates. Accordingly, one such implementation of the SWAP operation corresponds to a sequence of three C-NOT gates23. However, scalable quantum architectures that harness the fault-tolerant24 and resource-efficient25 properties of higher-dimensional qudits require generalized quantum gates that operate on more than two states, whereas generalized C-NOT operations would systematically exclude certain qudit dimensionalities22.
Moreover, the non-deterministic nature of existing C-NOT implementations dramatically diminishes the applicability of this method in a quantum photonic context. For instance, by cascading three of the C-NOT gates reported in reference7 would produce a two-qubit SWAP gate with a success probability of \({\left(1/9\right)}^{3}\approx 0.1\%\). Thus, it is clearly of interest to develop new strategies through which quantum-optical SWAP gates, especially for higher-dimensional quantum states, can be reliably and efficiently implemented.
In this work, we experimentally demonstrate an integrated photonic circuit whose transfer matrix effectively swaps the states of multiple qubits (\(M\) qubits) or two qudits (in \(d=M\) dimensions) with, in principle, a success probability of \(1\). Our approach is based on an integrated array of \(N=2M\) waveguides with a tailored profile of nearest-neighbour couplings \({\kappa }_{n}={\kappa }_{0}\sqrt{n\left(N-n\right)}/2\) between the \(n\)-th and \(\left(n+1\right)\)-th waveguides (see Fig. 1a), where \({\kappa }_{0}\) is a scaling factor that accounts for the physical length of the system. The evolution of single photons along the coordinate \(z\) is governed by the set of coupled Heisenberg equations of motion for the bosonic creation operators26: \(-i\frac{d}{dZ}{a}_{n}^{†}={\kappa }_{n}{a}_{n+1}^{†}+{\kappa }_{n-1}{a}_{n-1}^{†}\), where \(n=\left\{\text{1,2},\dots N\right\}\) and \(Z={\kappa }_{0}z\) is the normalized propagation coordinate. For this particular system, the transition probability amplitude for a photon to reach waveguide \(p\) when launched at \(q\) is analytically given by26
\({{\Psi }}_{p,q}\left(Z\right)={i}^{q-p}\sqrt{\frac{\left(p-1\right)!\left(N-p\right)!}{\left(q-1\right)!\left(N-q\right)!}}{\text{sin}}^{q-p}\left(\frac{Z}{2}\right){\text{cos}}^{N-q-p+1}\left(\frac{Z}{2}\right){P}_{p-1}^{\left(q-p,N-q-p+1\right)}\left(\text{cos}\left(Z\right)\right),\) | (1) |
where \({P}_{n}^{\left(A,B\right)}\left(x\right)\) are the Jacobi polynomials of order \(n\). The direct evaluation of Eq. (1) at \(Z=\pi\) reveals that the only non-vanishing probability amplitudes are given as \({{\Psi }}_{N,1}={{\Psi }}_{N-\text{1,2}}=\dots ={{\Psi }}_{2,N-1}={{\Psi }}_{1,N}=i\). In other words, apart from an overall phase factor of \(i\), the single-photon amplitudes injected into the \(q\)-th waveguide will emerge from waveguide number \(p=(N+1-q)\), and vice versa (cf. Figure 1b). Thus, the final wave function \(|{{\Psi }}_{f}⟩=\left|{\Psi }\right(Z=\pi )⟩\) represents a mirror inversion of the initial wave function \(|{{\Psi }}_{i}⟩=\left|{\Psi }\right(Z=0)⟩\) with respect to the array’s centre – exactly the behaviour required to perform SWAP operations on qubits, and even more importantly, on single-photon multilevel states (qudits).
In contrast to classical bits, qubits are two-component states \(|Q⟩=\alpha |0⟩+\beta |1⟩\) whose complex probability amplitudes \(\alpha ,\beta\) fulfill the normalization \({\left|\alpha \right|}^{2}+{\left|\beta \right|}^{2}=1\). In turn, qudits extend this concept to an \(M\)-dimensional set of components \(({\alpha }_{1},{\alpha }_{2}\dots ,{\alpha }_{M})\) comprising the qudit state \(|Qd⟩={\alpha }_{1}|0⟩+{\alpha }_{2}|1⟩+\dots +{\alpha }_{M}|M-1⟩\), with \({\sum }_{n}{\left|{\alpha }_{n}\right|}^{2}=1\). Analogous to the so-called dual-rail encoding, in which each qubit is represented by a single photon inhabiting the spatial modes of two waveguides, we extend this concept to qudits by using single-photon excitations of \(M\) waveguides for a single qudit. To exemplify the action of the proposed waveguide system with \(N=2M\) waveguides on pairs of single-photon multilevel states, we consider two \(M\)-level qudits with the component sets \(|Q{d}_{1}⟩\to \left({\alpha }_{1},\dots ,{\alpha }_{M} \right)\) and \(|Q{d}_{2}⟩\to ({\beta }_{1},\dots ,{\beta }_{M})\). In this way, the first qudit state is encoded by a single-photon excitation of the first \(M\) waveguides, \(|Q{d}_{1}⟩=\left({\alpha }_{1}{a}_{1}^{†}+{\alpha }_{2}{a}_{2}^{†}+\dots +{\alpha }_{M}{a}_{M}^{†}\right)|0⟩\). Likewise, a second single-photon excitation \(|Q{d}_{2}⟩=\left({\beta }_{M}{a}_{M+1}^{†}+{\beta }_{M-1}{a}_{M+2}^{†}+\dots +{\beta }_{1}{a}_{2M}^{†}\right)|0⟩\) on the waveguides \(M+1,\dots ,2M\) serves as implementation of the second qudit. We must emphasize here, that the allocation of the components of the second qudit are reversed with respect to the first qudit. After a propagation distance of \(Z=\pi\), the initial two-qudit state, \(|{{\Psi }}_{i}⟩=\left|Q{d}_{1}⟩\right|Q{d}_{2}⟩=\left({\alpha }_{1}{a}_{1}^{†}+{\alpha }_{2}{a}_{2}^{†}+\dots +{\alpha }_{M}{a}_{M}^{†}\right)\left({\beta }_{M}{a}_{M+1}^{†}+{\beta }_{M-1}{a}_{M+2}^{†}+\dots +{\beta }_{1}{a}_{2M}^{†}\right)|0⟩\), evolves to the final state \(|{{\Psi }}_{f}⟩=\left({\beta }_{1}{a}_{1}^{†}+\dots +{\beta }_{M}{a}_{M}^{†}\right)\left({\alpha }_{M}{a}_{M+1}^{†}+\dots +{\alpha }_{1}{a}_{2M}^{†}\right)|0⟩\). Evidently, the system acts on the two qudits by exchanging their individual components, \(\left|Q{d}_{1}⟩\right|Q{d}_{2}⟩\underrightarrow{\text{a}\text{r}\text{r}\text{a}\text{y}}\left|Q{d}_{2}⟩\right|Q{d}_{1}⟩\), and thus constitutes the desired generalization of the SWAP operation to multilevel states.
The same system is equally capable of acting as a SWAP gate over registers of \(M\) qubits, \(|{Q}_{1}⟩=\left({\alpha }_{1}{a}_{1}^{†}+{\beta }_{1}{a}_{2}^{†}\right)|0⟩\), \(|{Q}_{2}⟩=\left({\alpha }_{2}{a}_{3}^{†}+{\beta }_{2}{a}_{4}^{†}\right)|0⟩\), ..., \(|{Q}_{M}⟩=\left({\beta }_{M}{a}_{2M-1}^{†}+{\alpha }_{M}{a}_{2M}^{†}\right)|0⟩\). Similar to the qudit-encoding, notice that the allocation of the qubit amplitudes in the second half of the register is reversed. Here, the initial state of \(M\) indistinguishable photons in the configuration \(|{{\Psi }}_{i}⟩=|{Q}_{1}⟩\dots |{Q}_{M}⟩=\left({\alpha }_{1}{a}_{1}^{†}+{\beta }_{1}{a}_{2}^{†}\right)\dots \left({\beta }_{M}{a}_{2M-1}^{†}+{\alpha }_{M}{a}_{2M}^{†}\right)|0⟩\) is transformed into its mirrored version, \(|{{\Psi }}_{f}⟩=\left({\alpha }_{N}{a}_{1}^{†}+{\beta }_{N-1}{a}_{2}^{†}\right)\dots \left({\beta }_{2}{a}_{N-1}^{†}+{\alpha }_{1}{a}_{N}^{†}\right)|0⟩\), returning the register in the swapped order, \(|{Q}_{1}⟩\dots |{Q}_{M}⟩\underrightarrow{\text{a}\text{r}\text{r}\text{a}\text{y}}|{Q}_{M}⟩\dots |{Q}_{1}⟩\) for even \(M\). The lack of an exchange partner for the central qubit for odd register sizes \(M\) instead yields a negation of the central qubit in \(|{Q}_{1}⟩\dots |{Q}_{\left(M+1\right)/2}⟩\dots |{Q}_{M}⟩\underrightarrow{\text{a}\text{r}\text{r}\text{a}\text{y}}|{Q}_{M}⟩\dots \overline{|{Q}_{\left(M+1\right)/2}⟩}\dots |{Q}_{1}⟩\), while all other qubits are swapped in the usual manner.
It should be emphasized that the overall system length \(Z=\pi\) is the same, regardless of whether qudits or registers of qubits are to be operated on. Remarkably, our approach therefore exhibits a constant time complexity, independent of the size of the registers. At intermediate propagation distances \(0<Z<\pi\), the mode occupation of the photons undergoes an evolution through a larger Hilbert space beyond the one spanned by quantum-logical states. It is this extended evolution that allows our SWAP gate design to systematically outperform existing approaches.
Moreover, arbitrarily shorter qubit registers – or qubits of correspondingly lower dimensions – can be readily processed by injecting them into the appropriately chosen central domain of the array. It is this flexibility and downsize-compatibility that sets the proposed design apart from existing approaches and highlights its potential as a standard component in quantum-computational networks.
To experimentally demonstrate the feasibility of our approach, we implemented SWAP-arrays for \(N=4\)based on femtosecond laser-written waveguides27 in a \(149.9 \text{m}\text{m}\) long fused silica chip. The \(70 \text{m}\text{m}\) long functional region comprises four waveguides, including an additional straight uncoupled waveguide serving as a heralding channel, is sandwiched between two fan-out sections interfacing the individual waveguides with off-the-shelf \(82 {\mu }\text{m}\) pitch fiber arrays, (see Fig. 2a). In line with the condition \({Z=\kappa }_{0}z=\pi\), the evanescent coupling rates \({\kappa }_{0}={\kappa }_{2}=0.4488 {\text{c}\text{m}}^{-1}\) and \({\kappa }_{1}={\kappa }_{3}=\sqrt{3}/2\cdot {\kappa }_{0}=0.3887 {\text{c}\text{m}}^{-1}\) were implemented by waveguide separations of \(d=17.892 {\mu }\text{m}\) and \(d=17.246 {\mu }\text{m}\) between outer and inner neighbours, respectively (see Extended Data Fig. 1 in Supplementary Note 1). As shown in Fig. 2b, the input states are obtained by synthesizing photon pairs via type-I spontaneous parametric down-conversion (SPDC) and launching them into the appropriate channels. At the end of the sample, the photon from each of the waveguides are collected with a multimode fibre array and subsequently detected by coincidence measurements between single photon counting modules.
In a first set of experiments, we characterize the single-photon performance of the SWAP array. To this end, we inject one of the photons into a specific input port and route the other photon through the heralding channel to identify single-photon events at the output of the array via coincidence measurements. As shown in Fig. 2c, photons injected into sites \(n=\text{1,2},\text{3,4}\) emerge from waveguide \(n=\text{4,3},\text{2,1}\), respectively. The observed output probabilities clearly demonstrate the coherent character of the long-range transport of photon-encoded qubits with an average fidelity of \(\stackrel{-}{\mathcal{F}}= \frac{1}{4}{\sum }_{k=1}^{4}{\mathcal{F}}^{|k⟩}=\left(0.820\pm 0.010\right)\).
With this photonic circuit at hand, a second set of experiments is conducted to determine the SWAP-array’s truth table for two-qubit input states. In this vein, the performance for 2-level qudits as well as a register of \(M=2\) qubits can be characterized into the same realization. As shown in Fig. 3a, the single-photon probability amplitudes in waveguides 1–4 represent the qubit components in the basis states \(\{{|0⟩}_{1},{|1⟩}_{1},{|1⟩}_{2},{|0⟩}_{2}\}\). In turn, the two-qubit basis is represented by the two-photon states \({|0⟩}_{1}{|0⟩}_{2}={\widehat{a}}_{1}^{†}{\widehat{a}}_{4}^{†}|0⟩\), \({|0⟩}_{1}{|1⟩}_{2}={\widehat{a}}_{1}^{†}{\widehat{a}}_{3}^{†}|0⟩\), \({|1⟩}_{1}{|0⟩}_{2}={\widehat{a}}_{2}^{†}{\widehat{a}}_{4}^{†}|0⟩\) and \({|1⟩}_{1}{|1⟩}_{2}={\widehat{a}}_{2}^{†}{\widehat{a}}_{3}^{†}|0⟩\)). For each of these input states, we record two-photon coincidences between the waveguides’ outputs that correspond to specific logical states (complete data set presented in Extended Data Fig. 2 in Supplementary Note 2). The normalized coincidence statistic for outputs corresponding to the logical basis is shown in Fig. 3b. In line with the ideal SWAP-gate’s truthtable\(\)
\({M}_{\text{S}\text{W}\text{A}\text{P}}=\left(\begin{array}{cc}\begin{array}{cc}1& 0\\ 0& 0\end{array}& \begin{array}{cc}0& 0\\ 1& 0\end{array}\\ \begin{array}{cc}0& 1\\ 0& 0\end{array}& \begin{array}{cc}0& 0\\ 0& 1\end{array}\end{array}\right) ,\) | (2) |
the logical inputs \({|0⟩}_{1}{|0⟩}_{2}\) and \({|1⟩}_{1}{|1⟩}_{2}\) are preserved, whereas the logical inputs \({|1⟩}_{1}{|0⟩}_{2}\) and \({|0⟩}_{1}{|1⟩}_{2}\) are swapped with an average fidelity \(\stackrel{-}{\mathcal{F}}=\frac{1}{4}\text{T}\text{r}\left({M}_{\text{e}\text{x}\text{p}}{M}_{\text{S}\text{W}\text{A}\text{P}}^{T}\right)=0.880\pm 0.028\).
Finally, we unequivocally prove the coherence properties of the SWAP array by verifying that its action upon a superposition of two two-qubit states yields the correct superposition of swapped states. To this end, we place the functional SWAP structure between a pair of balanced beam splitters as shown in Fig. 4a. Each beam splitter is realized by extending the interacting waveguides by \({L}_{BS}=\pi /\left(4{\kappa }_{1}\right)=2.02 \text{c}\text{m}\) before fanning them out as well. As linear optical systems, these splitters serve to synthesize and analyse the respective superposition states injected into, and obtained at the end of, the functional domain. On the input side, waveguides 1 and 2 are connected and produce the state \(|{\Psi }⟩=\left({\widehat{a}}_{1}^{†}+i{\widehat{a}}_{2}^{†}\right)/\sqrt{2}|0⟩\), thereby preparing the first qubit in a coherent superposition \(|{Q}_{1}⟩=({|0⟩}_{1}+i{|1⟩}_{1})/\sqrt{2}\), while the second qubit remains in the defined state \(|{Q}_{2}⟩={|1⟩}_{2}\) when a photon is launched in waveguide 3. Overall, the superposition state \({|{\Psi }⟩}_{i}=\left({|0⟩}_{1}{|1⟩}_{2}+i{|1⟩}_{1}{|1⟩}_{2}\right)/\sqrt{2}=\left({\widehat{a}}_{1}^{†}+i{\widehat{a}}_{2}^{†}\right){\widehat{a}}_{3}^{†}/\sqrt{2}|0⟩\) enters the SWAP array. This arrangement represents the case where both photons enter simultaneously into the waveguide pairs (1,3) and (2,3). After the action of the SWAP gate, we expect the coherent superposition \({|{\Psi }⟩}_{f}=({|1⟩}_{1}{|0⟩}_{2}+i{|1⟩}_{1}{|1⟩}_{2})/\sqrt{2}=\left({\widehat{a}}_{4}^{†}+i{\widehat{a}}_{3}^{†}\right){\widehat{a}}_{2}^{†}/\sqrt{2}|0⟩\). Our strategy relies on the fact that \({|{\Psi }⟩}_{f}\), injected into a judiciously chosen linear optical system, will exhibit a distinctive interference of one of the constituent states. In contrast, if the input state were instead an incoherent mixture of two two-qubit states e.g. \({\rho }_{inc}={\rho }_{1}+{\rho }_{2}={\widehat{a}}_{2}^{†}\left({\widehat{a}}_{4}^{†}|0⟩⟨0|{\widehat{a}}_{4}+{\widehat{a}}_{3}^{†}|0⟩⟨0|{\widehat{a}}_{3}\right){\widehat{a}}_{2}\), the response would be the incoherent sum of the joint two-photon probability densities arising from the individual states \({\rho }_{1}\) and \({\rho }_{2}\). On the output side of the functional section, we therefore couple waveguides 3 and 4 by a second balanced splitter, whose action can be represented by the transformation \(I\otimes i{\sigma }_{x}\), where \(I\) is the \(2\times 2\) identity matrix and \({\sigma }_{x}\) is the first Pauli matrix (i.e., the beam splitter operation between waveguides 3 and 4). Applied to the coherent superposition \({|{\Psi }⟩}_{f}=({|1⟩}_{1}{|0⟩}_{2}+i{|1⟩}_{1}{|1⟩}_{2})/\sqrt{2}\), this transformation serves to cancel the first state, due to destructive interference, yielding \({|{\Psi }⟩}_{f\text{'}}={|1⟩}_{1}{|1⟩}_{2}={\widehat{a}}_{2}^{†}{\widehat{a}}_{3}^{†}|0⟩\). In contrast, the incoherent state \(\left(I\otimes i{\sigma }_{x}\right){\rho }_{inc}{\left(I\otimes i{\sigma }_{x}\right)}^{†}={\rho }_{1}+{\rho }_{2}\) would be invariant under this transformation, allowing for a straightforward verification of the superposition state by comparing the two-photon correlations \({{\Gamma }}_{p,q}^{\text{e}\text{x}\text{p}}\) before and after the second splitter.
Figures 4b-d show the two-photon correlations \({{\Gamma }}_{p,q}^{\text{e}\text{x}\text{p}}=⟨{\widehat{a}}_{p}^{†}{\widehat{a}}_{q}^{†}{\widehat{a}}_{q}{\widehat{a}}_{p}⟩\) after each of the three segments of the circuit shown in Fig. 4a as observed individually in separately fabricated structures that omit the respective down-stream components (see Extended data Figs. 3 in Supplementary Note 2). After the input splitter (Fig. 4b), we find that the desired superposition input state has been synthesized with a similarity \(S={\left({\sum }_{p,q}\sqrt{{{\Gamma }}_{p,q}^{\text{e}\text{x}\text{p}}{{\Gamma }}_{p,q}^{\text{t}\text{h}}}\right)}^{2}/\left({\sum }_{p,q}{{\Gamma }}_{p,q}^{\text{e}\text{x}\text{p}}{\sum }_{p,q}{{\Gamma }}_{p,q}^{\text{t}\text{h}}\right)=\left(0.999\pm 0.001\right)\) to the theoretically expected probabilities \({{\Gamma }}_{p,q}^{\text{t}\text{h}}=⟨{\widehat{a}}_{p}^{†}{\widehat{a}}_{q}^{†}{\widehat{a}}_{q}{\widehat{a}}_{p}⟩\) represented as black wireframes. After passing through the SWAP array (Fig. 4c), this probability distribution has undergone the expected flip with respect to the anti-diagonal with \(S=0.750\pm 0.011\). Finally, after the output splitter (Fig. 4d), the photons chiefly coincide between the waveguides 2 and 3 in line with the calculated pattern for the coherent superposition (illustrated with black frames, similarity \({S}_{coh}=0.796\pm 0.008\)). Compared to the calculated correlation pattern of the incoherent superposition, we find a similarity of \({S}_{inc}=0.563\pm 0.006\), very close to the ideal value of \(S=0.5\) between the calculated patterns for the coherent and incoherent case.
In conclusion, we propose and experimentally demonstrate a new approach for realizing compact and efficient SWAP-gates for integrated photonic platforms. In contrast to previous schemes based on post-selection23, whose scaling towards larger dimensions is severely constrained by prohibitively low success rates, our architecture theoretically allows for unity efficiency regardless of the number of qubits involved, and were found to reach experimental efficiency of \(\eta =0.870\pm 0.004\) and an average gate fidelity of \(\stackrel{-}{\mathcal{F}}=0.880\pm 0.028\). Beyond this dramatic increase of efficiency, our design is capable to handle, in principle, arbitrary numbers of qubits as well as pairs of qudits in a downsize-compatible fashion, allowing the same component to be utilized for lower-dimensional qudits and shorter qubit registers. Being based on one-dimensional tight-binding configurations, the conceptual design can be readily adapted to a wide range of technological platforms.