## Abstract

The advances in fabrication processes in different material platforms employed in integrated optics are opening the path towards the implementation of circuits with increasing degrees of complexity. In addition to the more conventional application specific photonic circuit paradigm, the programmable multifunctional photonics (PMP) approach is a transversal concept inspired by similar approaches, which are already employed in other technology fields. For instance, in electronics, field programmable gate array devices enable a much more flexible universal operation as compared to application specific integrated circuits. In photonics, the PMP concept is enabled by two-dimensional (2D) waveguide meshes for which the number of possible input/outputs ports quickly builds up, and, furthermore, internal signal flow paths make the computation of transfer functions an intractable problem. Here we report a scalable method based on mathematical induction that allows one to obtain the scattering matrix of any 2D integrated photonic waveguide mesh circuit composed of an arbitrary number of cells and that is easily programmable. To our knowledge this is the first report of the kind, and our results open the path to unblocking this important design bottleneck.

© 2019 Optical Society of America under the terms of the OSA Open Access Publishing Agreement

## 1. INTRODUCTION

Programmable multifunctional photonics (PMP) aims at designing common integrated optical hardware configurations, which can implement a wide variety of functionalities by suitable programming [1–10]. Several authors [6,7,9,10] have reported theoretical work proposing different configurations and design principles based on the cascade of either beamsplitters [7,9,10] or integrated Mach–Zehnder Interferometers [6] (MZIs). A more versatile architecture can be obtained by following similar principles to those of the field programmable gate arrays (FPGAs) in electronics [1–5]. The core concept is to break down complex circuits in a large network of identical unit cells implemented by means of a two-dimensional (2D) waveguide mesh or lattice. Different functionalities are then achieved by selecting the adequate path through the mesh. 2D integrated waveguide meshes formed by replicating square [2], hexagonal [1,3,5], or triangular [1] unit cells provide the required regular and periodic geometries, where each side of the basic cell is implemented by two waveguides coupled by an independent (power splitting and phase) tunable basic unit (TBU). Several simple configurations with a reduced number of cells (i.e., up to 7) have recently been reported, providing solid proofs of concept [3] and demonstrating the capability of implementing both traditional signal processing architectures as well as arbitrary linear matrix transformations, which are at the heart of most applications targeted for photonic chips. For instance, in quantum information, $N\times N$ unitary transformations support the implementation of simple and complex logic gates [11–17], the emulation of boson sampling [18–20], and circuits and quantum lab-on-a-chip [21], to cite a few applications. Waveguide meshes open the path for reconfigurable large-scale integrated quantum information systems with the potential to supersede current approaches based on static configurations [22]. In computer processor interconnections, reconfigurable broadband inter-processor and computer interconnections are fundamental in high-performance computing and data centers [23]. Photonic linear transformations provide a clean, interference-free, and high-speed option for core processor resource management [24]. In optical signal processing, linear transformations that can be supported by PMP processors based on 2D waveguide meshes include several operations that are central to optical signal processing, such as the optical FFT [25], Hilbert transformation [26], and integrators and differentiators [27,28]. In neurophotonics, unitary ($N\times M$) and non-unitary ($N\times M$) matrix transformations are fundamental building blocks preceding nonlinear threshold operations in neural networks and spike and reservoir computing [29,30]. The availability of PMP processors opens an interesting and exciting research avenue in this emerging field. In biophotonic sensing, PMPs support simple and multiple input/multiple output (MIMO) interferometric structures for lab-on-a-chip enabling the future implementation of multiparameter integrated photonic sensing [31,32]. Finally, but not least important, in advanced physics, waveguide mesh PMP provides a programmable 2D platform to implement different topological systems such as multi-ring cavity structures to support research in synthetic dimensions [33] and devices based on topological insulator principles [34,35].

The extension of 2D waveguide meshes to account for an increased number of cells and therefore to implement more complex structures including a higher number of TBUs ($>80$) is desirable, as this will dramatically expand the number of functionalities that can be implemented with a given hardware configuration. Several physical and design limitations have to be overcome. For programmable photonics circuits based on waveguide mesh arrangements, it is essential to develop a tool that helps us to check their viability when employing current fabrication techniques and imperfect photonic components, as well as to provide a means for carrying statistical analysis of their targeted performance [2,3,5]. To the best of our knowledge, no analysis methods for fully programmable PICs have been reported that can model arbitrary circuits involving both feedforward and feedbackward configurations. A correct spectral characterization calls for a scattering matrix [36–38] method, but the main difficulty resides in the fact that the complexity of the system increases with the number of units to be connected. This is due first to the increment in the number of elements of the scattering matrix (one column and one row per new port) and second and more importantly from the computational point of view to the increase in the increased coupling of the internal interconnections in the 2D structure, modifying every single element in the scattering matrix and thus making in appearance this problem analytically intractable.

