Nondestructive detector for exchange symmetry of photonic qubits

We experimentally realize a quantum Fredkin gate and use it for constructing a nondestructive detector of exchange symmetry for qubits. The detector, which discriminates between symmetric and anti-symmetric quantum states of two qubits, allows us to directly measure a purity and overlap of quantum states and implement a quantum state programmable measurement. Furthermore, the nondestructive nature of the detector can be used for analysis of the back-action of the measurements, as well as for realization of nonlinear quantum operations, such as quantum purification and quantum cloning. As a whole, the experiment demonstrates the utility of exchange symmetry measurements and their potential for multi-step characterization and processing of quantum states. A new detector can identify the exchange symmetry of pairs of qubits in a non-destructive way. Michal Mičuda and colleagues from Palacký University, Czech Republic, have experimentally realized a quantum Fredkin gate in a linear quantum optics platform. The gate exchanges the state of two input qubits, here encoded in the polarization of two distinguishable photons, depending on the state of a third ancillary photon. By placing the ancillary qubit in a superposition state, the authors achieve a non-destructive projection of the qubit pair onto their symmetric or anti-symmetric subspace—namely the ensemble of states that are respectively invariant or acquire a global negative sign upon qubit exchange. As the authors show, discriminating the exchange symmetry of a qubit pair can be used to determine purity of quantum states, and to generate non-linear operations.


INTRODUCTION
Many features of quantum physics are based on symmetries present in physical systems. For example, the fundamental difference between bosons and fermions lies in their behavior under particle exchange. 1 Indistinguishable bosons are symmetric while indistinguishable fermions are antisymmetric. The situation is more convoluted for distinguishable particles, which can be in states that are symmetric, anti-symmetric, or even arbitrary superpositions of thereof. 2 The full sets of completely symmetric and anti-symmetric states form specific symmetric and antisymmetric subspaces of the global multi-particle Hilbert space. Such states are naturally orthogonal and can be discriminated by projective measurements. 3 Such projections play an important role in quantum measurements and general quantum information processing. They allow direct measurements of nonlinear functionals of quantum states, 4-6 direct evaluation of the overlap and Hilbert-Schmidt distance between different states, 4,5 and construction of programmable quantum multimeters. 7,8 In principle, such measurements can be implemented by applying projectors onto the chosen subspaces. Consider an example of the direct measurement of purity of a qubit state. The purity is a nonlinear functional which provides important information about the quantum state and is utilized in many evaluations of quantum protocols. The direct measurement of purity requires two copies of the state and for two identical polarization qubits it can be realized in the Hong-Ou-Mandel experiment. 9,10 This, in practice, is just a destructive projection onto the symmetric and antisymmetric subspaces. 4,5 However, the projection does not need to be destructive. Laws of quantum physics allow implementing measurements as filters, without consuming the quantum systems which could then be employed for further processing or analysis. For qubits, the purity directly determines the diagonal form of the density matrix. 4 Other measurements would be needed for full characterization, but they could still be realized, because the states were not affected. This is even more pronounced for quantum states from larger Hilbert spaces for which quantum tomography is a daunting task.
The possibility of implementing nondestructive multi-qubit operations was opened up by the recent experimental tests of linear optics three-qubit Fredkin gates. 11,12 The construction allows one of the qubits to act as an ancilla which can, after interaction with the other two qubits, be destructively measured. At the same time, the measurement reveals information about the two qubits nondestructively, saving the qubits for further processing. However, full exploration of all features of the projective symmetrization 4,5,7,8 requires versatile control of the input states and the ability to perform full quantum process tomography in addition to the high fidelity three-qubit gate. These were not simultaneously available in the pioneering tests. 11,12 In this study we utilize a high-fidelity high-rate quantum Fredkin gate for full exploration of the nondestructive projections into symmetric and antisymmetric subspaces. Our setup allows for strong control of input and output qubits and is fast enough to allow collection of enough data for full quantum process tomography. These features enable tests and characterization of direct nondestructive measurements of purity and overlap of quantum states, 5 as well as the optimal single-qubit quantum multimeter. 7,8 The nondestructive nature of the operation also enables realization of optimal purification and optimal cloning 13 of qubits. This demonstrates applicability of the exchange symmetry measurement for realizing quantum operations on optical qubits.

