## Abstract

Quantum information science addresses how the processing and transmission of information are affected by uniquely quantum mechanical phenomena. Combination of two-qubit gates has been used to realize quantum circuits, however, scalability is becoming a critical problem. The use of three-qubit gates may simplify the structure of quantum circuits dramatically. Among them, the controlled-SWAP (Fredkin) gates are essential since they can be directly applied to important protocols, e.g., error correction, fingerprinting, and optimal cloning. Here we report a realization of the Fredkin gate for photonic qubits. We achieve a fidelity of 0.85 in the computational basis and an output state fidelity of 0.81 for a 3-photon Greenberger-Horne-Zeilinger state. The estimated process fidelity of 0.77 indicates that our Fredkin gate can be applied to various quantum tasks.

## Introduction

Quantum information science addresses how the storage, processing, and transmission of information are affected by uniquely quantum mechanical phenomena, such as superposition and entanglement^{1}. New technologies that harness these quantum effects are beginning to be realized in the areas of communication^{2,3}, information processing^{4,5} and precision measurement^{6,7,8}. For the realization of a universal gate set, by which, in principle, any quantum information task can be realized, two-qubit gates have been demonstrated^{9,10,11,12,13} and have been used to realize small-scale quantum circuits^{14,15}. However, scalability is becoming a critical problem. It may therefore be helpful to consider the use of three-qubit gates^{16}, which can simplify the structure of quantum circuits dramatically^{17,18}. Although both the controlled-SWAP (CSWAP) gate (also called Fredkin gate)^{16} and the controlled-controlled-NOT gate (also called Toffoli gate)^{16} are representative three-qubit gates, a crucial difference is that the Toffoli gate has two control bits and only one target bit, so that the eigenstates of the operation are local states, whereas the Fredkin gate has only one control qubit that acts on the symmetry of the two target bits, so that the eigenstates of the operation are entangled symmetric/antisymmetric states of the target qubits. For this reason, the Fredkin gates can be directly applied to many important quantum information protocols, e.g., error correction^{19}, fingerprinting^{20}, optimal cloning^{21}, and controlled entanglement filtering. Here we report a realization of the Fredkin gate using a photonic quantum circuit, following the theoretical proposal by Fiurášek^{22}. We achieve a fidelity of 0.85 ± 0.03 for the classical truth table of CSWAP operation and an output state fidelity of 0.81 ± 0.13 for a generated 3-photon Greenberger-Horne-Zeilinger (GHZ) state. We also confirmed that the gate is capable of genuine tripartite entanglement with a quantum coherence corresponding to a visibility of 0.69 ± 0.18 for three-photon interferences. From these results, we estimate a process fidelity of 0.77 ± 0.09, which indicates that our Fredkin gate can be applied to various quantum tasks.

Since the implementation of a Fredkin gate with only single- and two-qubit gates requires five two-qubit gates and many single-qubit operations, it has not been realized yet in any qubit system^{23}. For photonic qubits, the limited efficiency of the photonic quantum gates^{24} restricts the success rate of the Fredkin gate to 10^{−5}. As has been proposed for the Toffoli gate^{17}, the use of excess degrees of freedom may ease this difficulty, but this would require the precise control of a larger Hilbert space. As an alternative approach, Fiurášek proposed an implementation based on multi-photon control of an interferometer^{22}.

Fiurášek’s proposal is based on single-photon interference in a Mach-Zehnder interferometer (Fig. 1A). It is well known that a single photon incident from mode A(B) is output from mode C(D) with 100% probability when the lengths of the two optical paths are the same, i.e., when the phase is *ϕ* = 0. On the other hand, when the pathlengths are different by *λ*/2(*ϕ* = *π*), a photon incident from mode A(B) will be output from the opposite mode, D(C). Figure 1B shows an optical partial SWAP gate based on this principle^{25}, where the qubits are encoded into the polarization of photons. The target photonic qubits are input from T_{1in} and T_{2in}, and the gate operation is successful when the photons are output from T_{1out} and T_{2out}, respectively. By changing the phase *ϕ*, the different gate operations, including the identity gate (*ϕ* = 0), the SWAP gate (*ϕ* = *π*) and the gate (*ϕ* = *π*/2), can be obtained^{25}.