Mathematical induction (MI) is a technique that can be employed to prove some particular rule or pattern, usually infinite or arbitrarily large [39]. It is based on two steps, the base step, where a simple case is established, and an induction step, which involves showing that an arbitrary large example follows logically from a slightly smaller one. In mathematical terms, the principle of induction states that for a fixed integer $b$ and for each integer $n\ge b$, let $S(n)$ be a statement involving $n$. If (i) $S(b)$ is true and (ii) for any integer $k\ge b$, $S(k)\to S(k+1)$, then for all $n\ge b$, the statement $S(n)$ is true. This apparently simple principle conceals in fact a very strong proof technique that finds applications in a myriad of fields including [39] probability, geometry, game theory, graph theory, systems complexity, and artificial intelligence. In particular MI is very attractive for probing very general and powerful results about large count and infinite structures.

Here we report a scalable method based on mathematical induction that allows one to obtain the analytic scattering matrix of any 2D integrated photonic waveguide mesh circuit composed of an arbitrary number of cells and that is easily programmable. To our knowledge this is the first report of the kind, and our results open the path to unblocking this important design bottleneck. The method not only provides all the desired input/output transfer functions, but also allows us to design the unused regions of the waveguide mesh so that they can be employed to manage undesired contributions from reflected and crosstalk signals and thus optimize the chip performance. Furthermore, it allows us to study all the input/output responses as the internal parameters of the TBUs are changed opening the path for error evaluation via Monte Carlo simulations and the incorporation of machine learning algorithms for circuit self-correction. Although the procedure proposed here is developed for a hexagonal waveguide mesh, it can be applied to any uniform 2D mesh topology.

## 2. METHODS

In photonics, the PMP concept is enabled by 2D waveguide meshes formed by replicating square, hexagonal [1,3,5], or triangular [1] unit cells. Each side of the unit cell is implemented by two waveguides coupled by an independent (power splitting and phase) TBU. This element can be implemented by means of tunable 3 dB MZIs or by a dual-drive directional coupler and described by a $4\times 4$ scattering matrix ${H}_{\mathrm{TBU}}$. For the current method, we will not consider the back-reflections with origin inside the TBU. They are mainly related to waveguide scattering and are typically negligible compared to the waveguide mesh contributions coming from optical crosstalk and non-ideal TBU configurations ($<-30\u201340\text{\hspace{0.17em}}\mathrm{dB}$). This results in a simplified $4\times 4$ scattering matrix, where 8 of its 16 coefficients are zero. In the case of hexagonal waveguide meshes, the basic building block or trilattice is formed by three TBUs ($A$, $B$, and $C$) connected in a $Y$ configuration as shown in Fig. 1(a). The trilattice is described by a $6\times 6$ scattering matrix computed from the three scattering matrices ${H}_{\mathrm{TBU}}$ describing its internal TBUs. To aid in the graphical illustration of the method, we will employ a triangle symbol to represent the trilattice, where each port has, in principle, internal connections to the four opposite ports (i.e., port 1 to ports 3,4,5,6, etc.). The trilattice can be replicated and distributed $N$ times to generate any desired hexagonal mesh arrangement of any size. For example, Figs. 1(b) and 1(c) show the process leading to the construction of a single hexagonal cell composed of three trilattices (we employ the notation ${A}_{i}$, ${B}_{i}$, ${C}_{i}$ to identify the TBUs that compose trilattice $i$). Even for the simplest structure representing the unit cell, one already has 12 input/output ports and six intermediate auxiliary nodes required for the computation of the $12\times 12$ (i.e., 144 element) transfer matrix. With an increasing number of cells, the above figures show a drastic increase. For instance, the four-cell structure shown in Fig. 1(d), which is still a low-complexity structure, features 20 input/output ports, 38 internal nodes, and a $20\times 20$ (i.e., 400 element) scattering matrix. Figure 1(e) provides the exact input/output port count and the internal nodes as a function of the number of hexagonal cells. It clearly shows that the analytic derivation of scattering matrices for 2D meshes becomes apparently intractable even for a very low cell count. Moreover, numerical methods to analyze circuit responses such as finite-difference time-domain (FDTD) and eigenmode solvers do not scale well as the number of components in the photonic circuit increases.

We propose here a method for the analytic determination of the full scattering matrix of waveguide meshes composed of an arbitrary number of hexagonal cells. The method uses mathematical induction and is based on increasing 2D hexagonal waveguide meshes formed by $n-1$ trilattices by adding an extra trilattice unit. Formally the method is stated in the following way. A 2D structure formed by one trilattice is described by a unitary scattering matrix $H(1)$ with known coefficients. Then, if a 2D structure formed by $n-1\ge 1$ trilattices is described by a unitary scattering matrix $H(n-1)$ with known coefficients, the structure composed of $n$ trilattices obtained from appending an additional trilattice $H(1)$ to the former is described by a unitary scattering matrix $H(n)$ with known coefficients.

