Introduction

Modular quantum architectures are an attractive approach in building large-scale quantum systems1,2,3, promising improved scalability and relaxed yield requirements on the quantum hardware. The modular concept naturally lends itself to optically connected and remotely entangled qubit candidates, such as all-photonic4,5,6,7,8,9,10,11,12 or atom13,14,15,16,17,18,19,20 and atom-like21,22,23,24,25,26,27,28 systems with access to photon-mediated entanglement protocols24,25,29,30,31,32. To reach the millions of qubits required for fault-tolerant quantum computing5,28,33, the systems thus require scalable programmable photonic integrated circuits (PICs)34 for the construction of large-scale entanglement networks, which depend on the high-fidelity and high-speed manipulation of many visible-to-near-infrared optical connections. For a programmable PIC to generate these dynamic optical links, the circuit needs to implement (i) a high-speed optical routing network reconfigurable on timescales much less than the coherence time of the entangled qubits and less than the duration of each remote entanglement attempt (on the order of μs24,28) (ii) path-erasing beam splitters between target qubits and (iii) optical phase control of individual channels to correct for path-dependent phase errors20,25 throughout the entire network. Each of these requirements has been partially addressed in either integrated photonics8,10,15,35 or bulk components9,17,18,25,36,37 for binary switching, beam splitting, and phase modulation. However, there remains an outstanding challenge to develop reconfigurable many-mode switches that satisfy the requirements (i, ii, iii) for optically-heralded quantum networks on PIC platforms.

In this work, we introduce a high-speed photonic integrated mesh with fully programmable linear-optic functions38,39 for the modular generation of reconfigurable optical links between quantum emitters. Figure 1 outlines our proposed architecture. The basic remote entanglement procedure involving a generic atomic qubit is shown in Fig. 1a. The qubit consists of auxiliary memory states40, computational states, and an optically active state coupled to only one computational state. After entanglement with the computational states, a photon is emitted and passes through a path-erasing beam splitter before detection, which heralds the entanglement in the atomic qubits. This procedure (Fig. 1b) must then be scaled and repeated33 to generate the fully connected quantum state. Figure 1c–f show the modularization of the remote entanglement process into two separate modules: a sub-lattice module and an interconnecting module. The sub-lattice module starts with an N-atom chiplet23,41 whose optical outputs connect to a larger N × M optical switch36,37. The N × M switch then directs the N emitted photons to the fast N × N mesh, which performs optical phase control of all inputs, additional reconfigurable optical routing, and precise 50:50 beam splitting before the detector bank, enabling the construction of an arbitrary sub-lattice of a larger quantum state (Fig. 1c, d). Alternatively, the N × M switch can route the N emitted photons to external optical connections for the generation of inter-lattice connections using the interconnecting module (Fig. 1e, f), which contains another N × N mesh circuit fulfilling the same functions as those in the sub-lattice module. Figure 1g, h shows an example of a scalable cubic lattice built from interconnected sub-lattice modules. This design architecture allows the fast PICs to configure all optical entanglement links, while the slower N × M switch determines which type of connection (sub-lattice or inter-lattice) is attempted.

Fig. 1: Modular architecture for generating optical links using programmable photonic integrated meshes.
figure 1

a Diagram of the basic requirements for optically-heralded entanglement generation between two generic atomic qubits. The key components are initialization and control of the computational and auxiliary memory states, an optical transition emitting a photon entangled with the computational states into indistinguishable waveguide modes, a 50:50 beam splitter, and single-photon detectors. b Schematic of the components in a as functional blocks. c Implementation of the block schematic using modular components: an N-atom qubit chiplet is connected to an N × M binary optical switch for photon routing, then connected to an N × N Mach–Zehnder mesh (MZM). The N × N photonic mesh performs the optical phase correction, routing to detectors, and path-erasure functions. This hardware group generates a sub-lattice of the overall quantum state. d Render of a sub-lattice module of functions in c showing external connections to other modules with red, green, and yellow connectors. e Implementation of how interconnects are formed between modules using another N × N MZM, which links the sub-lattices. f Render of the interconnecting module of the functions in e) that links two external connections (colored here in red). g, h An example of how a large-scale cubic lattice may be generated when each sub-lattice module generates a cubic unit cell.