A quantum CSWAP can be realized by replacing the classical phase shifter with a photonic quantum phase gate (QPG). The phase of the QPG is changed by a control qubit: *ϕ* = 0(*π*) when the control qubit is |0〉(|1〉). Figure 1C shows the quantum CSWAP gate proposed by Fiurášek^{22}. The QPG is realized by combining two optical controlled-NOT (CNOT) gates, which are based on the two-photon interferences at the partially polarizing beam splitters. The state of the control qubit is encoded into the state of the two photons incident to the CNOT gates by using an Einstein-Podolsky-Rosen (EPR) source and a quantum parity check: the encoder transforms the input state of the control photon into a state with a probability of 1/2.

In this proof-of-principle demonstration, we adopted a simplified scheme (Fig. 1D), where the control qubit is directly encoded into the entangled photon pair generated via spontaneous parametric down-conversion and local polarization operations. The CSWAP operation is successful when the photons are simultaneously detected at the output ports (T_{1out}, T_{2out}, C_{1out}, C_{2out}). To the best of our knowledge, the success probability of this operation (1/162) is the highest among the various proposals for photonic CSWAP gates. Note that for this simplified scheme, an unknown qubit cannot be used for the control qubit. However, the simplified scheme can still handle any (entangled) unknown target qubits together with a known control qubit in an arbitrary superposition state, and thus useful for many tasks, e.g. quantum finger printing and optimal cloning.

## Results

In order to demonstrate the proposed simplified CSWAP gate, the interferometer that is integrated with multiple optical quantum gates must be perfectly stabilized. As shown in Fig. 2A, we realized a highly stable photonic quantum circuit for the simplified CSWAP gate by using two key technologies: displaced-Sagnac architecture and hybrid partially polarizing beam splitters (PPBSs), which contain multiple PPBSs in one optical component. In this optical circuit, the two main optical paths of the interferometers in Fig. 1D are folded, and the two beam splitters (BSs) in Fig. 1D correspond to the blue beam splitter in Fig. 2A. In order to implement the different gate operations for each of the folded paths in the displaced-Sagnac interferometer, we used two types of hybrid PPBSs (specially ordered, OPTOQUEST Co., LTD.), each of which combines a PPBS and a mirror or BS. Since both of the folded optical paths experience the same optical components, the displaced-Sagnac architecture is intrinsically robust against disturbance. Figure 2B shows the interference fringe that occurs when a laser light is incident to T_{1in} and detected at T_{2out}. The fringe maintained a very high visibility V = 99.5% over a full week without any active stabilization.

For the entangled photon pairs^{26} and the two single photons^{27} required for the CSWAP gate operation, we constructed the photon source shown in Fig. 2C. Ultraviolet laser pulses with a center wavelength of 390 nm from a frequency-doubled mode-locked Ti:sapphire laser (wave length: 780 nm; pulse width: 100 fs; repetition rate: 82 MHz) pumped a pair of 1.5 mm-thick Type-I *β*-barium borate (BBO) crystals. The pump laser light was diagonally polarized to generate the entangled photon pair . The pump laser was then reflected, and its polarization was changed to vertical by using a quarter-wave plate (QWP) for the generation of pairs of two single photons ^{26}. The spatial decoherence, which is dependent on the emission angle, and the spectral-temporal decoherence, which is dependent on the group delay, are compensated by using an additional four BBO crystals (I–IV in Fig. 2)^{28,29}. The relative phase between the H and V polarizations is adjusted by a wave plate. From the result of quantum state tomography (Fig. 2D), the fidelity of the entangled state is 0.962 ± 0.002, and the entanglement concurrence is 0.941 ± 0.001, indicating that this state is almost maximally entangled. After removing the scattered pump light by using an interference filter (center wavelength 780 nm; full width at half maximum 2 nm), the entangled photons are delivered to the circuit via single-mode fibers so that horizontally and vertically polarized photons propagate at the same speed inside the fibers, whereas single photons are delivered to the circuit via polarization maintaining fibers. Note that the polarizing beam splitters (PBSs) that are set just after the input couplers for T_{1in} and T_{2in} in Fig. 2A are used to increase the purity of the two target input photons. The QWPs and half-wave plates (HWPs) that are set after the input couplers for C_{1in} and C_{2in} are used to compensate the changes in polarization inside the single-mode fibers. The timing of the input photons injected to the photonic circuit is controlled by moving the positions of the fiber couplers.