RESULTS AND DISCUSSION
The controlled exchange interaction is schematically depicted in Fig. 1 (see Methods for details on the experimental implementation). The interaction, also called control swap or quantum Fredkin gate, 14,15 acts on three qubits; two signal (a and b) and one control (m). When the control qubit m is in the state 1 j i the operation swaps states of qubits a and b, otherwise it does nothing. In its ideal form it is a unitary operation represented by controlled exchange operator Þis the antisymmetric Bell state. 16 When the control qubit is initially in the superposition state þ j i = 1 ffiffi Þ , the gate realizes projection onto either symmetric or anti-symmetric subspace of qubits a and b. These two operations correspond, respectively, to action of operators Π S = Ψ À j i Ψ À h j and Π A = 1 − Π S . Which one of the two operations was performed is random, but it can be found out by measuring the control qubit in the basis consisting of states ± j i= 1 ffiffi 4,5 Measurement results '+' and '−' indicate projection onto the symmetric and antisymmetric subspaces, respectively. The theoretical probabilities of these events depend on the state ρ ab of qubits a and b, P S = Tr[ρ ab Π S ] and P A ¼ 1 À P S , and can be asymptotically obtained from the experimentally determined relative frequencies f S and f A . As a whole, the device therefore realizes a non-destructive detector of exchange symmetry (NDES). We will distinguish two regimes in which we operate the controlled exchange interaction device: when the control qubit m is initially in the þ j i state we will say that the NDES is on. When the control qubit is initialized in the state 0 j i and the device should not implement any operation, we will say the NDES is off. This regime is mainly used for characterization. More details can be found in Methods.