To evaluate the use of photonic meshes for generating these entanglement links, we designed and characterized a programmable PIC, fabricated on a piezo-actuated, optically broadband silicon nitride (SiN) platform42,43,44 at Sandia National Laboratories. This platform benefits from SiN’s broadband optical transmission spectrum, nanowatts of hold power per modulator, sub-μs modulation speeds, CMOS and cryogenically compatible aluminum nitride (AlN) piezo material, and stable long-term operation42. The PIC implements an 8 × 8 Mach–Zehnder mesh (MZM) based on a reversed Clements38 design (see Supplementary Discussion), allowing the execution of linear optical transformations on sub-μs time-scales. We calculated the performance of a heralded single-photon entanglement protocol25,45 attempted on an ideal atomic qubit routed through our PIC and estimated the resulting Bell state fidelity, defined here as the optical transformation or link fidelity, which is a measure of the PIC-induced connection errors. We found the average link fidelity of 16 programmed pairwise optical connections through the 8-channel MZM exceeds 99% for the 32 possible heralded Bell states, sufficient to generate a cubic-lattice unit cell. Our results show the viability of using programmable PICs as an integral part of large-scale entanglement generation on the road towards practical quantum technologies.

Results

Programmable MZM hardware

The schematic of our programmable 8 × 8 MZM is shown in Fig. 2. The MZM is built from two basic components (Fig. 2a): the Mach–Zehnder interferometer (MZI) with internal (θ1, θ2) and external (ϕ1, ϕ2) phase shifters, and an on-chip power monitor using a pick-off beam splitter and optical grating couplers. All optical inputs and outputs are routed from the left edge, while all electrical connections are wire-bonded from pads located at the top and bottom edges (Fig. 2c). Dummy waveguide blocks46 are inserted where appropriate to match the optical loss and path lengths of all possible waveguide routes. The full circuit consists of 112 piezo-actuated mechanical cantilevers44 whose DC and AC response curves are plotted in Fig. 2d, e, respectively. These two representative performance plots show mostly linear actuation except near the +/−30 V fringes with a Vπ~25 V and a relatively flat frequency bandwidth up to the peak mechanical resonance of ~10 MHz. Each electrical input controls two phase shifters simultaneously (θ1-θ2 or ϕ1-ϕ2) in differential operation, resulting in two control signals per MZI for a total of 56 independent voltage channels.

Fig. 2: 8-channel programmable photonic Mach–Zehnder mesh.
figure 2

a Schematic of the basic building blocks of the photonic integrated mesh: a Mach–Zehnder interferometer (MZI), consisting of four optical phase-shifters and the on-chip power monitoring element, consisting of a pick-off beam splitter and grating couplers. b Full diagram of the 8 × 8 programmable Mach–Zehnder mesh. c Optical microscope image of the fully fabricated photonic circuit with optical and electrical I/O labeled. d DC response when actuating phase shifts θ1-θ2 in a single Mach–Zehnder element, showing a Vπ ~25 V. e AC response when actuating phase shifts θ1-θ2 in a single Mach–Zehnder element, showing a relatively flat frequency response until a peak mechanical resonance at ~10 MHz.

We packaged and assembled the photonic and electronic system using a range of commercial and custom-built mechanical and electrical components. For optical inputs, a 20-mode optical fiber array was mounted to deliver light to all 16 input and output channels in addition to 4 calibration ports. Electrical signals were generated from two commercial boards embedded in a National Instruments PXIe system; each board has 32 channels of arbitrary waveform generation to drive the 56 electrical inputs, with each channel providing +/−25 V. All voltages are individually programmable from a laptop using custom drivers and software interfacing with a National Instruments PXIe system. Before implementing photonic circuit configurations, we calibrated all 28 MZIs with the aid of the on-chip power monitors. See Supplementary Methods for more details of the electronic controls and photonic circuit calibration.

Quantum entanglement circuits for a cubic lattice unit cell