The output photons in modes T_{1out}, T_{2out}, and C_{1out} are filtered by polarization analyzers consisting of QWPs, HWPs, and PBSs, and the photons from each of seven possible output modes are detected by single-photon counting modules (SPCM-AQ-FC, Perkin Elmer). Using a multichannel photon correlator (DPC-230, Becker & Hickl GmbH), all the fourfold coincidence events were analyzed. Note that the events where more than three photon-pairs are simultaneously generated from the BBO crystal cause errors. The contribution of such events can be reduced by decreasing the pump power, which results in lower coincidence rate. We optimized the pump power considering both the uncertainty due to the limited number of detection events and the errors caused by the excess multi-pair emission events.

Since quantum control is realized by a sequence of two CNOT operations implemented by PPBS-A1 and PPBS-A2, we first evaluated these operations separately using two sets of complementary inputs^{13}. Note that for this evaluation, the effect of the events with more than three photon-pairs were compensated using a separate measurement. Figure 2E and F show the results of using a CNOT operation for a computational basis for PPBS-A1 and PPBS-A2, respectively. The fidelity of the truth table of CNOT operation is 0.895 and 0.893 for PPBS-A1 and PPBS-A2, respectively. Figure 2G and H show the results of using a CNOT operation for a complementary basis for PPBS-A1 and PPBS-A2, respectively. The fidelity of the truth table for the complementary basis is 0.889 and 0.890 for PPBS-A1 and PPBS-A2, respectively. These results proved the high performance of the CNOT gates with two heralded single photon sources.

Figure 3 shows the measurement result of our controlled swap gate in the computational basis. In order to convert the coincidence rates to probabilities, we normalize them with the sum of the coincidence counts obtained for each of the respective input states. In the ideal case of our implementation, the target states are swapped if and only if the controlled qubit is in the logical |1〉 state. In Fig. 3, the diagonal components (0.28 for |101〉〈101| and 0.35 for |110〉〈110|) corresponding to the erroneous operations (non-swap for control qubit is 1) exist even though they are smaller than the correct operations (0.61 for |110〉〈101| and 0.56 for |101〉〈110|), where |110〉〈101| denotes the component of 101 input and 110 output. These diagonal components increased significantly for a higher pump power, indicating that these errors are in part caused by the events where more than three photon-pairs are generated simultaneously. The classical fidelity *F*_{zzz} of the controlled swap operation in the computational basis, defined as the probability of obtaining the correct output averaged over all eight possible inputs, was 0.85 ± 0.03.

The final step is to test the genuine quantum coherent operation of the CSWAP gate. Since the count rate of 10^{−4} Hz is too low to perform a complete process tomography, we focused on a direct verification of the entanglement capability of the gate that could be achieved by a coherent superposition of the control qubit. Specifically, a completely local input of any two orthogonal states for the target qubits and a superposition of for the control qubit will result in GHZ-type three-photon entanglement, where the coherence between the swap operation associated with a control qubit state of |1〉 and the identity operation associated with |0〉 is mapped onto a three-photon coherence in the output (see Methods). Experimentally, we generated this three-photon coherence by using a computational basis input of |10〉 for the target photons and a superposition of for the control photon, so that the output is given by

We evaluated the three-photon coherence of this state by detecting the correlations between the three different polarization directions defined by equally spaced phase shifts between the H and V polarization of the computational basis. By averaging the parity of the measurement outcomes, we can determine the three-photon coherence of the output *ρ*,

The maximal value of C is 1/4 for separable states, 1/2 for biseparable states, and 1 for an ideal GHZ state. From the experimental data shown in Fig. 4, the estimated quantum coherence of 0.69 ± 0.18 indicates the fact that under the assumption of Gaussian statistics, we have more than 85% probability for C > 0.5 which can be achieved only by genuine three partite entanglement. See Methods for details.

