Introduction

One of the most remarkable implications of quantum mechanics is the possibility of a machine that would dramatically outperform standard computers for certain tasks.1 Research groups around the world are pursuing a variety of approaches to develop such a quantum computer. Photonics has a rich history as a platform for fundamental quantum mechanics experiments,2,3,4 and it has developed into a competitive technology for quantum computing and quantum networks as well.5,6,7 One challenge facing the optical approach to quantum computing is that the traditional bulk-optics setups required to perform more complex experiments rapidly grow in size, and thus are challenging to stabilize. Integrated photonics offers a solution to this problem, promising intrinsic interferometric stability and the possibility of implementing a large number of quantum logic gates on a small monolithic chip. This technology has seen enormous progress in recent years,8,9,10,11 and may offer a realistic approach to realizing the complex circuits needed for scalable photonic quantum computing and quantum networks.12

An important feature of photonic qubits is their resistance to decoherence, even at room temperature. While photons’ limited interaction with the environment is an important advantage over matter systems in this context, it complicates the design of the two-qubit gates crucial for universal quantum computation (any quantum logic circuit can be realized using a combination of only single-qubit and two-qubit gates13). However, the seminal work of Knill, Laflamme, and Milburn (KLM) showed that scalable linear optical quantum computing can be realized using only linear optical interferometers, single-photon sources, and single-photon detectors.14 The two key concepts of the KLM scheme are (i) that the process of photon detection induces effective nonlinearites for two-photon gate operations, and (ii) that such gate operations can be achieved via the measurement of additional “ancilla” photons. Remarkably, it was shown that the success probability of linear-optical two-photon gates can be made arbitrarily close to unity by adding a sufficiently large number of ancilla photons. These findings inspired a large body of experimental and theoretical work.15,16

The controlled-NOT (CNOT) gate is the quintessential two-qubit gate: depending on the computational-basis state of the “control” qubit, the computational-basis state of the “target” qubit is either flipped or left unchanged (Fig. 1). While a classical exclusive-OR (XOR) logic gate performs exactly this operation, a genuine CNOT gate must also process control–target inputs that are quantum superpositions of the computational-basis states, maintaining coherence between them. In the latter case, the CNOT gate can be used to prepare a maximally entangled two-qubit state, or to unambiguously distinguish between all four possible Bell-state inputs: hence, the CNOT gate’s importance to quantum computation evidently stems from its effect on superposition-state inputs.

Fig. 1
figure 1

Schematic CNOT gates. Black (orange) lines indicate logic (ancilla) qubits. Since the photonic gates in (b)–(e) rely on two-photon interference, in general there is no well-defined 1:1 correspondence between input and output photons: solid (dashed) lines indicate input (output) qubits. a Logic circuit description of a CNOT gate. The gate processes “control” and “target” bits. The control input cin is transmitted directly to the control output cout; the sum modulo 2 of cin and target input tin is transmitted to target output tout. While this operation can be realized classically, a genuine CNOT gate must also preserve coherence of arbitrary control and target qubit states. b Unheralded photonic CNOT gate. The gate functions probabilistically and its success in any particular instance is ascertained by destructive measurement of the output control and target qubits. c Heralded photonic CNOT gate. Two additional ancilla photons mediate the CNOT operation. Success of the probabilistic gate operation is heralded by detection of the output ancillas, so the control and target outputs are available for subsequent logic operations. d Heralded photonic CNOT gate using a maximally entangled ancilla state. The special case in which the ancilla photons in (c) are initially entangled allows for improved success probability. e An implementation of the scheme shown in (d) using polarization qubits. With probability 1/4, exactly one photon is detected in each of the modes \(a_{{\rm{out}}}^1\) and \(a_{{\rm{out}}}^2\), heralding successful gate operation.33 In this case, the state \(\left| {c_{{\rm{out}}},t_{{\rm{out}}}} \right\rangle\) matches the desired CNOT output up to a known Pauli rotation: depending on the ancilla two-photon polarization measurement outcome, one of four feed-forward unitaries must be applied to the control and target photons after a successful gate operation (not shown)