We programmed the 8-mode MZM to perform the optical links for optically-heralded quantum entanglement (OHQE) as follows. Any particular OHQE circuit must fulfill the roles of optical phase control of all inputs, an optical routing network, and 50:50 beam splitters before the detector bank. Phase control of each input is achieved on-chip by the external phase shifters of the first column of the MZM. The optical routing function is implemented as part of the first seven columns of the MZM using two MZI settings: a bar state (equivalent to the identity operator \(\hat I\)), and a cross state (equivalent to the Pauli-X operator \(\hat X\)). However, because of the difficulty of reaching a perfect cross state due to fabrication errors in the passive directional couplers of each MZI46,47, we instead implement cross states by configuring two MZIs acting together for an error-corrected cross setting (labeled \(\hat H - \hat H\))46. The final column of the MZM is programmed as four separate Hadamard gates, labeled \(\hat H\), which act as the path-erasing beam splitters. By configuring the columns of the MZM in this way, any of the photonic circuit’s input channels can be routed to any of the output Hadamards for an entanglement operation.

We focus on a particular subset of connections out of the \(\left( {\begin{array}{*{20}{c}} 8 \\ 2 \end{array}} \right) = 28\) possible connections, whose OHQE circuit diagrams (1)-(4) are shown in Fig. 3a–d, respectively. Each circuit mixes four unique pairs of input channels, which results in a total of 16 possible connections for the four OHQE circuit configurations in Fig. 3. By illustrating these 16 optical links as lattice bonds and the input channels as lattice nodes (Fig. 3e), we see they are equivalent to a 3D cubic lattice unit cell with four additional (optional) connections.

Fig. 3: Optically-heralded quantum entanglement (OHQE) circuit configurations.
figure 3

ad OHQE circuit diagrams labeled (1)–(4) with error-corrected crossing gates for the four circuits. Each circuit routes a pair of inputs to the output Hadamard gates, enabling photon-mediated quantum entanglement protocols. e Connectivity generated between the 8 inputs using circuits (1)–(4), forming a cubic lattice unit cell. Connections between inputs (1,4), (2,3), (5,8), and (6,7) are optional for the purposes of generating the unit cell.

Using a coherent laser at 725 nm wavelength, we experimentally characterized the performance of the four OHQE circuits in Fig. 3 with several metrics. First, each circuit was fully programmed by setting calibrated voltages on all devices. We then characterized the optical routing efficiency by sending in one optical input at a time to collect input / output vector relations with corrections accounting for output channel grating efficiencies (see Methods). We calculated the unitary magnitude fidelity F(N) performed by each circuit (N) using the Hilbert-Schmidt inner product48 (Eq. 1).

$$F^{\left( N \right)} = \frac{1}{8}{{{\mathrm{Tr}}}}\left( {\left. {|\hat U^{\dagger} _{{{{\mathrm{ideal}}}}}||\hat U_{{{{\mathrm{exp}}}}}|} \right)} \right)$$
(1)

Lastly, we measured the infidelity induced by the PIC for an optically-heralded entanglement attempt by sending light in two optical inputs labeled (i, j), each pair corresponding to one of the four possible optical links per circuit. After balancing the input powers Ii = Ij = I0 to each channel, we used the external phase shifters on the very first column of the MZM to sweep the optical phase between the two inputs, which we define as αij. The resulting interference patterns at the corresponding output Hadamard mixing the input states (i, j) are given in Eqs. 2 and 349.

$$I_n/I_0 = \left| {u_{ni}} \right|^2 + \left| {u_{nj}} \right|^2 + 2\left| {u_{ni}\parallel u_{nj}} \right|{{{\mathrm{cos}}}}\left( {\alpha _{ij}} \right)$$
(2)
$$I_m/I_0 = \left| {u_{mi}} \right|^2 + \left| {u_{mj}} \right|^2 + 2\left| {u_{mi}\parallel u_{mj}} \right|{{{\mathrm{cos}}}}\left( {\alpha _{ij} + \phi _{mj}} \right)$$
(3)

Here, In, Im are the optical powers of output channels (n,m) respectively and \(u_{mj} = \left| {u_{mj}} \right|e^{i\phi _{mj}}\) is the magnitude and phase of the m, j unitary element. The on-chip control of αij compensates for phase mismatches between different channels as well as to measure the interference contrast of the outputs of each Hadamard gate. The maximum contrast is related to the optical link fidelity \(F_{ij}^ \pm\) (Eq. 4), which is the heralded Bell state fidelity in the computational states after assuming perfectly indistinguishable photons emitted from identical atomic memories and no other sources of error.