This method allows the sequential derivation of the scattering matrix of an $n$th-order arbitrary hexagonal waveguide mesh using the scattering matrix of the previous lower order mesh $H(n-1)$ and that of the newly added trilattice $H(1)$. Its final computation will depend on how the additional trilattice is connected to the previous lower order mesh. Four different interconnection scenarios can be identified, as shown in Figs. 2(a)–2(d), depending on the number of ports that are interconnected and the number of new complete hexagonal cells that appear after incorporation of the new trilattice:

*Scenario 0:* This is the simplest case and the starting point in the generation of a new mesh design. Here, only one out of the six ports that define the trilattice is connected to the previous mesh ports. The addition of the new trilattice increases the number of mesh ports by four, increasing the number of rows and columns in the scattering matrix, correspondingly.

*Scenario 1:* Here, the addition of the new trilattice increases the number of mesh ports by two, but the number of complete hexagonal cells does not increase.

*Scenario 2:* Here, the addition of the new trilattice increases the number of ports by two and the number of complete cells by one.

*Scenario 3:* In this case, the addition of the new trilattice does not increase the number of ports, since it connects three ports to the previous mesh, and the number of complete cells is increased by one.

The detailed steps to be taken in each case and the resulting equations leading to the final scattering matrix $H(n)$ are provided in Supplement 1, including a pseudocode for easing the programming.

#### A. Implementation

The method has been implemented using a script in MATLAB that takes into account the four different scenarios for increasing the waveguide mesh by one trilattice unit. For each case, the relevant analytical equations and the pseudocode derived in Supplement 1 are employed.

#### B. Monte Carlo Simulations

For the Monte Carlo simulations, we ran 1000 iterations. The insertion loss of the TBUs is kept fixed to a value of 0.2 dB unless specified. For each iteration, the value of each TBU coupling factor is selected from a normal distribution with average value corresponding to the originally programmed value for ideal operation and a standard deviation specified for each simulation (ranging from 0.5% to 2%). Unless specified, overall TBU phase variations are kept fixed to 0.

## 3. RESULTS

To illustrate the method of analysis, we have chosen a waveguide mesh composed of 18 hexagonal cells built upon assembling 27 trilattices as shown in Fig. 3(a). This structure, which has around twice the number of cells as those corresponding to the current state of the art, features 40 input/output ports and 122 intermediate ports. Input/output ports are numbered clockwise. To estimate the order of magnitude involved and the complexity in characterizing this mesh, each programming results in a $40\times 40$ matrix with up to 1600 elements for each operation wavelength—in other words, $1600\times {W}_{p}$ potential complex-valued transfer functions when the optical spectrum is swept over ${W}_{p}$ wavelength points.

#### A. Single Wavelength Analysis

We first show the application of the method when a single wavelength operation is considered. We programmed the mesh to implement two multiport rectangular interferometers simultaneously. A $3\times 3$ interferometer is shown inside a blue box, while a $4\times 4$ interferometer is shown in a yellow box. Figure 3(b) shows the circuit layouts for the $3\times 3$ and $4\times 4$ interferometers including the input and output ports in the mesh structure shown in red ink. The coupling factors and phases of the TBUs emulating the interferometers are programmed to implement several transformations (see Supplement 1 for the coefficient tables of the implemented circuits). In the first case, the mesh implements a unitary $3\times 3$ discrete Fourier transform, and a non-unitary $2\times 4$ hybrid commonly employed in coherent receivers:

The latter have no impact over the circuit operation provided that no input signal is fed to these undesired ports. However, some of these can still be employed, and input signals will have no impact over the programmed circuits. This information is provided in the 2D matrix maps. For instance, Fig. 3(c) shows that no input signal can be allowed in ports 12 and 13 for the correct operation of the hybrid, while input signals from ports 3, 5, 7, 9, etc., will have no impact.

In the second case, the mesh is programmed to implement a $3\times 3$ beamsplitter and a $4\times 4$ Hadamard transformation:

#### B. Full Spectral Analysis