The earliest demonstrations of optical CNOT gates induced the KLM nonlinearity using destructive measurement of the photons carrying the control and target output qubits.17,18,19,20 This type of gate is unheralded, since its successful operation can only be verified by measuring the output qubits themselves. Such gates are unsuitable for multi-step quantum logic circuits, where the output of one gate is used as input for the next: subsequent experiments used detection of additional ancilla photons to realize heralded gates.21,22,23,24 The technological progress of integrated quantum photonics has enabled demonstrations of unheralded integrated CNOT gates,25,26,27 and recently also of a heralded CNOT gate.26 In the latter experiment, the circuit was too small to fully implement a heralded CNOT gate and only the classical XOR logic operations were demonstrated.

In this work, we demonstrate an integrated heralded CNOT gate using femtosecond-laser-written waveguides. In contrast to other integrated-optics platforms, which typically process path-encoded qubits (where two distinct waveguides represent logical states “0” and “1” of a single qubit), femtosecond-laser-written waveguides can additionally process polarization-encoded qubits. This feature allows us to halve the number of spatial modes used to implement the CNOT gate, and to adopt a flexible and modular scheme using high-quality free-space photon sources and detectors. A modular design could be of particular advantage for all-optical quantum networks7 and delegated quantum computations.28 In the long term, polarization-processing capabilities offer other important benefits: simultaneous encoding of logic or ancilla qubits in multiple photonic degrees of freedom, such as path and polarization, can be used to increase the system’s information-processing capacity or enable protocols that are otherwise impossible.29,30

A challenge facing femtosecond-laser-written waveguides and most other waveguide technologies is low coupling efficiency to and from the chip. The mode-field-diameter mismatch between conventional optical fibers and waveguide modes typically leads to high losses. Here, we significantly reduce these losses by coupling to the waveguides via thermally expanded core (TEC) fibers,31 standard single-mode optical fibers (SMFs) whose mode-field diameters have been increased by an adiabatic thermal expansion process to match the waveguide mode-field diameter. In addition, the waveguide mode-field diameter is adiabatically reduced near the chip facet to better match the TEC fiber mode-field diameter.32

Results

Working principle of the heralded CNOT gate

Our CNOT gate operates on photon polarization. We define horizontal (H) and vertical (V) polarization to correspond to the logic states “0” and “1”; we will also refer to the single-photon polarization states \(\left| D \right\rangle = \left( {\left| H \right\rangle + \left| V \right\rangle } \right){\mathrm{/}}\sqrt 2\), \(\left| A \right\rangle = \left( {\left| H \right\rangle - \left| V \right\rangle } \right){\mathrm{/}}\sqrt 2\), \(\left| L \right\rangle = \left( {\left| H \right\rangle + i\left| V \right\rangle } \right){\mathrm{/}}\sqrt 2\), and \(\left| R \right\rangle = \left( {\left| H \right\rangle - i\left| V \right\rangle } \right){\mathrm{/}}\sqrt 2\). To realize a heralded gate, we use a maximally entangled pair of ancilla photons in the Bell state \(\left| {{\mathrm{\Psi }}^ - } \right\rangle = \left( {\left| {H,V} \right\rangle - \left| {V,H} \right\rangle } \right){\mathrm{/}}\sqrt 2\) (Fig. 1d); we will also refer to the other two-photon polarization Bell states \(\left| {{\mathrm{\Phi }}^ \pm } \right\rangle = \left( {\left| {H,H} \right\rangle \pm \left| {V,V} \right\rangle } \right){\mathrm{/}}\sqrt 2\) and \(\left| {{\mathrm{\Psi }}^ + } \right\rangle = \left( {\left| {H,V} \right\rangle + \left| {V,H} \right\rangle } \right){\mathrm{/}}\sqrt 2\).