$$F_{ij}^ \pm = \left( {\frac{1}{{1 + C_{ij}^ \pm }}} \right)^{1/2}$$
(4)

\(C_{ij}^ \pm\) is the interference contrast between a two input channel pair (i, j) seeking to make the entanglement link, defined in Eqs. 5 and 6. We label the contrast of output channel n with the superscript+ (channel m with superscript −) to match the notation of the heralded +/−Bell states.

$$C_{ij}^ + = \min\left( {I_n} \right)/\max\left( {I_n} \right)$$
(5)
$$C_{ij}^ - = \min\left( {I_m} \right)/\max\left( {I_m} \right)$$
(6)

The measured performance of the four OHQE circuits is shown in Fig. 4, which shows the ideal and measured unitary magnitudes as well as the interference patterns of the 16 optical links. The unitary magnitude fidelities (calculated from Eq. 1) give a measure of the photon routing efficiency and range from 0.902 in circuit (3) to 0.969 in circuit (1). The 5-curve averages of the measured phase sweep interference patterns In and Im are also plotted for each circuit, with error bars of ±1 standard deviation shown as the light shaded region. Based on the 32 interference curves, the optical link fidelities \(F_{ij}^ \pm\) range from 0.971 (\(F_{37}^ +\)) to 0.998 (\(F_{34}^ -\) and \(F_{57}^ +\)), with an average fidelity of 0.991 ± 0.0063. The primary cause of routing infidelity stems from small loss imbalances from fabrication variances between the numerous optical paths, which affect the performance of both individual MZI gates and the error-corrected crossing gates – such errors should be reduced with continued improvements in the PIC fabrication process. The optical link fidelities, in contrast, remain high as they take advantage of heralding and post-selection inherent in the remote-entanglement protocol25. We also note the optical link fidelities measured here likely overestimates the infidelity caused by the MZM alone, as we attribute all other minor errors in the experiment (polarization and power mismatch, phase and temperature drifts) to the PIC itself and not the surrounding experimental apparatus. Despite the non-idealities in the routing network as indicated in the unitary magnitude fidelities, the high optical link fidelities can be maintained without crosstalk between emitters by executing the entanglement protocols on the four input pairs sequentially, with a delay on the order of the emitted photon lifetime and without full circuit reconfiguration. In addition, entanglement purification using ancilla qubits50 can improve the ~99% link-limited fidelity to local-gate limited, sub-threshold fidelity within a few steps. See Methods and Supplementary Methods for the additional detailed derivations and experimental procedures.

Fig. 4: Fidelities of the four programmed OHQE circuits.
figure 4

a Color map of ideal and experimental unitaries and the measured unitary fidelity of circuit (1). b Measured intensity at the four output pairs of Hadamard operations of circuit (1) while performing an input phase sweep. Optical inputs and outputs are labeled with the convention (A,B), where A and B are port numbers. The resulting link fidelities \(F_{ij}^ \pm\) of each input pair are displayed. ch are the measurements in a, b but for circuits (2), (3), and (4) respectively, demonstrating 16 independent connections. The average optical link fidelity of all 32 interference curves is 0.991 ± 0.0063.

Discussion

Advancements in reliable photonic fabrication technology, design, and packaging can further improve the viability of applying PICs to network-based quantum technologies. Current operating voltages (~25 V) can be decreased by substituting AlN for scandium AlN (ScAlN), increasing the piezoelectric coefficient up to a factor of 551. The PIC’s low power consumption42,43, aided by decreased resistances of the aluminum on-chip routing metal at cryogenic temperatures, allows flexibility in choosing the number of components inside and outside the cryostat. For faster modulation of the cantilever phase shifters, reducing the driving RC constant and engineering the mechanical resonance44 (~10 MHz in the 8-mode MZM) should both increase reconfiguration rates of the PIC. While current on-chip losses (−2.33 dB per depth of MZI) do not necessarily reduce entanglement fidelity52, losses may be improved to increase entanglement efficiency by refining the fabrication. We note the loss of the SiN waveguide (~0.4 dB/cm) is much lower than the propagation loss per MZI (~2 dB/cm). Based on microscopy of our fabrication process, we believe further improvements in the PIC’s AlN and Al layers can mitigate uneven film quality, reducing scattering and absorption in the SiN layers above. Entanglement efficiencies may also be improved with a dedicated PIC design53 for the OHQE circuits of interest, or taking advantage of resonant structures44,54. Broadband visible wavelength detector integration55, scalable off-chip packaging solutions56, and CMOS electronic co-integration57 would also eliminate additional bulk packaging and electronic components.