The more powerful and versatile characteristics of the analytic method are, however, unleashed when using it for spectral characterization. Here, the wavelength (or frequency) dimension is added and truly spectral transfer functions are immediately provided in a few seconds. Figure 4(a) shows, as an example, the layout of the programmed waveguide mesh to implement a side coupled integrated spaced sequence of resonators (SCISSOR) filter composed of five cascaded ring resonators with 6-BUL cavity length (see Supplement 1 for the programming table of the phase shifters). Figure 4(b) shows the emulated circuit layout, where the input port (16) and the output port (34) are marked in red ink. Within each ring cavity, one TBU in bar state (B4, B6, B13, B15, and B22) is employed as a phase shifter to provide additional resonance displacements (${\varphi}_{1}$, ${\varphi}_{2}$, ${\varphi}_{3}$, ${\varphi}_{4}$, and ${\varphi}_{5}$) if required with respect to that set by the cavity free spectral range. The ring couplers are implemented by TBUs set in tunable coupler mode (B3, B7, B12, B16, and B21). For practical reasons, all of them are set to provide the same coupling constant $K$. The input signal vector is $I=({i}_{1},{i}_{2},\dots {i}_{40})$, where ${i}_{k}=0$ unless $k=16$ and ${i}_{16}=1$. The upper trace of Fig. 4(b) plots the moduli of the 40 transfer functions obtained after multiplying the $40\times 40$ matrix of spectral transfer functions (each transfer function is computed for 1001 different wavelengths) by the input vector I for the case in which $K=0.2$ and ${\varphi}_{1}={\varphi}_{2}={\varphi}_{3}={\varphi}_{4}={\varphi}_{5}=0$. Note that the wavelength axis is normalized to the length of a single TBU. As expected, only one transfer function (corresponding to the matrix coefficient ${h}_{34,16}$) is relevant, while the other 39 represent noisy contributions due to the undesired signal leakage from input port 16 to the rest of the output ports. Note that an optical crosstalk of $-20\text{\hspace{0.17em}}\mathrm{dB}$ has been assumed for this example. This information is, however, very useful as it will be shown later when optimizing the mesh performance to decrease the impact of crosstalk. The phase response of ${h}_{34,16}$ is shown in detail in the intermediate trace of Fig. 4(b), while the lower trace illustrates the spectral response ${h}_{34,16}$ for two different cases in which the SCISSOR parameters are changed. In the first (red trace), $K=0.2$ in all the rings and the ring resonances are slightly detuned, ${\varphi}_{1}=-0.12$, ${\varphi}_{2}=-0.06$, ${\varphi}_{3}=0$, ${\varphi}_{4}=0.06$, and ${\varphi}_{5}=0.12$, to reduce the filter bandpass and main to secondary sidelobes. In the second (yellow trace), the coupling constants are apodized, ${K}_{1}=0.39$, ${K}_{2}=0.47$, ${K}_{3}=0.55$, ${K}_{4}=0.63$, and ${K}_{5}=0.71$, and the ring resonances are strongly detuned, ${\varphi}_{1}=-0.4$, ${\varphi}_{2}=-0.2$, ${\varphi}_{3}=0$, ${\varphi}_{4}=0.2$, and ${\varphi}_{5}=0.4$. The obtained results using the inductive method are in exact coincidence with those resulting from typical matrix multiplication of ring cavities. Note that while having a single input signal fed to the mesh activates only 40 input/output responses, the method directly calculates 1600 potential transfer functions, each of them with 1000 spectral points in a few seconds. (See Supplement 1 for the programming of a wider set of examples.)

#### C. Multiparameter Error Analysis

The most important sources of impairment in the operation of waveguide mesh circuits derive from the fact that either imperfect components are obtained as a result of the fabrication process or the setting values for the structure phase shifters depart from the ideal values required by design [40–42]. In either case, these result in deviations from the targeted circuit performance. Typical errors in component fabrication are connected with departure from the 50/50 power splitting ratio of 3 dB couplers employed to implement MZI-based TBUs and the imprecise settings of the waveguide mesh phase shifters. To evaluate the impact that this effect has on the circuit performance, one has to resort to Monte Carlo analysis, where the operation of each TBU can be modeled by two Gaussian random variables centered at its ideal setting and featuring a standard deviation ${\sigma}_{K}$ and ${\sigma}_{\varphi}$ accounting for random fluctuations around the mean of the coupling coefficient ($K$) and phase term ($\varphi $), respectively. (See Supplement 1 for the TBU modeling details.) This process is quite time consuming and has been applied, to our knowledge, only to feedforward waveguide mesh circuits with a certain degree of complexity [41,42]. Our analytic method speeds up this analysis allowing for 1000 realizations in a few seconds. Furthermore, it is applicable to both feedforward and feedbackward circuits as both can be emulated by the waveguide mesh. As an example, Fig. 5 shows the results of a Monte Carlo analysis for a feedforward/feedbackward circuit. The mesh is programmed to implement a double ring loaded MZI filter that is employed to implement a maximally flat passband Butterworth and Bessel type filter [43,44]. Figure 5(a) depicts the waveguide mesh programming to implement the circuit layout shown in Fig. 5(b). Phase shifter coefficients for ideal operation are provided in Supplement 1, and the results of the Monte Carlo analysis after 1000 realizations are shown in Figs. 5(c)–5(e). Each TBU coupling constant is modeled by means of a Gaussian random variable centered at a mean value corresponding to its ideal setting and featuring a typical [41,42] value for the standard deviation ${\sigma}_{K}=1\%$ accounting for random fluctuations around the mean. It should be noted here that the Monte Carlo analysis considers both the spatial and spectral behavior of the mesh, although here only the transfer function ${h}_{36,15}$ is displayed, so the input vector to the waveguide mesh is, in this case, $I=({i}_{1},{i}_{2},\dots {i}_{40})$, where ${i}_{k}=0$ unless $k=16$ and ${i}_{16}=1$. Again, each realization takes only a few seconds, as it is based on an analytic method. The results provide very useful insight regarding relevant performance parameters such as the filter’s extinction ratio, insertion losses, and passband ripple, which can be displayed in terms of histograms from which averages and standard deviation values can be extracted. Our method allows not only for the Monte Carlo characterization of feedforward multiport interferometers in a similar way to that reported elsewhere [41,42], but also for complex feedforward and feedbackward configurations as shown by this example. We stress again that all realizations rely on analytic recursive expressions.