Following the proposal of ref. 33, our experiment uses two polarizing beam splitters (PBSs) in mutually unbiased bases (Fig. 1e). The ideal gate operation is as follows: exactly four indistinguishable photons, are input to the gate in polarization state \(\left| {c_{{\rm{in}}},t_{{\rm{in}}}} \right\rangle \otimes \left| {a_{{\rm{in}}}^1,a_{{\rm{in}}}^2} \right\rangle\), where \(\left| {c_{{\rm{in}}},t_{{\rm{in}}}} \right\rangle\) is the input state of the control and target qubits, and \(\left| {a_{{\rm{in}}}^1,a_{{\rm{in}}}^2} \right\rangle = \left| {{\mathrm{\Psi }}^ - } \right\rangle\) is the state of the input ancilla photons (while ref. 33 instead uses \(\left| {{\mathrm{\Phi }}^ + } \right\rangle\) as the ancilla state, this difference has no effect on the essential functionality of the gate, and simply changes the output by a known Pauli rotation). A CNOT operation is performed on \(\left| {c_{{\rm{in}}},t_{{\rm{in}}}} \right\rangle\) conditional on simultaneous detection of two output ancilla photons, exactly one at detectors D1, D2 and exactly one at detectors D3, D4, which happens with probability 1/4. Such a two-fold coincidence detection heralds successful gate operation and the presence of the two remaining photons in the output control–target state \(\left| {c_{{\rm{out}}},t_{{\rm{out}}}} \right\rangle\). However, to obtain the desired CNOT output state, one of four Pauli rotations must be performed on this output control–target state, depending on the polarization measurement outcome for the output ancilla state \(\left| {a_{{\mathrm{out}}}^1,a_{{\mathrm{out}}}^2} \right\rangle\). The output control and target qubits need not be measured and can be used as input for subsequent logic operations. The two PBSs are physically identical; however, polarization rotations are applied to the photons before entering and after exiting the second PBS such that it acts in a rotated basis.

Experimental setup

As shown in Fig. 2, we generate the control, target, and ancilla photons using degenerate, non-collinear type-II spontaneous parametric down-conversion (SPDC). A Ti:sapphire laser (Coherent Chameleon Ultra II) is used to generate pulses (150 fs duration, 80 MHz repetition rate, 3.8 W average power) at a wavelength of 789 nm, which then undergo second harmonic generation in a 5 mm-thick lithium triborate (LBO) crystal. The resulting beam is spatially filtered and used to pump two separate 2 mm-thick β-barium borate (BBO) crystals, probabilistically producing two polarization-entangled photon pairs. Half-waveplates (HWPs) and 1 mm-thick BBO crystals of the same cut angle as the SPDC crystals are placed in all four photons’ paths to compensate for temporal and spatial walk-off, such that both sources produce pairs in polarization state \(\left| {{\mathrm{\Psi }}^ - } \right\rangle\).34 The first (second) SPDC source supplies the ancilla (control and target) photons. Since we start with a maximally entangled control–target state, we can prepare any desired input \(\left| {c_{{\mathrm{in}}},t_{{\mathrm{in}}}} \right\rangle\) using suitable single-photon projections and rotations. The pump power is attenuated to approximately 600 mW (550 mW) at the first (second) source’s BBO crystal. All four photons pass through 3 nm-bandwidth spectral filters centered at 789 nm, and through SMFs (Nufern 780-HP). This filtering results in polarization-entangled photons with high spectral and spatial purity (see section “Methods”).

Fig. 2
figure 2

Experimental setup. Frequency-doubled pulses from a Ti:sapphire laser create photon pairs in two nonlinear β-barium borate crystals via degenerate type-II spontaneous parametric down conversion. Each crystal produces a maximally entangled polarization state. The photons from the first crystal are used as maximally entangled ancillas; the photons from the second crystal are also initially maximally entangled, and can be converted to any two-qubit control–target state using suitable projections and rotations. Before entering the waveguide, the photons are synchronized in the delay stage: the free-space length of the delay stage is tuned independently for each photon using servo motors, as indicated by the double-headed arrows. The TEC fibers coupled to the chip have thermally expanded cores near their exit facets (indicated by the red tips), to increase mode overlap with the waveguides. After interfering on the chip, the four output photons are collimated with a single lens at the output facet of the chip (omitted in the figure), and sent to the detection stage for polarization analysis. Each photon passes through a quarter-waveplate, a half-waveplate, and a polarizing beam splitter before being coupled to multi-mode fiber (omitted in the figure) and sent to an avalanche photodiode. Feed-forward is simulated in post-processing: the control–target measurement outcome is reassigned to one of four values depending on the ancilla measurement outcome