The operation of the MZM as part of the broader modular architecture confers several advantages. The photonic circuits are compatible with CMOS fabrication standards, allowing further scaling of the channel size of each module in addition to realistic mass-production of the necessary number of PICs for the full quantum computer or network. The N-atom control chiplet is also fully modular, allowing flexible implementations and interfacing of atom-based qubits such as heterogeneously integrated diamond nanostructures23,41 or nanowaveguide-to-free-space connections for high-efficiency collection. More broadly, the versatility of the modular construction allows use of full connectivity and z-basis measurements for construction of other lattice shapes as cluster states for measurement-based quantum computing (MBQC)58,59,60. MBQC with cluster states has intrinsic advantages in handling non-deterministic entangling gates61, enabling not only quantum error correction codes through foliation62, such as surface codes with the Raussendorf lattice63, but also making use of the additional time dimension for a higher tolerance to errors61,64. In principle, our modular architecture also supports high-dimensional codes such as 3D surface codes65 and 3D gauge color codes66 in the MBQC framework. These codes have additional advantages such as single-shot error correction67 and transversal non-Clifford gates by gauge fixing66, which can greatly reduce the resource overhead of fault-tolerant quantum computation. See Supplementary Discussion for additional information on diamond nanostructure integration and cluster state generation.

Methods

Optical link fidelities between Bell states

Following previously reported unitary characterization49,68 and photon-mediated entanglement25 work, we derive the expected Bell state fidelities when a single-photon heralding protocol is performed on our PIC and their relation to the experimentally measured interference contrast as follows. We define the two orthonormal spin states \(\left. {| \uparrow _i} \right\rangle\) as the bright state and \(\left. {| \downarrow _j} \right\rangle\) as the dark state, where i and j are indices of the corresponding optical input of the 8 × 8 MZM. After spin initialization, microwave pulse application, and photon emission, the unnormalized state of the two-spin system is

$$\left. {|\psi _{ij}} \right\rangle = \left[ {\left. {| \uparrow _i \downarrow _j} \right\rangle \hat a_i^{\dagger} + \left. {| \downarrow _i \uparrow _j} \right\rangle \hat a_j^{\dagger} } \right]\left\{ {\left. {|0} \right\rangle } \right\} + ...$$
(7)

Here, \(\hat a_i^{\dagger}\) is the creation operator for a photon in the input optical mode i and \(\left\{ {\left. {|0} \right\rangle } \right\}\) is the set of orthonormal vacuum Fock states for all output modes. These operators transform according to the relation

$$\hat a_i^{\dagger} = \mathop {\sum }\limits_{k = 1}^8 u_{ki}\hat b_k^{\dagger}$$
(8)

where uki are the unitary elements performed by the 8 × 8 circuit and \(\hat b_k^{\dagger}\) is the creation operator for a photon in the output optical mode k. We define the indices n and m to represent the two optical output channels on which both inputs i and j are mixed. Upon detection of a single photon on channel n (or m) and assuming no dark counts or double photon emissions), the state becomes

$$\left. {|\psi _{ij}} \right\rangle _n = \frac{{\hat{P}_n\left. {|\psi _{ij}} \right\rangle }}{{\sqrt {\left\langle {\psi _{ij}|\hat{P}_n|\psi _{ij}} \right\rangle } }} = \frac{1}{{\sqrt {(|u_{ni}|^2 + |u_{nj}|^2)} }}\left[ {\left. {| \uparrow _i \downarrow _j} \right\rangle \left. {u_{ni}|1_n} \right\rangle + \left. {| \downarrow _i \uparrow _j} \right\rangle u_{nj}\left. {|1_n} \right\rangle } \right]$$
(9)