#### D. Circuit Performance Optimization

A distinctive feature of the method proposed here is that it provides information related to all the possible signal paths and transfer functions established between input and output ports of the mesh once it has been programmed to implement a given circuit or a simultaneous group of circuits. The mesh is then divided into two parts. One part corresponds to the elements employed to implement the circuits, while the other is composed of the elements that are not needed. This second part of the mesh can either be left as it stands or, more interestingly, it can be employed to improve the performance of the programmed circuits by establishing connections to drain possible sources of crosstalk between the implemented circuits to subsidiary ports. Since the method provides the complete information regarding the waveguide mesh, it can be readily employed to test the impact of the programming of non-essential parts of the mesh in order to optimize its operation. To our knowledge no other method reported so far is able to provide this feature. To illustrate this concept, we consider now an example in which the waveguide mesh is programmed to implement two simple circuits: a three-cavity CROW device [43] and a simple MZI filter. Figure 6(a) depicts the waveguide mesh programming (parameters are provided in Supplement 1) to implement the circuit layouts shown in Fig. 6(b). When both circuits are running in parallel, signal coming from port 17 can partially leak and appear in ports 38 and 39. The crosstalk contributions are obtained from the scattering matrix as ${h}_{38,17}$, ${h}_{39,17}$, ${h}_{23,2}$, and ${h}_{30,2}$, respectively. Moreover, the signal leaking impacts the desired individual responses ${h}_{30,17}$, ${h}_{23,17}$, ${h}_{38,2}$, and ${h}_{39,2}$. This is illustrated in Figs. 6(c) and 6(d), for both the CROW transmission and reflection responses as well as for both outputs of the MZI by means of a Monte Carlo with 1000 realizations and a TBU coupling factor standard deviation (${\sigma}_{K}$) equal to 1%. The analysis results predict crosstalk levels with average figures in the range of $-49.11\text{\hspace{0.17em}}\mathrm{dB}$ to $-43.6\text{\hspace{0.17em}}\mathrm{dBs}$ for the relevant transfer functions of interest when the unused TBUs are assumed to be randomly biased [see Fig. 6(e)]. Moreover, the performance of the circuits is visibly compromised.

By suitable biasing of the unused TBUs (see Supplement 1) the leaking signals can be redirected to drain ports for elimination. For example, we have configured the TBUs placed outside the marked regions in the mesh to achieve the routing of these undesired crosstalk signals to achieve a crosstalk improvement of 20 dB as shown in Fig. 6(f). We ran the test for standard deviation levels ${\sigma}_{K}$ ranging from 0.5% to 2% obtaining a considerable improvement for the crosstalk levels in all the relevant circuit transfer functions as shown in Fig. 6(g) (for the test details, please refer to Section 2). The optimized transfer functions are visibly more robust, as illustrated in Fig. 6(d), relaxing the specifications of each TBU. In addition, the circuit performance could be further improved by monitoring a few outputs and reprogramming the mesh accordingly to maximize the leaked signal evacuation and the isolation between the simultaneously programmed circuits.

#### E. Experimental Verification