Adjustable free-space delays lines are used to synchronize the photons such that they all arrive at the chip simultaneously to within their coherence time of 300 fs. We couple from the SMFs to the chip via a 127 μm-pitch v-groove array. The chip consists of two layers. The layer used for the CNOT gate couples the four input and output waveguides to two PBS structures. The second layer is used for alignment and contains two non-polarizing beam splitters (BSs), and several uncurved calibration guides. We use this second layer, which is positioned 127 μm below the CNOT layer, to search for Hong–Ou–Mandel interference while tuning the relative time delays between the photons.2 The fibers coupled to the chip are TEC SMFs, whose mode-field diameters have been increased from 5 to 10 μm in the region near their exit facets,31,35,36 boosting the expected overlap with the adiabatically compressed 8 μm × 11 μm elliptical waveguide modes from 68 to over 96%, corresponding to a 41% improvement over unmodified SMFs (see section “Waveguide details”). Although the maximal coupling efficiency we achieve in our experiment is only (76 ± 5)%, we indeed observe an increase of (46 ± 10)% per modein coupling efficiency, consistent with the theoretical prediction. Moreover, we later discovered that improved polishing of the chip increases the coupling efficiency to (90 ± 8)%, suggesting that our performance was limited either by surface roughness or by waveguides that terminated before reaching the chip facet. All coupling efficiency errors cited here assume that for each fiber type we were able to achieve coupling within 5% of the optimum, and that all input and output powers were measured to within 5% of the actual values. On-chip loss is on the order of 0.3 dB/cm when there is no curvature in the waveguide mode. The overall transmission (from fiber in-coupling up to the avalanche photodiodes (APDs)) of the straight calibration guides was measured to be (50 ± 5)%; in each of the four modes used for the CNOT gate, we measured a transmisson of (40 ± 5)%, most likely due to higher bending losses in the curved waveguide sections.

After exiting the waveguides, the photons are sent to a detection stage. Each output mode of the waveguide is sent to a free-space motorized quarter-waveplate (QWP) and HWP followed by a PBS, enabling measurements in any polarization basis. Both outputs of each of these PBSs are coupled to APDs through multi-mode fibers. Four-photon polarization data is collected in the event of coincidence detection of photons in each of the modes \(c_{{\mathrm{out}}},t_{{\mathrm{out}}},a_{{\mathrm{out}}}^1,a_{{\mathrm{out}}}^2\).

Waveguide details

The chip used in this experiment was fabricated by direct femtosecond-laser writing:37,38 in this process, an ultrashort laser pulse (150 fs, 0.5 mJ, 100 kHz, 800 nm) is tightly focused into a fused silica sample, causing nonlinear absorption and permanently increasing the refractive index in the focal volume.8,39 The guiding regions are traced out by a series of such pulses, and at 789 nm they support single modes with elliptical profiles (15 μm × 20 μm). This ellipticity is due to the intensity distribution of the writing laser beam waist and contributes to slightly different refractive indices for H and Vn ≈ 10−5).40 At the facets of the chip, the minor and major diameters of the approximately elliptical mode are compressed to 8 μm × 11 μm using an adiabatic writing technique, in order to increase overlap with the fiber mode.32

The two PBSs used for our CNOT gate are implemented using a scheme that exploits the waveguides’ birefringence. Evanescent coupling between two guided modes can occur for separation distances ranging from 20 to 30 μm, and different types of directional couplers can be constructed depending on the length of the coupling region and the relative position of the modes with respect to their ellipse axes.41,42,43 Since the strength of the evanescent coupling is different for H and V, it is possible to tune the length of the coupling region in such a way that H returns entirely to the input mode while V transfers entirely to the other mode. Such a structure exhibits the PBS behavior we require (Fig. 3). The same principle, with different parameters, is used to fabricate the BSs on the second layer of the chip. Due to birefringent dispersion, the optimal performance of all of these structures is wavelength-dependent: we measured an extinction of 50:1 for the PBS structures using our three-bandwidth SPDC photons. Although this birefringence is central to the waveguide functionality, it also induces unknown phase shifts between H and V, which simply correspond to local unitary rotations. This effect was compensated for in post-processing.

Fig. 3
figure 3

Schematic illustration of the polarization-dependent directional coupler. Light initially propagating in one waveguide can evanescently couple to another at a rate determined by the spatial separation and refractive indices of the two waveguides. Thus, the probability amplitude for finding a photon initially in Mode 1 can oscillate between Modes 1 and 2. Due to the slight birefringence, the oscillation rates are slightly different for horizontal (H) and vertical (V) polarizations. The inset shows a schematic of the chip, which implements directional couplers for Modes 1 and 2, and Modes 3 and 4. The evanescent coupling regions for the directional couplers are designed such that all V-polarized light (dashed red line) remains in Mode 1 at the end of the region, while all H-polarized light (solid green line) is transferred to Mode 2, similar to a free-space PBS. A different choice of parameters can lead to equal probabilities for the two modes simultaneously for H and V, producing a 50:50 BS like the ones we implement on the lower layer of the chip (not shown)