As mentioned above, it is reasonable to assume that the entanglement capability of the quantum gate originates from the coherence between the identity operation |0〉〈0| ⊗ *I* and the swap operation |1〉〈1| ⊗ *U*_{swap}. Based on this assumption, it is possible to estimate the process fidelity by taking the average of the classical fidelity *F*_{zzz} and the coherence C (see Methods). The estimated process fidelity, which is defined by the normalized product trace of the process matrix and the matrix describing the ideal process, obtained from these two sets of experimental data is . We are thus able to get a fairly good idea of how well the quantum process works by identifying the essential elements of process coherence directly with the non-classical coherence observed in a specific output state.

In the above analysis, C is used to test the quantumness of the gate by evaluating its entanglement capability. This is complementary to *F*_{zzz}, which tests the classical performance of the gate. *F*_{process} is a kind of summary of both aspects, providing a single figure of merit that averages the fidelities of the quantum features and the classical features. Importantly, the coherence C is a direct measure of the quantum coherent operation used in applications, such as cloning, fusion of entangled states, or quantum fingerprinting. Our result of *C* = 0.69 indicates that the gate can successfully operate on entangled inputs without destroying the entanglement. The setup should therefore be suitable for integration into larger quantum circuits for these tasks. For more information, the state fidelity for the output GHZ state is given as follows^{30}:

where *M*_{0} is the fidelity of the diagonal elements of the terms |010〉〈010| and |101〉〈101|. From the result of the HV basis measurement shown in Fig. 4A, *M*_{0} = 0.927 ± 0.183. Thus, the estimated fidelity for the output GHZ state is *F*_{GHZ} = 0.81 ± 0.13.

## Discussion

To conclude, we have successfully demonstrated a CSWAP operation with a fidelity of 0.85 ± 0.03 for the classical truth table and an output state fidelity of 0.81 ± 0.13 for a generated 3-photon GHZ state. The quantum coherence of C = 0.69 ± 0.18 indicates the fact that under the assumption of Gaussian statistics, we have more than 85% probability for C > 0.5 which can be achieved only by genuine three partite entanglement. The estimated process fidelity of 0.77 ± 0.09 also indicates that our CSWAP gate is suitable for integration into larger quantum circuits. For the erroneous operation of the gate (23%), our rough estimation suggests that eighty percent of such errors are due to the imperfection of the current photon source which sometimes emits more than three photon-pairs (up to about 10%) simultaneously and has non-zero timing jitter due to group velocity mismatch (See Methods for details). One of the current challenges in the community is to improve the single photon sources with smaller excess photon components in the output. Examples are heralded single photon sources using multiple SPDC sources in parallel^{31,32}, and single photon sources using quantum dots^{33,34}. The current experimental demonstration also highlights the strong demand for such sources.

Although a measurement based approach is promising for future linear optics quantum computation in terms of efficiency^{35}, photonic quantum circuits combining quantum gates are also useful for various applications or tasks for quantum information processing and quantum communication. The eigenstates of a multi-photon gate determine which states can be measured and distinguished by observing local changes in one of the photons. Since the eigenstates of the CSWAP gate are entangled symmetric/antisymmetric states of the target qubits, the CSWAP is especially useful for all implementations that require a QND measurement of entanglement. Next challenge would be the realization of the non-simplified scheme (Fig. 1C) for an unknown control qubit embedded in a polarization of a single photon. Although the probability of the success of the gate is the same with the simplified scheme (1/162), one needs to precisely control 5 photons (3 single photon inputs plus one ancillary entangled photon pair.) The demonstrated controlled-SWAP gate is successful only when the resultant single photons are output from each of the output modes one by one, which may limit its potential uses within larger quantum circuits without technically demanding non-demolition photon number measurements. A fully heralded controlled-SWAP gate using linear optics is also possible but would require a total of nine single photons^{22}. For such experiments, efficient single photon sources will be important^{33}. Note also that, different from an alternative realization of an optical quantum controlled SWAP operation recently reported by Patel *et al*.^{36}, unknown photonic qubits encoded in polarization can be used as two target bits and the resultant state is output as three single-photon qubits. Thus our scheme is directly applicable for interesting tasks including quantum fingerprinting^{20}, optimal cloning^{21}, and can be used as a built-in component in photonic quantum circuits for other protocols.