where \(\left. {|1_n} \right\rangle\) is the single-photon Fock state for channel n and \(\hat P_n = \left. {|1_n} \right\rangle \left\langle {1_n|} \right.\) is the projection operator. We note that the normalization factor has been applied after heralding and we assume all other terms in Eq. 7 do not contribute to the projection. The target entangled spin state will be one of two possibilities,

$${|{\it{\Psi }}^ + _{ij}} \rangle = \frac{1}{{\sqrt 2 }}\left( {\left. {| \uparrow _i \downarrow _j} \right\rangle + \left. {| \downarrow _i \uparrow _j} \right\rangle } \right)\left. {|1_n} \right\rangle$$
(10)
$${|{\it{\Psi }}^ - _{ij}} \rangle = \frac{1}{{\sqrt 2 }}\left( {\left. {| \uparrow _i \downarrow _j} \right\rangle - \left. {| \downarrow _i \uparrow _j} \right\rangle } \right)\left. {|1_m} \right\rangle$$
(11)

depending on if detector n (+ state) or m (− state) fired. The fidelities of the target entangled state1 are calculated to be

$$F_{ij}^ + = \left| {\left\langle {{\it{\Psi }}^ + _{ij}|\psi _{ij}} \right\rangle } \right| = \left( {\frac{{|u_{ni} + u_{nj}|^2}}{{2\left( {|u_{ni}|^2 + |u_{nj}|^2} \right)}}} \right)^{1/2}$$
(12)
$$F_{ij}^ - = \left| {\left\langle {{\it{\Psi }}_{ij}^ - |\psi _{ij}} \right\rangle } \right| = \left( {\frac{{|u_{mi} - u_{mj}|^2}}{{2(|u_{mi}|^2 + |u_{mj}|^2)}}} \right)^{1/2}$$
(13)

which we define as the optical link fidelity. We characterized these fidelities by using a two input phase sweep measurement49 on the inputs i and j. We swept the external phase shifter on the input MZI of our circuit to adjust the phase difference between the two optical inputs, which we define as αij. The interference pattern at the output channels of interest n, m are given by the relations

$$I_n = |u_{ni}|^2I_i + |u_{nj}|^2I_j + 2\sqrt {I_iI_j} |u_{ni}||u_{nj}|{{{\mathrm{cos}}}}(\phi _{ni} - \phi _{nj} - \alpha _{ij})$$
(14)
$$I_m = |u_{mi}|^2I_i + |u_{mj}|^2I_j + 2\sqrt {I_iI_j} |u_{mi}||u_{mj}|{{{\mathrm{cos}}}}(\phi _{mi} - \phi _{mj} - \alpha _{ij})$$
(15)

where Ii,j and In,m are the input and output optical powers respectively and \(u_{nj} = |u_{nj}|e^{i\phi _{nj}}\) is the magnitude and phase of the n, j unitary element. We approximate Ii ≈ Ij = I0, which assumes all errors originate from the unitary elements themselves. Experimentally, this is nominally true due to our balancing the input intensity, but there may still remain small imbalances in the input powers or polarization imperfections. Thus, this approach puts an upper bound on the PIC-limited errors. For each sweep, we set the phases \(\phi _{ni},\phi _{nj},\phi _{mi} = 0\) without loss of generality by absorbing them into our input and output basis vectors68. Our interference expressions now reduce to

$$I_n/I_0 = |u_{ni}|^2 + |u_{nj}|^2 + 2|u_{ni}||u_{nj}|{{{\mathrm{cos}}}}(\alpha _{ij})$$
(16)
$$I_m/I_0 = |u_{mi}|^2 + |u_{mj}|^2 + 2|u_{mi}||u_{mj}|{{{\mathrm{cos}}}}(\alpha _{ij} + \phi _{mj})$$
(17)

We define the interference contrasts as

$$C_{ij}^ + = \min(I_n)/\max(I_n) = \frac{{(|u_{ni}| - |u_{nj}|)^2}}{{(|u_{ni}| + |u_{nj}|)^2}}$$
(18)
$$C_{ij}^ - = \min(I_m)/\max(I_m) = \frac{{(|u_{mi}| - |u_{mj}|)^2}}{{(|u_{mi}| + |u_{mj}|)^2}}$$
(19)