Performance of the gate

It is natural to discuss the performance of a CNOT gate for two types of control–target inputs. In the first, the input state is one of the four computational basis states \(\left| {HH} \right\rangle ,\left| {HV} \right\rangle ,\left| {VH} \right\rangle ,\left| {VV} \right\rangle\), and the gate output can be replicated using only classical operations. We evaluated the computational-basis performance of our CNOT gate by measuring the truth table (Fig. 4a), which requires four single-setting measurements: for each input state, we analyzed the output in the computational basis. Finally, in post-processing the data, we simulated feed-forward Pauli rotations, reassigning the measurement outcomes for control and target depending on which of the four possible measurement outcomes occurred for the two ancilla photons. The overlap of the measured truth table with the ideal one is (83.8 ± 2.6)%.

Fig. 4
figure 4

Truth table and heralded generation of Bell states. a Truth table showing the probability of each computational-basis output for each computational-basis input. The ideal gate behavior is indicated by the wireframe. The target qubit cross-talk is due to imperfect two-photon interference between partially distinguishable photons from our two sources. The overlap with the ideal truthtable is (83.8 ± 2.6)%. b The real (large) and imaginary (small) parts of the density matrices for the four states produced by the CNOT, depending on which ancilla measurement outcome occurs. The fidelity of these matrices with their respective target Bell states (indicated by the wireframe) are 76% \(\left( {\left| {{\mathrm{\Phi }}^ + } \right\rangle } \right)\), 76% \(\left( {\left| {{\mathrm{\Phi }}^ - } \right\rangle } \right)\),74% \(\left( {\left| {{\mathrm{\Psi }}^ + } \right\rangle } \right)\), and 76% \(\left( {\left| {{\mathrm{\Phi }}^ - } \right\rangle } \right)\) all with errors of ±5%

On the other hand, when the control input is a superposition of the computational-basis states, the gate’s behavior necessarily demands a quantum-mechanical explanation. For the control–target input state \(\left| {D,H} \right\rangle\) for example, the gate outputs a coherent superposition of the outputs for \(\left| H \right\rangle\) and \(\left| V \right\rangle\) control inputs giving the maximally entangled state \(\left| {{\mathrm{\Phi }}^ + } \right\rangle\). Here, in contrast to the computational-basis case, a single measurement does not suffice to demonstrate the gate’s behavior: for this input state, we collected data for nine measurement settings and reconstructed the two-qubit density matrix using quantum state tomography (QST) for each of the different ancilla measurement outcomes.44 To present the density matrices in standard Bell-state form, we applied local unitaries in post-processing to compensate for the chip birefringence (Fig. 4b). The four inferred states correspond to the four possible ancilla outcomes for a single input before feed-forward. These density matrices are presented quantitatively in the Supplementary Material.

For both the computational-basis and superposition-basis cases, we subtracted from our data the rate of higher-order emissions leading to four-fold coincidence detection. It is important to note that this noise is a limitation of our SPDC source, not the gate. Moreover, with the rapid development of other types of single-photon sources, such as those based on quantum dots,45,46 it is likely this obstacle will soon be overcome. Noise subtraction is discussed further in section “Data analysis”. After subtraction, the four-fold coincidence rate was on the order of 100 mHz.

Discussion

We have performed a complete demonstration of an integrated heralded CNOT, characterizing the gate operation for computational-basis and superposition-basis control qubit inputs. We used TEC fibers and adiabatic writing techniques to efficiently transfer high-fidelity polarization qubit states from free-space sources into an integrated-optic circuit. Taking advantage of femtosecond-laser-written waveguides’ polarization control capabilities, we processed these qubits directly on chip.

By adiabatically modifying the mode-field diameters of the SMFs and the waveguides, we increased the coupling efficiency between them, strongly improving on previous work.47 The measured increase in coupling efficiency matched mode-field overlap calculations; additionally, a recent measurement with improved polishing of the chip yielded an absolute coupling efficiency close to the theoretical prediction.

Our work expands on the first demonstrations of unheralded integrated CNOT gates using polarization-encoding or path-encoding,25,26,27 combining the desirable features of heralding, integration, and polarization encoding. However, to make linear-optics quantum computation, all-optical quantum networks, and quantum repeaters a reality, technological challenges remain to be overcome. Of particular importance are the development of near-deterministic single-photon sources and near-unit-efficiency single-photon detectors, as well as low-loss waveguides with active control of polarization and phase shifts.