## Methods

### Measurement results for three-photon coherence

The essential difference between a quantum controlled swap and a classical controlled swap is that the quantum coherent superposition of the swap operation is conditioned by a control bit in the 1 state, and the identity operation is conditioned by a control bit in the 0 state, as expressed by the unitary operator of the ideal operation,

The amount of coherence in the actual operation can be quantified in terms of the visibility of the quantum interference between the identity and the swap operation. Since it seems unlikely that random gate errors will result in the same kind of coherence, the coherence of the gate operation should correspond to the three-photon coherence generated by a coherent superposition of 0 and 1 in the control bit input,

The density matrix element describing the coherence between 010 and 101 originates from the process matrix element that describes the coherence between the identity operation and the swap operation, so the quantum coherence of the gate can be evaluated by experimentally determining the three-photon coherence of the output, given by

For separable states, the three-photon coherence C is limited by the maximal local coherence of . For completely separable states, the maximal value of C is therefore . For biseparable states, the limit is given by the product of the maximal local coherence and the maximal two-photon coherence, . Therefore, three-photon coherences C larger than 0.5 indicate genuine tripartite entanglement.

Experimentally, the three photon coherence of the state results in strong correlations between the Bloch vector components in the equatorial plane. These correlations are easily observed as correlations between different polarization directions. Importantly, maximal correlations can be obtained whenever the directions of the Bloch vector components satisfy a specific relation between their angles in the XY-plane of the Bloch sphere. If we define , we find that is exactly equal to one whenever *ϕ*_{1} − *ϕ*_{2} + *ϕ*_{3} is an even multiple of *π*, or minus one if it is an odd multiple. This provides us with a particularly strong experimental criterion for three partite entanglement, since a rotation of each polarization by an angle of *π*/3 results in a sign flip for the correlation that is only obtained for local polarizations along *ϕ* = 0 if the angle of rotation exceeds *π*/2.

In the following, we measure the three photon correlation for rotation angles of 0, *π*/3 and 2*π*/3, given by

Note that are the measure for the correlation taking a value between -1 to 1. These three correlations can be used to reconstruct the total three photon coherence,

Thus, genuine three partite entanglement can be demonstrated if the average value of for the three polarization directions separated by angles of *π*/3 on the Bloch sphere is greater than 1/2. In order to derive eq. (8) from eq. (6), one may use the relations and . In and , the coefficients for are 1/2 and the coefficients for are , and for even numbers of the sign is opposite. As a result, we have . Note also that .

From the experimental results shown in Fig. 4, we obtained values of , , and . From these values C = 0.69 ± 0.18. The average value of each operator was calculated in such a way that, for example, , where P(*ijk*) is the probability that the logical value of *ijk* is detected in the measurement basis shown in Fig. 4C.

It may be worth noting that the high result for originates mostly from an unexpected dominance of 111 outcomes, indicating a contribution from local polarizations. However, the correlations and still exceed 1/2, which is a significant indication of the special correlation only observable for genuine three-partite entanglement. For example, for a separable state with , the values of and would be −1/8 each.

### Estimated process fidelity

The critical problem in the realization of the quantum process is to maintain coherence between the identity operation conditioned by a control qubit input of zero and the swap operation conditioned by a control qubit input of one. We can therefore describe the process as a quantum superposition of these two processes, using a process matrix where the coherence between the two processes is given by the corresponding off-diagonal elements. In this representation of the process matrix, the classical fidelity *F*_{zzz} is given by the average of the diagonal elements and the coherence C is given by the off-diagonal elements. If no other process matrix elements contribute to *F*_{zzz} and C (in other words, the errors observed in the classical operation do not increase the coherence C observed in the quantum operation), we can estimate the process fidelity *F*_{process}, which is defined by the normalized product trace of the process matrix and the matrix describing the ideal process as follows:

In order to derive this relation, note that the process is a superposition of and as shown in eq. (4) and the coherence C is a direct measure of the coherence between these two operations. In the process matrix, these can be represented by two diagonal elements and two off-diagonal elements, where *F*_{zzz} is the product trace of the real process and the diagonal elements, and C is the product trace of the real process and the off-diagonal elements. Based on these assumptions, our experimental results correspond to an estimated process fidelity of 0.77 ± 0.09.

### Subtracted events

In order to evaluate the performance of the gate, we need to know the four-fold coincidence counts caused by the case where a pair of photon is generated from each of the two parametric down converters (PDCs). However, there are cases where two pairs are generated from only one of the PDCs. We estimated the coincidence events caused by the latter events by performing separate measurements where the output of one of the PDCs was closed and subtracted the events observed in these measurements from the total four-fold detection. The process fidelity is degraded to 0.54 ± 0.03 if we do not perform this subtraction.

### Experimental behavior of the custom hybrid optic elements

The measured reflectance for H and V polarization of the components of the hybrid optics are as follows. For H-PPBS1, PPBS-A1 R_{H} = 34%, R_{V} = 98%, Mirror R_{H} = 99%, R_{V} = 100%. For H-PPBS2, PPBS-A2 R_{H} = 36%, R_{V} = 98%, BS R_{H} = 34%, R_{V} = 38%.

### The effect of possible error sources on the performance of the circuit

Here we roughly estimate the effect of error sources on the non-unity quantum process fidelity of 77 ± 9%. The average of the observed visibilities of the two photon interference between the photons from different sources at PPBSs are 86.2%, where the pump laser power was enough attenuated to suppress the multi-pair emission events and the actual polarization-dependent reflectivity of the PPBSs (shown above) are taken into account. This degradation in the visibility is due to the spatio-temporal mode mismatch of the photons^{27}. Based on the analysis similar to a ref. 37, we have found that the quantum process fidelity degrades about 7%. The same analysis also suggests that the difference of the measured transmittances and reflectances of the PPBSs (shown above) from the ideal ones may have caused degradation in the process fidelity by 0.2%. The imperfection of the entangled photons with the state fidelity of 0.962 may have caused about 2% degradation in the process fidelity. The sum of the estimated errors due to the above mentioned causes are about 9.2%. We strongly conjecture that the rest of the errors (~14%) in the total error (~23%) is mainly due to the events where three pairs of photons are emitted simultaneously from the source. By decreasing the pump power, the probability of having three-pair-emission can be suppressed but the data accumulation time has to be increased. As a compromise between these factors, we used a pump power with which the amount of four-fold coincidence events due to the three-pair-emission is about 10%, which was estimated by a separate experiment. A more complete and detailed analysis of errors in the photonic network^{38} will be one of the important future research topics, but out of the scope of this paper.

## Additional Information

**How to cite this article:** Ono, T. *et al*. Implementation of a quantum controlled-SWAP gate with photonic circuits. *Sci. Rep.* **7**, 45353; doi: 10.1038/srep45353 (2017).

**Publisher's note:** Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## References

- 1.
Nielsen, M. A. & Chuang, I. L.

*Quantum Computation and Quantum Information*(Cambridge University Press, 2000). - 2.
Gisin, N. & Thew, R. Quantum communication.

*Nature Photonics***1**, 165–171 (2007). - 3.
O’Brien, J. L., Furusawa, A. & Vučković, J. Photonic quantum technologies.

*Nature Photonics***3**, 687–695 (2009). - 4.
O’Brien, J. L. Optical quantum computing.

*Science (New York, N.Y.)***318**, 1567–70 (2007). - 5.
Ladd, T. D.

*et al.*Quantum computers.*Nature***464**, 45–53 (2010). - 6.
Giovannetti, V., Lloyd, S. & Maccone, L. Quantum-enhanced measurements: beating the standard quantum limit.

*Science (New York, N.Y.)***306**, 1330–6 (2004). - 7.
Nagata, T., Okamoto, R., O’Brien, J. L., Sasaki, K. & Takeuchi, S. Beating the standard quantum limit with four-entangled photons.

*Science (New York, N.Y.)***316**, 726–9 (2007). - 8.
Ono, T., Okamoto, R. & Takeuchi, S. An entanglement-enhanced microscope.