An experimental validation of the model is now provided. For this purpose we synthetized and measured different programmed circuit architectures in a seven-cell hexagonal waveguide mesh fabricated in silicon on insulator (see details in [8]). By inserting the data of the experimental measurements carried out in [8], such as the insertion losses of the TBU, the basic unit length, and the coupling and phase factor settings, we obtained a perfect matching after comparing the results with those provided by the model. As an example, Fig. 7 illustrates different experimental (solid) and simulated (dashed) traces for the tuning of both a ring resonator [Figs. 7(a) and 7(b)] and the transmission response of a CROW [Figs. 7(c) and 7(d)]. In the first case, the coupling of B7 was modified while tuning the phase inside the ring resonator. In the second case, the resonance of the upper cavity is slightly detuned and an imperfect bar state is synthetized at TBUA5. Note that the programmed delay is constrained to multiples of the delay associated to one BUL [1]. In the current experimental demonstration, the delay is 13.5 ps [8]. Different technologies and TBU architectures can be used to achieve fixed TBU delays in the range of 4–14 ps with the proper TBU optimization.

## 4. DISCUSSION AND SUMMARY

The proposed method can be extended to other waveguide mesh geometries (square, triangular) reported in the literature. The key point here is to identify the unitary building block upon which the mesh can be built (see Supplement 1 for a description of the unitary building blocks for other cell geometries). It can also be employed for the analysis of triangular and rectangular multibeam feedforward only interferometers. In this case it suffices to emulate the interferometer with the waveguide mesh and program the rest of the mesh to disable any potential signal route outside the physical topology of the interferometer. A final interesting application of the method to be explored in the near future is related to the use of the full scattering matrix as a seed to implement circuit state supervision, smarter optimization, and synthesis algorithms by means of machine learning techniques. This could alleviate the need for individual device monitoring by means of signal tapping or CLIPP-based approaches [40,45].

In summary, we have reported a scalable analytic method based on mathematical induction that renders the full scattering matrix of any 2D integrated photonic waveguide mesh circuit composed of an arbitrary number of hexagonal cells and that is easily programmable. The method not only provides all the desired input/output transfer functions, but also allows us to design the unused regions of the waveguide mesh so that they can be employed to manage undesired contributions from reflected signals and thus optimize the chip performance. Furthermore, it allows us to study all the input/output responses as the internal parameters of the TBUs are changed opening the path for error evaluation via Monte Carlo simulations. We believe that our results open the path to unblocking an important bottleneck in the design of complex photonic circuits and will enable the fast analysis of large (LSI) and very large (VLSI) scale integrated multifunctional photonic circuits based on waveguide meshes.

## Funding

H2020 European Research Council (ERC) (ADG741415 UMWPCHIP); Generalitat Valenciana (PROMETEO 2017/103); European Cooperation in Science and Technology (COST) (CA16220 EUIMWP).

See Supplement 1 for supporting content.

## REFERENCES

**1. **D. Pérez, I. Gasulla, J. Capmany, and R. A. Soref, “Reconfigurable lattice mesh designs for programmable photonic processors,” Opt. Express **24**, 12093–12106 (2016). [CrossRef]

**2. **L. Zhuang, C. G. H. Roeloffzen, M. Hoekman, K.-J. Boller, and A. J. Lowery, “Programmable photonic signal processor chip for radiofrequency applications,” Optica **2**, 854–859 (2015). [CrossRef]

**3. **D. Pérez, I. Gasulla, L. Crudgington, D. J. Thomson, A. Z. Khokhar, K. Li, W. Cao, G. Z. Mashanovich, and J. Capmany, “Multipurpose silicon photonics signal processor core,” Nat. Commun. **8**, 636 (2017). [CrossRef]

**4. **J. Capmany, I. Gasulla, and D. Perez, “Microwave photonics: the programmable processor,” Nat. Photonics **10**, 6–8 (2016). [CrossRef]

**5. **D. Pérez, I. Gasulla, F. J. Fraile, L. Crudgington, D. J. Thomson, A. Z. Khokhar, K. Li, W. Cao, G. Z. Mashanovich, and J. Capmany, “Silicon photonics rectangular universal interferometer,” Laser Photon. Rev. **11**, 1700219 (2017). [CrossRef]

**6. **D. A. B. Miller, “Self-configuring universal linear optical component,” Photon. Res. **1**, 1–15 (2013). [CrossRef]

**7. **D. A. B. Miller, “Self-aligning universal beam coupler,” Opt. Express **21**, 6360–6370 (2013). [CrossRef]

**8. **O. Graydon, “Birth of the programmable optical chip,” Nat. Photonics **10**, 1 (2016). [CrossRef]

**9. **M. Reck, A. Zeilinger, H. J. Bernstein, and P. Bertani, “Experimental realization of any discrete unitary operator,” Phys. Rev. Lett. **73**, 58–61 (1994). [CrossRef]

**10. **W. R. Clements, P. C. Humphreys, B. J. Metcalf, W. S. Kolthammer, and I. A. Walmsley, “Optimal design for universal multiport interferometers,” Optica **3**, 1460–1465 (2016). [CrossRef]