Methods

Detailed gate logic

We describe the gate in two parts, first addressing the interference at PBS1 and then the interference at PBS2, following the analysis in ref. 33. Let us consider the input state

$$\left| {c_{{\mathrm{in}}},t_{{\mathrm{in}}}} \right\rangle = \left( {\alpha \left| H \right\rangle + \beta \left| V \right\rangle } \right) \otimes \left( {\gamma \left| H \right\rangle + \delta \left| V \right\rangle } \right).$$
(1)

The ancilla photons in modes \(a_{{\mathrm{in}}}^1,a_{{\mathrm{in}}}^2\) are always input in the maximally entangled polarization state

$$\left| {a_{{\mathrm{in}}}^1,a_{{\mathrm{in}}}^2} \right\rangle = \left| {{\mathrm{\Psi }}^ - } \right\rangle = \frac{1}{{\sqrt 2 }}\left( {\left| {H,V} \right\rangle - \left| {V,H} \right\rangle } \right).$$
(2)

PBS1 encodes the input control photon’s polarization state onto the joint state of the photons in \(a_{{\mathrm{in}}}^2\) and cout as follows (see Fig. 1): when exactly one photon arrives in each of the modes \(a_{{\mathrm{out}}}^1\) and cout, the photons in modes \(a_{{\mathrm{out}}}^1,a_{{\mathrm{in}}}^2,c_{{\mathrm{out}}}\) are projected onto the state

$$\begin{array}{l}\alpha \left| {HVH} \right\rangle _{a_{{\mathrm{out}}}^1,a_{{\mathrm{in}}}^2,c_{{\mathrm{out}}}} + \beta \left| {VHV} \right\rangle _{a_{{\mathrm{out}}}^1,a_{{\mathrm{in}}}^2,c_{{\mathrm{out}}}}\\ = \frac{1}{{\sqrt 2 }}\left( {\left| D \right\rangle + \left| A \right\rangle } \right)_{a_{{\mathrm{out}}}^1} \otimes \alpha \left| {VH} \right\rangle _{a_{{\mathrm{in}}}^2,c_{{\mathrm{out}}}}\\ + \frac{1}{{\sqrt 2 }}\left( {\left| D \right\rangle - \left| A \right\rangle } \right)_{a_{{\mathrm{out}}}^1} \otimes \beta \left| {HV} \right\rangle _{a_{{\mathrm{in}}}^2,c_{{\mathrm{out}}}}.\end{array}$$
(3)

When the ancilla photon in \(a_{{\mathrm{out}}}^1\) collapses onto polarization state \(\left| D \right\rangle\), the photons in \(a_{{\mathrm{in}}}^2,c_{{\mathrm{out}}}\) are projected onto the polarization state

$$\left| {\psi _{{\mathrm{PBS}}_1}} \right\rangle = \alpha \left| {VH} \right\rangle _{a_{{\mathrm{in}}}^2,c_{{\mathrm{out}}}} + \beta \left| {HV} \right\rangle _{a_{{\mathrm{in}}}^2,c_{{\mathrm{out}}}},$$
(4)

and when the photon in \(a_{{\mathrm{out}}}^1\) is instead found in polarization state \(\left| A \right\rangle\), the photons in \(a_{{\mathrm{in}}}^2,c_{{\mathrm{out}}}\) are projected onto

$${\Bbb I}_2 \otimes \sigma _z\left| {\psi _{{\mathrm{PBS}}_1}} \right\rangle = \alpha \left| {VH} \right\rangle _{a_{{\mathrm{in}}}^2,c_{{\mathrm{out}}}} - \beta \left| {HV} \right\rangle _{a_{{\mathrm{in}}}^2,c_{{\mathrm{out}}}}.$$
(5)

Thus, when exactly one photon arrives at detectors D1, D2, the input control qubit has successfully been encoded onto the state shared by \(a_{{\mathrm{in}}}^2\) and cout, and the probability of such an event is \(\frac{1}{2}\). Depending on which of the detectors D1 or D2 clicks, a feed-forward operation may need to be applied to the control photon as indicated in (5).

Although the interference at PBS2 works essentially the same way, it is helpful to take a different perspective and to consider two examples. If the photon in \(a_{{\mathrm{in}}}^2\) is in state \(\left| H \right\rangle\), detection of exactly one photon at D3, D4, which occurs with probability \(\frac{1}{2}\), projects the gate output onto