Purity measurement
The most common way of estimating purity of an unknown quantum state employs tomographic measurement followed by density matrix reconstruction. This approach is demanding because the number of required projections scales exponentially with the dimension of the system. Knowledge of quantum state density matrix gives us full information about the examined state but in some cases knowledge about purity suffices. A recent example is the quantification of macroscopic quantumness, where measurement of purity plays an important role. 17 An elegant way to directly estimate purity of the unknown quantum state was developed using symmetrization protocol. 5 The method is general and applicable to quantum systems with arbitrary dimension. Here we test it for systems of qubits for which we can verify the obtained values with help of quantum tomography. The scheme is based on the identity Trρ 2 = Tr[(Π S − Π A )ρ ⊗ ρ]. It therefore requires two copies of the investigated state ρ and employs them to measures the mean value Π S À Π A h i . The individual operators Π S and Π A , corresponding to projection into the symmetric and antisymmetric subspaces, can be used for determining the purity P as where f S and f A are the relative frequencies of the results heralding the symmetric and antisymmetric projections, respectively. The scheme reduces the number of required measurements for the price of increasing the dimension of the Hilbert space of the implemented quantum circuit. In the past this technique was demonstrated for two polarization encoded qubits carried by single photons and destructive measurement based on the Hong-Ou-Mandel effect. 9 Here we use the NDES to demonstrate the nondestructive and nondemolition version. We have tested the purity measurement for a set of input states with varying purity. The pairs of identical input states have been prepared with average fidelity F = 0.997 (8). The number in the brackets represents one standard deviation at the final decimal place. We have performed full tomography of the two-qubit state at the output of the controlled exchange device, with the NDES both on and off. We have evaluated the experiment for all six basis states of the three mutually unbiased bases and aggregated the results, see Methods for details. The reconstructed density matrices were used to evaluate the purities of the input qubit and of the qubit pair state, which were compared to the purities P obtained by the direct nondestructive measurement of the ancillary qubit m, see Fig. 2a. The purities measured by the NDES closely match those obtained by the tomographic measurement. To verify that the measurement is also non-demolition we have also analyzed the reconstructed density matrices to compare the measured qubits a and b, in terms of their mutual information I, see Fig. 2b, and the on-off-fidelity, see Fig. 2c. For our purposes we define the on-off-fidelity of a quantum system as 16 where ρ on (ρ off ) is the reconstructed density matrix of the system (either one or two qubits) when the NDES was on (off). Quantum mutual information, 18 can be defined as I = S(ρ a ) + S(ρ b ) − S(ρ ab ), where SðρÞ = ÀTr½ρ log 2 ρ is the von Neumann entropy of the respective states. Both figures of merit confirm the non-demolition nature of the measurement: the mutual information I is kept close to zero, significantly below the possible maximum of two bits, and is mainly caused by correlations in the initial state. The average on-off-fidelities are 0.999(1) for single qubits and 0.990(5) for the two-qubit states. The error bars of the on-off-fidelity (see Methods for details on obtaining them) tend to grow as the purity of the states increases. This happens because we realized the experiment for six possible input states and aggregated them to obtain the final values. The fine differences between these states play a role when the states are pure but vanish in the case of impure states, which are mixtures of all of them. Despite the experimental imperfections, both high quality of the measurement and its non-demolition nature were confirmed by the analysis. Due to its nondestructive nature, the NDES can be also used to realize the quantum purification protocol. 19,20 This protocol aims to improve quality of quantum states affected by decoherence. For qubits the input states can be given as Þis the density matrix of the maximally mixed state. Through the purification operation, several copies of the perturbed state are converted into fewer copies exhibiting both higher purity and higher fidelity, which can be expressed by Γðψ; pÞ n1 → Γðψ; p0Þ n2 with p′ > p and n 1 > n 2 . In our realization, we used two identical copies of a partially mixed quantum state as input states of qubits a and b. We then used the NDES, postselecting the '+' results to apply projection onto the symmetric subspace, and taken the output qubit a as the product of the operation. Subplots (d) and (e) in Fig. 2 demonstrate improvement in both purity and fidelity which is in a very good agreement with Overlap and quantum state disturbance measurement Overlap of two quantum states can be used to quantify their similarity. When at least one of the quantum states is pure, the overlap has the physical meaning of fidelity. A common way to estimate overlap uses knowledge of density matrices obtained by quantum state tomography and subsequent state reconstruction. However, there is an alternative approach for measuring the overlap of two quantum states, ρ a and ρ b , using the symmetrization protocol. 5 In a way similar to the measurement of purity, we can use the NDES on the joint input state ρ a ⊗ ρ b to obtain the relative frequencies f s and f a and the estimated overlap between states is defined as We have experimentally realized this idea and studied the influence of the control qubit measurement on the quantum states involved. We started with input qubit a in state 0 j i, qubit b in state sin α 0 j i þ cos α 1 j i and iterated the α parameter through 19 values ranging from 0 to π/2 radians. First we measured and estimated density matrixes for all input single-qubit and two-qubit states when the NDES was turned on, and then when it was turned off. After that we used the NDES to directly measure the fidelity (overlap) in the nondestructive fashion.
Our findings are summarized in Fig. 3 where we compared the values obtained by the measurement of the ancillary qubit m with the values obtained by ideal theoretical calculation and simulation employing the full process matrix of the operation (see Methods for details). Figure 3a shows the fidelity between the qubits a and b, F a|b , as well as the on-off-fidelity of the joint two-qubit system F on|off . The direct measurement closely follows the results obtained by tomography. We can also see that the severity of the measurement back-action increases when the states are more distinct. For the identical input states a Þ the output two-qubit state is barely altered and the fidelity approaches unity. On the other hand, in case of orthogonal states on input ( Þand the fidelity drops to 1/2. This demonstrates that the overlap measurement, while still nondestructive, is no longer non-demolition.
This behavior can be in greater detail analyzed by looking at the correlations the NDES creates between the qubits a and b. In Fig.  3b we show the average mutual information between the two qubits. This quantity, which disregards the knowledge about which of the two projections has been performed, shows that the output states are most correlated when the input qubits were orthogonal and the correlations diminish with increasing overlap of the two qubits until they vanish for identical states as predicted by the theory. We can also see that when the NDES is off the correlations are small but nonzero. This is a consequence of the hyper-encoded architecture of the gate, see Methods for details.
So far we have investigated fidelity of two pure states but the NDES can also directly measure the fidelity between a pure and a mixed state. To test this, we have prepared qubit b in a mixture of 0 j i and the maximally mixed state and measured its fidelity with the state of the qubit a, which was prepared either in 1 j i or in þ j i. We have repeated the measurement for different purities of the qubit b. The measured fidelity between qubits a and b is shown in Fig. 4a. In Fig. 4b we evaluate the back action of the measurement by comparing the on-off-fidelities of the individual qubits a and b and in Fig. 4c we track the changes in the mutual information. In nearly all the observed cases the experimental results closely follow the theoretical predictions.
The active projection onto the symmetrical subspace can be also employed for quantum cloning. [21][22][23] Quantum cloning is a protocol which takes one or more copies of an unknown quantum state ψ j i and creates a higher number of copies. Such copies are always imperfect and their quality diminishes with their number. Fig. 2 Data for the non-demolition measurement of purity using the NDES with error bars corresponding to one standard deviation. x-axis always shows purity of a single input state P a,off as measured by complete tomography with the NDES off. Dashed lines correspond to ideal theoretical predictions while the points represent the experimental data. a Direct non-demolition measurement of purity using NDES. b Mutual information estimated from the tomographic reconstruction of the qubits a and b. Black circles are for NDES on, gray squares are for NDES off, the nearly overlapping solid lines are predictions based on the actual estimated process matrix. c On-off-fidelities obtained from tomographic data. Red triangles pointing up relate to qubit a, blue triangles pointing down relate to qubit b, and black circles are for the joint state of a and b. d Purity and e fidelity for conditional purification of two copies of input qubit producing qubit a as the output. The circles mark the quantities for the single purified qubit while the squares show them when NDES is off Nondestructive detector for exchange symmetry of photonic qubits R Stárek et al. Fig. 3 Measuring two different qubits a and b by the NDES. The horizontal axis F a|b,off corresponds to the fidelity between input qubits a and b, which was estimated from density matrixes obtained with the NDES off. The dashed lines represent values given by the ideal theory, the solid lines give values obtained by simulation using the full process matrix, and the points denote measured experimental data. a Black circles mark the overlap of a and b directly measured by the non-demolition measurement. Green triangles show the on-off-fidelity of the joint twoqubit system. b and c Quantum mutual information of the joint state of qubits a and b. Gray squares correspond to the NDES off, black circles correspond to the NDES on. The triangles relate to the probabilistic operations in which only data corresponding to projection on the symmetric (red triangles pointing up) and anti-symmetric (blue triangles pointing down) subspaces were selected. The ideal curve for the antisymmetric projection (blue dashed line) attains values I = 2 for F a|b,off < 1 and I = 0 for F a|b,off = 1. This theoretical discontinuity is reflected in the experimental data by the sudden decrease (blue solid line). The error bars correspond to one standard deviation. Please note that subfigure c relates to the Quantum-state programmable multimeter and is discussed in the corresponding section Fig. 4 Measurement of the fidelity between a pure state of qubit a and a mixed state of qubit b. All graphs illustrate various quantities dependence on the qubit's b purity P b,off . Top and bottom row illustrate cases with qubit a set to 1 j i and þ j i, respectively. All dashed lines are ideal theoretical prediction, while all solid lines are predictions based on the actual estimated process matrix. In column a we plot the measured fidelity F a|b between qubits a and b measured by the NDES (black dots) and fidelity F a|b,off calculated from the reconstructed density matrices in the case of the NDES turned off (green triangles). Column b shows single-qubit on-off-fidelity for qubits a (red triangles pointing down) and b (blue triangles pointing up). In column c we plot quantum mutual informationIfor the NDES on (black dots) and off (gray squares). The error bars correspond to one standard deviation Nondestructive detector for exchange symmetry of photonic qubits R Stárek et al.
In our case we have created two clones of a single unknown pure quantum state realizing transformation ψ Þis the symmetric superposition of the initial state and the state orthogonal to it. The unknown state, encoded into the qubit b, can be cloned when qubit a is initialized in the maximally mixed state ρ M and the NDES is used to probabilistically project the pair onto the symmetric subspace. We have realized the operation for the six different states forming the three mutually unbiased bases and used tomographic reconstruction to characterize the two clones (see Methods for details). The reconstructed density matrices have been used to evaluate the average clone fidelities F a = 0.81(4) and F b = 0.80(3), which are significantly above the classical threshold of 2/3 and approach the optimal theoretical limit of 5/6, comparably to the previous realizations of quantum cloning. 24,25 Quantum-state programmable multimeter Von Neumann projective measurement of a qubit can be realized in an arbitrary basis given by orthogonal states b j i and b ? j i. Quantum multimeter is a device with the ambition to implement the full set of such measurements while controlling the measurement basis by a finite programmable quantum register. This makes them usable as a part of larger quantum processing circuit. However, this is impossible in the ideal form and quantum multimeter implements a positive operator valued measure (POVM) instead. 7 It was shown in ref. 8 that when the signal and the program are states of qubits the optimal scheme is based on the projection into the symmetric and anti-symmetric subspaces.
We have used our controlled exchange interaction to implement a nondestructive quantum multimeter for unknown signal state a j i of qubit a, which is programmed by the quantum state b j i of qubit b, see Fig. 1. The ancillary control qubit m, initially prepared in quantum state þ j i, has been used to read out the measurement result. Measurement outcomes þ j i or À j i can be interpreted as indication that qubit a was found most likely in state b j i or b ? j i, respectively. The full POVM elements corresponding to these measurement results can be expressed as The quality of the measurement can be evaluated with help of the conditional probabilities p(x|y), which represent the probability that measurement of m returned value x when the initial state of qubit a was y j i. In our case x = ± and y j i ¼ a j ior a ? j i. These conditional probabilities generally depend on the overlap F a|b,off = ajb h i j j 2 between the signal and the program state. The natural way to benchmark the quality of the experimental quantum multimeter is by evaluating its performance as a quantum discriminator. 7,8 In this regime, in which we attempt to discriminate between known orthogonal states a j i and a ? j i appearing with equal probabilities, the program qubit is prepared in state b j i ¼ a j i. The quality of the discriminator can be quantified by the discrimination fidelity: 8 which should be, barring experimental imperfections, equal to 3/4. We have experimentally tested the multimeter for the six basis states of the three mutually unbiased bases. The achieved fidelity, averaged over the six separate settings, was F disc = 0.74(1). This is, within the estimated confidence interval, perfectly in line with the expected value for perfect implementation of the optimal multimeter. The multimeter is non-destructive, but it still introduces correlations between the signal and the program which diminishes their single qubit qualities. The extent to which this happens depends on their overlap and it can be evaluated with the help of mutual information I which is depicted in Fig. 3c. The situation is different for each of the two possible measurement results, '+' and '−'. The measurement result '−' corresponding to the projection into the anti-symmetric subspace produces a twoqubit state with maximal mutual information as long as the qubit states differ. When the qubits are in identical states the projection never succeeds, which manifests as discontinuity in the theoretical description. In the experimental reality, however, the reduction of the probability of success leads to larger measurement errors together with higher sensitivity to experimental imperfections. This causes increase in size of the error bars, as well as the drop of correlations between highly overlapping states of a and b. Nevertheless, this situation leads to qubits which are individually in the maximally mixed state and unsuitable for further processing. On the other hand, correlations introduced by the measurement result '+' are generally lower. As a consequence, both the signal and the program qubits can be recovered with average theoretical fidelity F th = 0.793. In our experiment we managed to obtain fidelities F a = 0.763(9) and F b = 0.806 (9).

CONCLUSION AND OUTLOOK
We have presented experimental implementation of the nondestructive detector of exchange symmetry based on the quantum Fredkin gate. The Fredkin gate uses an architecture which, apart from a single two-photon interaction implemented in a probabilistic fashion, is deterministic. The path encoding, 26 polarization control, 27 and partial polarization beam splitters 28 have been all previously demonstrated in integrated optics experiments and our device is therefore suitable for on-chip implementation. Significant part of its processing power comes from hyper-encoding two qubit states into path and polarization degrees of freedom of single photons, which can be realized beforehand. 29 We have applied the detector to nondestructive measurements of purity and overlap of quantum states, as well as implementation of quantum multimeter programmable by quantum states. Flexible control over all input and output ports allowed us perform full quantum process tomography of the operation and to confirm both faithfulness and the non-destructive nature of the measurements. The non-destructive nature of the detector allows it to be used for extracting partial information within a larger measurement scheme, or to actively implement nonlinear quantum operations, as we demonstrated by realizing quantum purification or quantum cloning. Apart from the applications listed in this work, the current proof-of-principle implementation of the detector can be immediately utilized for evaluation of the Hilbert-Schmidt distance 5 and extended towards nondestructive estimation of higher-order functionals of quantum state density matrices 17,[30][31][32] or active implementation of fundamental quantum operations. 33 The experiment also demonstrates conceptual usefulness of the exchange symmetry measurements, which can be adopted for non-destructive measurements of important characteristics of intricate quantum states in infinite dimensional spaces, such as those describing states of trapped ions 34 or superconducting circuits. 35

METHODS
The controlled exchange interaction device is implemented by a photonic circuit based on quantum linear optics platform, 36 with use of the hyperencoding technique 37 which exploits encoding two qubits into polarization and path degrees of freedom of a single photon. Hyper-encoded qubits interact more readily and can be obtained by joining together qubits encoded in degrees of freedom of separate photons. 29 In our case we prepare the hyper-encoded qubits directly.
The experimental setup is composed of several Mach-Zehnder (MZ) interferometers with seven independent phases. The interferometers are formed by calcite beam displacing crystals, which is an inherently stable architecture commonly employed in quantum optical experiments. [37][38][39][40] Nondestructive detector for exchange symmetry of photonic qubits R Stárek et al.
The consequence of the stability is a naturally low average drift of the overall phase which, in our case, is 3.30 deg/h. We discuss the phase stability of the interferometric setup into greater detail in a separate article. 41 Our realization of the Fredkin gate includes two single-qubit Hadamard gates, two two-qubit control-not (cnot) and swap gates, and a three-qubit control-control-z (ccz) gate, see the circuit diagram in Fig. 5. We use orthogonally polarized time-correlated photon pairs with central wavelength of 810 nm generated in the process of degenerate spontaneous parametric down-conversion. The signal and idler photons are fed into the experiment via single-mode optical fibers, see Fig. 5. We encode qubits a and b into signal photon's path and polarization degrees of freedom, 42 respectively. The spatial qubit a is initially prepared in polarization encoding using combination of quarter-wave plate (QWP) and half-wave plate (HWP), and it is subsequently converted into path encoding using a calcite beam displacer. The computational basis state 0 j i corresponds to the horizontally polarized photon propagating in the upper interferometer arm, while the state 1 j i is represented by a vertically polarized photon propagating in the lower interferometer arm of the inherently stable MZ interferometer formed by the first and the last calcite beam displacers in the preparation and verification stages of the setup. The qubit b is encoded into polarization state of the signal photon using a combination of QWP and HWP. The elements are arranged so they affect both paths simultaneously in order to minimize undesirable correlations. The two qubits can be prepared in identical pure states with average fidelity F = 0.99 (2) and in identical mixed states with fidelity F = 0.997 (8). The ancillary qubit m is then encoded as the idler photon's polarization state.
The cnot gates between qubits a and b, where a is control, are implemented by inserting a HWP rotated by π/4 into a single spatial mode. It flips the state of the polarization qubit but only for a single spatial qubit state. This implementation, enabled by the hyper-encoding of qubits, is deterministic and offers unparalleled fidelity of process. 43 The two-qubit swap gate for the hyper-encoded qubits a and b can be deterministically realized by rearranging two of the four possible rails the photon can take. Horizontal photon traveling in the upper path needs to be changed to vertical photon traveling in the lower part and vice versa. This can be realized by two calcite beam displacers arranged to form two MZ interferometers with one common path 41 with two HWPs rotated by π/4 inserted into the two outer paths. The HWPs, which were realized by a single HWP with a circular gap allowing the common path unobstructed pass, flip polarization of the photons and cause the swap. The Hadamard gates for the polarization qubit are realized by HWPs rotated by π/8 radians inserted into both paths. The HWPs rotate the polarization states and thus change the computation basis states 0 j i; 1 j i f gto þ j i; À j i f g . Even though the circuit allows deterministic implementation of all single and two-qubit gates, the overall scheme is probabilistic due to the nature of the used three-qubit ccz gate which is realized by two-photon interference on an unbalanced beam splitter. 38,[43][44][45][46][47] Visibility of this interference, measured by characterizing the Hong-Ou-Mandel dip, largely decides overall quality of the gate. 43 Thanks to the high spatial overlap boosted by filtering through single mode fibers we are able to achieve average visibility of V = 0.966 (9). The ccz gate is the only probabilistic gate in the setup and limits the success probability to the theoretical value of 1/9.
The output qubits a and b are analyzed by a block consisting of a QWP, HWP, a calcite beam displacer, and the standard polarization analysis block consisting of HWP, QWP, and polarizating beam splitter (PBS). The ancillary qubit m is projected onto a chosen pure state using the standard polarization analysis block. All output beams are coupled to single-mode optical fibers, which provide spatial filtering, and guided to the avalanche photo diode (APD) detectors. The electronic signal from the APD detectors is electronically processed through delay lines and coincidence logic and the number of coincidences is recorded by an electronic counter module and a time-tagging unit.
In order to quantify the overall performance of the experimentally realized photonic circuit we perform full quantum process tomography of the Fredkin gate. All three qubits are sequentially prepared in the six different basis states 0 j i, 1 j i, ± j i, and ± i j i= 1 ffiffi 2 p 0 j i ± i 1 j i ð Þ and later measured in the same bases for the total of 6 6 measurement records. We then use the maximum-likelihood estimation algorithm procedure 48,49 to obtain the quantum process matrix χ. The quality of the gate can be expressed by the process fidelity F χ = Tr[χχ F ], where χ F is the process matrix of the ideal theoretical Fredkin gate. In our case, the process fidelity amounts to F χ = 0.901. The operation is not perfect due to imperfections of the experimental setup. The most important contributions are the wave plate retardance errors, wavefront distortion, imperfect spatial mode matching at beam splitters and calcite beam displacers, and phase fluctuations in interferometers. When evaluating the individual protocols we distinguish two particular scenarios. The protocols for qubits a and b are performed when the control qubit m is prepared in þ j i and subsequently measured in basis ± j i (NDES is on). The second case, in which the control qubit m is both prepared in and projected to 0 j i leaving the states of qubits a and b unaltered (NDES is off), serves for characterization of the input qubits. One thing revealed by this characterization is a nonzero mutual information between the qubits amounting to roughly 0.25 bits or 0.12 of maximal correlations possible. These correlations appear due to subtly different losses of the paths. On average, these losses amounted to 6.6% relative to the path with the lowest losses. These losses could be compensated by additional optical elements, such as suitably tilted glass plates. However, they would need to be inserted into each arm of all the interferometers, which is not feasible in practice. In the end, the correlations are the side-effect of hyper-encoding and can be seen as a cost for implementing multiqubit operations easily.
Several of the protocols we investigate require mixed states at the input. An arbitrary mixed polarization qubit can be prepared, for example, by using an electronically driven fiber polarization controller. 50 Such device, together with a calcite beam displacer, can be used to prepare a mixed state of the spatial qubit. However, in our implementation, the mixed state of the polarization qubit would require additional rapid modulation of polarization. Such procedures are challenging and prone to imperfections, and that is why, for the purpose of characterizing the gate, we opt for a different approach. We have generated large sets of data for all combinations of the six different basis states at the input and we use this data to compose virtual measurement outcomes for arbitrary mixed states. For each evaluation, a different randomly picked subset of the overall data corresponding to the desired quantum state is chosen to minimize any potential bias.
The large set of data is also used for evaluation of errors. For majority of the protocols the large data set allowed us to simulate one hundred instances of the run in Monte-Carlo-like fashion. These instances are then individually evaluated and statistically processed to obtain overall mean values and standard deviations, which are used for construction of the error bars. In the case of the direct evaluation of purity (1), the error bars obtained by the simulation are further subjected to the methods of error propagation and averaged over the six possible input basis states.

Data availability
The data that support the findings of this study are available from the corresponding author upon request.