Finally, we rewrite the optical link fidelity expressions in terms of the interference contrast after incorporating the fact the redundant phases \(\phi _{ni},\phi _{nj},\phi _{mi}\) have been set to zero.

$$F_{ij}^ + = \frac{1}{{\sqrt 2 }}\left( {1 + \frac{{1 - C_{ij}^ + }}{{1 + C_{ij}^ + }}} \right)^{1/2}$$
(20)
$$F_{ij}^ - = \frac{1}{{\sqrt 2 }}\left( {1 - {{{\mathrm{cos}}}}(\phi _{mj})\frac{{1 - C_{ij}^ - }}{{1 + C_{ij}^ - }}} \right)^{1/2}$$
(21)

Here we see the role of ϕmj (the phase of the bottom right element of each 2 × 2 Hadamard gate, theoretically equal to π) in determining the phase difference of the heralded Bell states. Due to the imperfect routing operations of the circuit, the unitary phase may not be exactly equal to π. However, because the phase sweep measurement fully characterizes the phase ϕmj, this can be corrected as part of a subsequent Bloch sphere rotation on the \({|{\it{\Psi }}_{ij}^ - } \rangle\) spin state45. Thus for the purposes of calculating the optical link fidelity upon detection on port m, we modify the target state \({|\Psi _{ij}^ - } \rangle\) to include the phase of umj

$${|{\it{\Psi }}_{ij}^ - } \rangle = \frac{1}{{\sqrt 2 }}\left( {\left. {| \uparrow _i \downarrow _j} \right\rangle + e^{ - i\phi _{mj}}\left. {| \downarrow _i \uparrow _j} \right\rangle } \right)\left. {|1_m} \right\rangle$$
(22)

such that the optical link fidelity now reads

$$F_{ij}^ - = \left| {\left\langle {{\it{\Psi }}_{ij}^ - |\psi _{ij}} \right\rangle } \right| = \left( {\frac{{(|u_{mi}| + |u_{mj}|)^2}}{{2(|u_{mi}|^2 + |u_{mj}|^2)}}} \right)^{1/2}$$
(23)

The final optical link fidelities are now dependent only on the interference contrast achieved in each detected channel. We rewrite Eqs. 23 and 20 as

$$F_{ij}^ \pm = \left| {\left\langle {{\it{\Psi }}_{ij}^ \pm {{{\mathrm{|}}}}\psi _{ij}} \right\rangle } \right| = \left( {\frac{1}{{1 + C_{ij}^ \pm }}} \right)^{1/2}$$
(24)

The parameters \(C_{ij}^ \pm\) are extracted from each phase sweep measurement and inserted into Eq. 24 to calculate each channels’ respective fidelities.

Unitary fidelities

We estimate the unitary magnitude fidelity of our circuit as follows. We combined the extracted parameters from the phase sweep measurement above with additional intensity measurements to generate the experimental 8 × 8 matrix \(\hat U_{{{{\mathrm{exp}}}}}\). For each of the entanglement generating circuits, we sent light on only one optical I/O at a time and recorded the output vector, which represents one column of the total matrix. Next, we applied a correction factor to each output pair n,m to compensate for different output coupling efficiencies, defined as

$$\gamma _{nm} = \max(I_n)/\max(I_m)$$
(25)

where the values of In, Im are taken from the previous phase scan measurement. We then normalized each channel in this measurement to the total detected power to estimate the unitary magnitudes,

$$I_{{{{\mathrm{tot}}}}} = \mathop {\sum }\limits_{k = 1}^8 I_k$$
(26)
$$|u_{nj}| \approx \sqrt {I_n/I_{{{{\mathrm{tot}}}}}}$$
(27)

We repeated this procedure for all optical inputs, thus characterizing all elements in our 8 × 8 matrix. The unitary fidelity is then simply calculated via the Hilbert–Schmidt inner product (Eq. 28).

$$F^{\left( N \right)} = \frac{1}{8}{{{\mathrm{Tr}}}}\left( {\left. {|\hat U^{\dagger} _{{{{\mathrm{ideal}}}}}||\hat U_{{{{\mathrm{exp}}}}}|} \right)} \right)$$
(28)

where \(\hat U_{{{{\mathrm{ideal}}}}}\) is the target unitary for entanglement circuit (N).