$$\frac{1}{{\sqrt 2 }}\left( {\left| V \right\rangle _{a_{{\mathrm{out}}}^2} \otimes \left( {\gamma \left| H \right\rangle + \delta \left| V \right\rangle } \right)_{t_{{\mathrm{out}}}} + \left| H \right\rangle _{a_{{\mathrm{out}}}^2} \otimes \left( {\gamma \left| V \right\rangle + \delta \left| H \right\rangle } \right)_{t_{{\mathrm{out}}}}} \right).$$
(6)

Therefore, when ancilla photon \(a_{{\mathrm{out}}}^2\) collapses onto \(\left| H \right\rangle\), the target photon in tout is projected onto

$$\left| {t_{{\mathrm{out}}}} \right\rangle = \gamma \left| V \right\rangle + \delta \left| H \right\rangle ,$$
(7)

and when \(a_{{\mathrm{out}}}^2\) collapses onto \(\left| V \right\rangle\), the target photon is projected onto

$$\sigma _x\left| {t_{{\mathrm{out}}}} \right\rangle = \gamma \left| H \right\rangle + \delta \left| V \right\rangle .$$
(8)

On the other hand, if the photon in mode \(a_{{\mathrm{in}}}^2\) is in polarization state \(\left| V \right\rangle\), detecting exactly one \(\left| H \right\rangle\) photon at D3 results in target state

$$\left| {t_{{\mathrm{out}}}} \right\rangle = \gamma \left| H \right\rangle + \delta \left| V \right\rangle ,$$
(9)

and instead detecting exactly one \(\left| V \right\rangle\) photon at D4 yields

$$\sigma _x\left| {t_{{\mathrm{out}}}} \right\rangle = \gamma \left| V \right\rangle + \delta \left| H \right\rangle .$$
(10)

As in the case of PBS1, depending on the measurement outcome for \(a_{{\mathrm{out}}}^2\), a feed-forward Pauli operation may need to be applied as indicated in Eqs. (8) and (10). Evidently, PBS2 performs a CNOT gate on modes \(a_{{\mathrm{in}}}^2\) and tin, conditioned on projective measurement of the photon in \(a_{{\mathrm{out}}}^2\) (with the logic definitions of H and V swapped); the output target state of this destructive CNOT is encoded on the photon in tout.

Finally, assuming feed-forward operations are applied as needed, we consider the destructive CNOT gate PBS2 with input

$$\begin{array}{l}\left| {\psi _{{\mathrm{PBS}}_1}} \right\rangle \otimes \left| {t_{{\mathrm{in}}}} \right\rangle = \left( {\alpha \left| {VH} \right\rangle + \beta \left| {HV} \right\rangle } \right)_{a_{{\mathrm{in}}}^2,c_{{\mathrm{out}}}} \otimes \left( {\gamma \left| H \right\rangle + \delta \left| V \right\rangle } \right)_{t_{{\mathrm{in}}}}\\ = \alpha \left| H \right\rangle _{c_{{\mathrm{out}}}} \otimes \left| V \right\rangle _{a_{{\mathrm{in}}}^2} \otimes \left( {\gamma \left| H \right\rangle + \delta \left| V \right\rangle } \right)_{t_{{\mathrm{in}}}}\\ + \beta \left| V \right\rangle _{c_{{\mathrm{out}}}} \otimes \left| H \right\rangle _{a_{{\mathrm{in}}}^2} \otimes \left( {\gamma \left| H \right\rangle + \delta \left| V \right\rangle } \right)_{t_{{\mathrm{in}}}}.\end{array}$$
(11)

Based on Eqs. (7)–(10), the gate output is evidently

$$\left| {c_{{\mathrm{out}}},t_{{\mathrm{out}}}} \right\rangle = \alpha \left| H \right\rangle \otimes \left( {\gamma \left| H \right\rangle + \delta \left| V \right\rangle } \right) + \beta \left| V \right\rangle \otimes \left( {\gamma \left| V \right\rangle + \delta \left| H \right\rangle } \right),$$
(12)

as desired.

Data analysis