**11. **E. Knill, R. Laflamme, and G. J. Milburn, “A scheme for efficient quantum computation with linear optics,” Nature **409**, 46–52 (2001). [CrossRef]

**12. **P. Kok, W. J. Munro, K. Nemoto, T. C. Ralph, J. P. Dowling, and G. J. Milburn, “Linear optical quantum computing with photonic qubits,” Rev. Mod. Phys. **79**, 135–174 (2007). [CrossRef]

**13. **J. L. O’Brien, A. Furusawa, and J. Vučković, “Photonic quantum technologies,” Nat. Photonics **3**, 687–695 (2009). [CrossRef]

**14. **M. G. Thompson, A. Politi, J. C. Matthews, and J. L. O’Brien, “Integrated waveguide circuits for optical quantum computing,” IET Circuits Devices Syst. **5**, 94–102 (2011). [CrossRef]

**15. **A. Politi, J. Matthews, M. G. Thompson, and J. L. O’Brien, “Integrated quantum photonics,” IEEE J. Sel. Top. Quantum Electron. **15**, 1673–1684 (2009). [CrossRef]

**16. **A. Politi, M. J. Cryan, J. G. Rarity, S. Yu, and J. L. O’Brien, “Silica-on-silicon waveguide quantum circuits,” Science **320**, 646–649 (2008). [CrossRef]

**17. **K. Kieling, J. L. O’Brien, and J. Eisert, “On photonic controlled phase gates,” New J. Phys. **12**, 013003 (2010). [CrossRef]

**18. **J. B. Spring, B. J. Metcalf, P. C. Humphreys, W. S. Kolthammer, X. M. Jin, M. Barbieri, A. Datta, N. Thomas-Peter, N. K. Langford, D. Kundys, J. C. Gates, B. J. Smith, P. G. R. Smith, and I. A. Walmsley, “Boson sampling on a photonic chip,” Science **339**, 798–801 (2013). [CrossRef]

**19. **M. A. Broome, A. Fedrizzi, S. Rahimi-Keshari, J. Dove, S. Aaronson, T. C. Ralph, and A. G. White, “Photonic boson sampling in a tunable circuit,” Science **339**, 794–798 (2013). [CrossRef]

**20. **A. Crespi, R. Osellame, R. Ramponi, D. J. Brod, E. F. Galvão, N. Spagnolo, C. Vitelli, E. Maiorino, P. Mataloni, and F. Sciarrino, “Integrated multimode interferometers with arbitrary designs for photonic boson sampling,” Nat. Photonics **7**, 545–549 (2013). [CrossRef]

**21. **B. P. Lanyon, J. D. Whitfield, G. G. Gillett, M. E. Goggin, M. P. Almeida, I. Kassal, J. D. Biamonte, M. Mohseni, B. J. Powell, M. Barbieri, A. Aspuru-Guzik, and A. G. White, “Towards quantum chemistry on a quantum computer,” Nat. Chem. **2**, 106–111 (2010). [CrossRef]

**22. **N. C. Harris, D. Bunandar, M. Pant, G. R. Steinbrecher, J. Mower, M. Prabhu, T. Baehr-Jones, M. Hochberg, and D. Englund, “Large-scale quantum photonic circuits in silicon,” Nanophotonics **5**, 456–468 (2016). [CrossRef]

**23. **Y. Shen, M. H. N. Hattink, P. Samadi, Q. Cheng, Z. Hu, A. Gazman, and K. Bergman, “Software-defined networking control plane for seamless integration of multiple silicon photonic switches in Datacom networks,” Opt. Express **26**, 10914–10929 (2018). [CrossRef]

**24. **C. Sun, M. T. Wade, Y. Lee, J. S. Orcutt, L. Alloatti, M. S. Georgas, A. S. Waterman, J. M. Shainline, R. R. Avizienis, S. Lin, B. R. Moss, R. Kumar, F. Pavanello, A. H. Atabaki, H. M. Cook, A. J. Ou, J. C. Leu, Y.-H. Chen, K. Asanović, R. J. Ram, M. A. Popović, and V. M. Stojanović, “Single-chip microprocessor that communicates directly using light,” Nature **528**, 534–538 (2015). [CrossRef]

**25. **H. G. De Chatellus, L. R. Cortés, and J. Azaña, “Optical real-time Fourier transformation with kilohertz resolutions,” Optica **3**, 1–8 (2016). [CrossRef]

**26. **Y. Shen, M. H. N. Hattink, P. Samadi, Q. Cheng, Z. Hu, A. Gazman, and K. Bergman, “Novel microwave photonic fractional Hilbert transformer using a ring resonator-based optical all-pass filter,” Opt. Express **20**, 26499–26510 (2012). [CrossRef]