*Nature communications***4**, 2426 (2013). - 9.
Monroe, C., Meekhof, D., King, B., Itano, W. & Wineland, D. Demonstration of a Fundamental Quantum Logic Gate.

*Physical Review Letters***75**, 4714–4717 (1995). - 10.
O’Brien, J. L., Pryde, G. J., White, A. G., Ralph, T. C. & Branning, D. Demonstration of an all-optical quantum controlled-NOT gate.

*Nature***426**, 264–267 (2003). - 11.
Anderlini, M.

*et al.*Controlled exchange interaction between pairs of neutral atoms in an optical lattice.*Nature***448**, 452–6 (2007). - 12.
DiCarlo, L.

*et al.*Demonstration of two-qubit algorithms with a superconducting quantum processor.*Nature***460**, 240–4 (2009). - 13.
Okamoto, R., Hofmann, H., Takeuchi, S. & Sasaki, K. Demonstration of an Optical Quantum Controlled-NOT Gate without Path Interference.

*Physical Review Letters***95**, 210506 (2005). - 14.
Vandersypen, L., Steffen, M. & Breyta, G. Experimental realization of Shor’s quantum factoring algorithm using nuclear magnetic resonance.

*Nature***120**, 883–887 (2001). - 15.
Martin-López, E.

*et al.*Experimental realization of Shor’s quantum factoring algorithm using qubit recycling.*Nature Photonics***6**, 773–776 (2012). - 16.
Fredkin, E. & Toffoli, T. Conservative logic.

*International Journal of Theoretical Physics***21**, 219–253 (1982). - 17.
Lanyon, B. P.

*et al.*Simplifying quantum logic using higher-dimensional Hilbert spaces.*Nature Physics*1–7 (2008). - 18.
Ozaydin, F., Bugu, S., Yesilyurt, C., Altintas, A. A. & Tame, M. Fusing multiple W states simultaneously with a Fredkin gate.

*Physical Review A***042311**, 1–8 (2014). - 19.
Cory, D. G.

*et al.*Experimental Quantum Error Correction.*Physical Review Letters***81**, 2152–2155 (1998). - 20.
Buhrman, H., Cleve, R., Watrous, J. & de Wolf, R. Quantum Fingerprinting.

*Physical Review Letters***87**, 167902 (2001). - 21.
Hofmann, H. F. How Weak Values Emerge in Joint Measurements on Cloned Quantum Systems.

*Physical Review Letters***109**, 020408 (2012). - 22.
Fiurášek, J. Linear optical Fredkin gate based on partial-SWAP gate.

*Physical Review A***78**, 032317 (2008). - 23.
Smolin, J. & DiVincenzo, D. Five two-bit quantum gates are sufficient to implement the quantum Fredkin gate.

*Physical Review A***53**, 2855–2856 (1996). - 24.
Hofmann, H. & Takeuchi, S. Quantum phase gate for photonic qubits using only beam splitters and postselection.

*Physical Review A***66**, 024308 (2002). - 25.
Černoch, A., Soubusta, J., Bartušková, L., Dušek, M. & Fiurášek, J. Experimental Realization of Linear-Optical Partial swap Gates.

*Physical Review Letters***100**, 180501 (2008). - 26.
Kwiat, P., Waks, E. & White, A. Ultrabright source of polarization-entangled photons.

*Physical Review A***60**, 773–776 (1999). - 27.
Tanida, M., Okamoto, R. & Takeuchi, S. Highly indistinguishable heralded single-photon sources using parametric down conversion.

*Optics express***20**, 15275–85 (2012). - 28.
Rangarajan, R., Goggin, M. & Kwiat, P. Optimizing type-I polarization-entangled photons.

*Optics express***17**, 18920–18933 (2009). - 29.
Tokunaga, Y., Kuwashiro, S., Yamamoto, T., Koashi, M. & Imoto, N. Generation of high-fidelity four-photon cluster state and quantum-domain demonstration of one-way quantum computing.

*Physical Review Letters***100**(2008). - 30.
Gühne, O., Lu, C. Y., Gao, W. B. & Pan, J. W. Toolbox for entanglement detection and fidelity estimation.