To characterize the CNOT gate’s operation, we analyzed the control–target output photons in different polarization bases and counted four-fold coincidence detection events, to determine the output for each input state we considered. Such events can be produced in three different ways: (i) the control–target source can input two pairs, (ii) the ancilla source can input two pairs, or (iii) each source can input one pair, as desired. Since the probability of either source producing one pair during a single laser pulse is small, the probabilities of these three types of emissions are approximately equal, and hence the higher-order-emission noise can even be larger than the signal of interest. Therefore, we subtract from all measured four-fold coincidence rates the rates with the control–target source blocked, and the rates with the ancilla source blocked. It is interesting to note that the gate architecture intrinsically suppresses part of this noise: if both sources produce pairs with 100% fidelity, albeit probabilistically, then two-photon interference makes it impossible for double-pair emission from the ancilla source to produce a four-fold detection. As discussed in section “SPDC source quality”, we cannot take full advantage of this simplification in practice because of imperfections in our source. The truth table and reconstructed density matrices with and without noise subtraction are given in the Supplementary Material.

For the computational-basis case, we measured the control and target outputs in the computational basis for each of the four computational-basis input states. We simulated feed-forward in post-processing: for each four-fold coincidence, we recorded the control–target output state that would have resulted after one of the four Pauli rotations \({\Bbb I}_2 \otimes {\Bbb I}_2\), \({\Bbb I}_2 \otimes \sigma _x\), \(\sigma _z \otimes {\Bbb I}_2\), \(\sigma _z \otimes \sigma _x\), depending on which of the four possible ancilla detection outcome combinations occurred. We inferred the truth table in Fig. 4 by assuming the probability of measuring each output state was proportional to the corresponding count rate observed. For computational-basis inputs, it is impossible for a double-pair emission from the control–target source to produce a four-fold coincidence, so it was only necessary to measure and subtract the rate of double-pair emission from the ancilla source.

To demonstrate the gate’s superposition-basis operation and generation of entanglement, measurements in a single polarization basis do not suffice. Therefore, for the case of control–target input state \(\left| {D,H} \right\rangle\), we counted four-fold events for the three mutually unbiased analyzer settings H, D, L for control and target, a total of nine two-photon measurement settings. We again assumed that the probability of each measurement outcome was proportional to the corresponding count rate. For this case, we did not simulate feed-forward: for the four possible ancilla outcomes, we reconstructed the corresponding four density matrices in Fig. 4 using maximum-likelihood QST.44 In the superposition-basis case, a double-pair emission from either source is as likely to produce a four-fold coincidence as one pair from each, so it is necessary to measure and subtract both sources’ higher-order emission rates.

To determine the errors on the inferred output states, we assumed Poissonian statistics for all measured count rates, including the higher-order-emission noise rates, and performed Monte Carlo analysis with 1000 randomly generated samples.

SPDC source quality

Even for perfect gate operation, the output state fidelity is naturally limited by the quality of the input state \(\left| {c_{{\mathrm{in}}},t_{{\mathrm{in}}}} \right\rangle \otimes \left| {a_{{\mathrm{in}}}^1,a_{{\mathrm{in}}}^2} \right\rangle\). Our SPDC sources emit high-fidelity polarization states: QST of the entangled input ancilla state yielded (94.5 ± 1)% fidelity with the Bell state \(\left| {{\mathrm{\Psi }}^ - } \right\rangle\). It is important to note that this fidelity is achieved at 612(20) mW pump power. The error is dominated by coupling drifts over the duration of a measurement.

The largest decrease in gate performance is caused by the inherent frequency entanglement of the signal–idler pairs produced by each SPDC source. We use narrowband filters to reduce these correlations, but must ultimately strike a balance between spectral unentanglement and reasonable count rates. To quantify the spectral distinguishability of our photons, we interfered each of the signal and idler photons from the control–target source with each of the signal and idler photons from the ancilla source at a beam splitter (first passing all photons through polarizers at H), and recorded the Hong–Ou–Mandel visibilities for all four combinations. After subtracting higher-order noise, we measured the visibilities to be

$$V = \frac{{C_{{\rm max}} - C_{{\rm min}}}}{{C_{{\rm max}}}} = 0.88 \pm 0.05.$$
(13)

and V = 0.77 ± 0.05 without subtracting higher order noise. As a result of this finite visibility, the gate fidelity we present is limited. Additionally, double-pair emission from the ancilla source can lead to four-fold coincidences because the two-photon interference that would normally suppress such events is imperfect (see section “Data analysis”).

Data availability

The authors declare that the main data supporting the finding of this study are available within the article and its Supplementary Information. Additional data can be provided upon request.