**27. **C. Taddei, N. T. H. Yen, L. Zhuang, M. Hoekman, A. Leinse, R. Heideman, P. Van Dijk, and C. H. G. Roeloffzen, “Waveguide filter-based on-chip differentiator for microwave photonic signal processing,” in IEEE International Topical Meeting on Microwave Photonics, Alexandria, Virginia, USA (2013), pp. 28–31.

**28. **M. Ferrera, Y. Park, L. Razzari, B. E. Little, S. T. Chu, R. Morandotti, D. J. Moss, and J. Azaña, “On-chip CMOS-compatible all-optical integrator,” Nat. Commun. **1**, 29 (2010). [CrossRef]

**29. **Y. Shen, N. C. Harris, S. Skirlo, M. Prabhu, T. Baehr-Jones, M. Hochberg, X. Sun, S. Zhao, H. Larochelle, D. Englund, and M. Soljačić, “Deep learning with coherent nanophotonic circuits,” Nat. Photonics **11**, 441–446 (2017). [CrossRef]

**30. **H. Peng, M. A. Nahmias, T. F. de Lima, A. N. Tait, and B. J. Shastri, “Neuromorphic photonic integrated circuits,” IEEE J. Sel. Top. Quantum Electron. **24**, 6101715 (2018). [CrossRef]

**31. **M. C. Estevez, M. Alvarez, and L. Lechuga, “Integrated optical devices for lab-on-a-chip biosensing applications,” Laser Photon. Rev. **6**, 463–487 (2012). [CrossRef]

**32. **R. Heideman, M. Hoekman, and E. Schreuder, “TriPleX-based integrated optical ring resonators for lab-on-a-chip and environmental detection,” IEEE J. Sel. Top. Quantum Electron. **18**, 1583–1596 (2012). [CrossRef]

**33. **T. Ozawa, H. M. Price, N. Goldman, O. Zilberberg, and I. Carusotto, “Synthetic dimensions in integrated photonics: from optical isolation to four-dimensional quantum Hall physics,” Phys. Rev. A **93**, 043827 (2016). [CrossRef]

**34. **G. Harari, M. A. Bandres, Y. Lumer, M. C. Rechtsman, Y. D. Chong, M. Khajavikhan, D. N. Christodoulides, and M. Segev, “Topological insulator laser: theory,” Science **359**, eaar4003 (2018). [CrossRef]

**35. **M. A. Bandres, S. Wittek, G. Harari, M. Parto, J. Ren, M. Segev, D. N. Christodoulides, and M. Khajavikhan, “Topological insulator laser: experiments,” Science **359**, eaar4005 (2018). [CrossRef]

**36. **K. Jinguji, “Synthesis of coherent two-port lattice-form optical delay-line circuit,” J. Lightwave Technol. **13**, 73–82 (1995). [CrossRef]

**37. **K. Jinguji, “Synthesis of coherent two-port optical delay-line circuit with ring waveguides,” J. Lightwave Technol. **14**, 1882–1898 (1996). [CrossRef]

**38. **C. K. Madsen, “General IIR optical filter design for WDM applications using all-pass filters,” J. Lightwave Technol. **18**, 860–868 (2000). [CrossRef]

**39. **D. S. Gunderson, *Handbook of Mathematical Induction: Theory and Applications* (CRC Press, Taylor and Francis, 2010).

**40. **D. A. B. Miller, “Perfect optics with imperfect components,” Optica **2**, 747–750 (2015). [CrossRef]

**41. **R. Burgwal, W. R. Clements, D. H. Smith, J. C. Gates, W. S. Kolthammer, J. J. Renema, and I. A. Walmsley, “Using an imperfect photonic network to implement random unitaries,” Opt. Express **25**, 28236–28245 (2017). [CrossRef]

**42. **F. Flamini, N. Spagnolo, N. Viggianiello, A. Crespi, R. Osellame, and F. Sciarrino, “Benchmarking integrated linear-optic architectures for quantum information processing,” Sci. Rep. **7**, 15133 (2017). [CrossRef]

**43. **C. K. Madsen and J. H. Zhao, *Optical Filter Design and Analysis: A Signal Processing Approach*, 1st ed. (Wiley, 1999).

**44. **J. S. Fandiño, D. Domenech, P. Muñoz, and J. Capmany, “A monolithic integrated photonic microwave filter,” Nat. Photonics **11**, 124–129 (2017). [CrossRef]

**45. **S. Grillanda, M. Carminati, F. Morichetti, P. Ciccarella, A. Annoni, G. Ferrari, M. Strain, M. Sorel, M. Sampietro, and A. Melloni, “Non-invasive monitoring and control in silicon photonics using CMOS integrated electronics,” Optica **1**, 129–136 (2014). [CrossRef]