*Physical Review A***76**, 1–4 (2007). - 31.
Ma, X., Zotter, S., Kofler, J., Jennewein, T. & Zeilinger, A. Experimental generation of single photons via active multiplexing.

*Physical Review A***83**, 1 (2011). - 32.
Mendoza, G. J.

*et al.*Active temporal and spatial multiplexing of photons.*Optica***3**, 127 (2016). - 33.
Ding, X.

*et al.*On-Demand Single Photons with High Extraction Efficiency and Near-Unity Indistinguishability from a Resonantly Driven Quantum Dot in a Micropillar.*Physical Review Letters***116**, 020401 (2016). - 34.
Somaschi, N.

*et al.*Near-optimal single-photon sources in the solid state.*Nature Photonics***10**, 340–345 (2016). - 35.
Gimeno-Segovia, M., Shadbolt, P., Browne, D. E. & Rudolph, T. From Three-Photon Greenberger-Horne-Zeilinger States to Ballistic Universal Quantum Computation.

*Physical Review Letters***115**, 020502 (2015). - 36.
Patel, R. B., Ho, J., Ferreyrol, F., Ralph, T. C. & Pryde, G. J. A quantum Fredkin gate.

*Science Advances***2**, e1501531 (2016). - 37.
Nagata, T., Okamoto, R., Hofmann, H. F. & Takeuchi, S. Analysis of experimental error sources in a linear-optics quantum gate.

*New J. Phys.***12**, 043053 (2010). - 38.
Tichy, M. C. Sampling of partially distinguishable bosons and the relation to the multidimensional permanent.

*Physical Review A***91**, 022316 (2015).

## Acknowledgements

This work was supported in part by Quantum Cybernetics of JSPS, FIRST of JSPS, Grant-in-Aids from JSPS, JST-CREST, Special Coordination Funds for Promoting Science and Technology, Research Foundation for Opto-Science and Technology, and the GCOE program.

## Author information

## Author notes

- Takafumi Ono
- , Ryo Okamoto
- & Masato Tanida

These authors contributed equally to this work.

## Affiliations

### Research Institute for Electronic Science, Hokkaido University, Sapporo 001-0020, Japan

- Takafumi Ono
- , Ryo Okamoto
- , Masato Tanida
- & Shigeki Takeuchi

### The Institute of Scientific and Industrial Research, Osaka University, Mihogaoka 8-1, Ibaraki, Osaka 567-0047, Japan

- Takafumi Ono
- , Ryo Okamoto
- , Masato Tanida
- & Shigeki Takeuchi

### Kyoto University, Department of Electronic Science and Engineering, Kyoto Daigaku-Katsura, Nishikyo-ku, Kyoto 615-8510, Japan

- Ryo Okamoto
- & Shigeki Takeuchi

### Graduate School of Advanced Sciences of Matter, Hiroshima University, Kagamiyama 1-3-1, Higashi Hiroshima 739-8530, Japan

- Holger F. Hofmann

## Authors

### Search for Takafumi Ono in:

### Search for Ryo Okamoto in:

### Search for Masato Tanida in:

### Search for Holger F. Hofmann in:

### Search for Shigeki Takeuchi in:

### Contributions

Experiments, measurements and initial data analysis were performed by M.T. and T.O. with the assistance of R.O. and S.T. The project was initially planned by M.T. and S.T. and supervised by R.O. and S.T. The theory for the evaluation of the data was developed by H.F.H. All of the authors contributed to the analysis of the data and to the writing of the manuscript.

### Competing interests

The authors declare no competing financial interests.

## Corresponding author

Correspondence to Shigeki Takeuchi.

## Comments

By submitting a comment you agree to abide by our Terms and Community Guidelines. If you find something abusive or that does not comply with our terms or guidelines please flag it as inappropriate.

This work is licensed under a Creative Commons Attribution 4.0 International License. The images or other third party material in this article are included in the article’s Creative Commons license, unless indicated otherwise in the credit line; if the material is not included under the Creative Commons license, users will need to obtain permission from the license holder to reproduce the material. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/