{'fraction_non_alphanumeric': 0.022556005536474088, 'fraction_numerical': 0.007561388219613472, 'mean_word_length': 4.744257950530035, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Demonstration of a 4 × 4-port universal linear circuit

We present a silicon implementation of a 4 × 4-port universal linear optical circuit. Instead of predefining the exact functionality of a photonic circuit at design time, we demonstrate a simple generic silicon photonic circuit, combined with electronic control and software feedback, that can perform any linear operation between its four input ports and output ports. The circuit consists of a network of thermally tunable symmetric Mach–Zehnder interferometers with phase and amplitude control, in-circuit optical power monitors, and local software controlled feedback loops. The circuit can be configured using a training mechanism, which makes it self-adapt to implement the desired function. We use the circuit to demonstrate an adaptive, universal beam coupler, as well as a switch matrix. © 2016 Optical


INTRODUCTION
Silicon photonic components offer an exciting future for a number of different applications. Because of the high contrast of the material, silicon photonic integrated circuits can be designed on a relatively small footprint, enabling the creation of complex yet compact optical devices. Like with electronic application specific integrated circuits (ASICs), such circuits are often the most efficient in terms of footprint, power consumption, and optical transmission. However, because they have to be created for one specific function, the development often requires a long time and several costly fabrication iterations. An update or upgrade of the system also requires an updated version of the chip. For electronic devices, at the opposite end of the spectrum, there are the field programmable gate array (FPGA) and the central processing unit (CPU). Such architectures provide a reprogrammable and generic circuit, whose function is (re)defined by the user during application time instead of fabrication time. This concept can be extended to photonic circuits, by breaking down a complex circuit in a large network of similar or identical unit cells, and where the functionality can be defined by adjusting the optical paths through the network. Such concept can be considered universal, where the functionality of the optical circuit is defined (or modified) by the user, who changes the algorithm controlling the circuit.
A great number of optical operations, such as coupling structures, frequency filtering, optical delays, switch networks, and quantum optics operations, can be implemented using linear optical devices [1][2][3][4][5]. A generic and reconfigurable optical linear device is a device that would implement any linear operation between its inputs and outputs by changing its internal configurations. This approach introduces a versatile and flexible linear optical component that can be configured to perform different complex optical applications. Such a device can be reusable, and scalable if its internal connectivity is reprogrammable. By using internal real-time feedback signals, the circuit can also adapt itself to changing input signals and external conditions, and a circuit can be made resilient to failure of one or more elements.
In [3] the author presents a six-mode implementation of a reconfigurable universal linear circuit in silica operating at 808 nm wavelength. The device presented by the author demonstrates a large number of configurations with different applications. The design presented in [3] performs the reconfiguration by changing the parameters of the MZIs that constitute the circuit.
We present a circuit that uses this same architecture (originally proposed in [5]) implemented in a silicon platform for a 1550 nm wavelength with embedded detection capabilities that allow realization of individual local feedback loops to automatically control the circuit, as proposed by Miller [1,2]. The circuit can be reconfigured by either explicitly changing the parameters of the Mach-Zehnder interferometers (MZIs) in the circuit or by following a training algorithms. When using the training algorithm, the circuit will use the feedback loops, individually controlled by local algorithms, to self-adapt to the input stimuli, changing the parameters of the internal components of the circuit and, with that, perform the reconfiguration of the circuit.
The architecture of the circuit allows the implementation of any linear operation between input and output of the circuit, such as spatial mode conversion, three-way beam splitting, Hadamard transform, and Fourier transform.
The implementation of reprogrammable photonic functions requires more than a network of elemental optical building blocks. The photonic circuit needs to have many actuators and monitors, accompanied by a (analog) driver and read-out electronics, digital feedback loops for the individual elements, and a software stack to (re)program the overall functionality. This photonics-analog-digital-software stack (PADS) will inherently have a larger footprint and a higher power consumption than an application-specific photonic integrated circuit (ASPIC). To scale reconfigurable photonic circuits beyond the demonstration phase, efficient alternatives for thermo-optic phase shifters should be considered, as well as on-chip photodetectors and alternative monitoring strategies.
In this paper, we present a working demonstration of a 4 × 4-port universal linear circuit implemented on a silicon photonics platform. We show the circuit performing two different optical functions and discuss the results. We also discuss alternatives to the implementation and to the algorithms used to operate the circuit.

THEORETICAL DESCRIPTION OF THE DEVICE
A linear optical circuit is a circuit that can be described by a linear transformation between its inputs and outputs. In other words, the signals in all outputs consist of orthogonal linear combinations of the signals at the inputs. A concept of a circuit that can perform an arbitrary linear operation between N input and N output ports was introduced by Reck et al. [5], and later extended by Miller to include local feedback control algorithms for such a circuit [1].
In Miller's concept, a mesh elementary cell is used to implement such a universal linear circuit. Each unit cell is composed of a mirror with variable reflectivity, a phase shifter, a local detector, and a programmable feedback loop, as can be seen in Fig. 1(a). In this schematic, the red elements are mirrors with controllable reflectivity, while the green lines are transparent controllable phase shifters and the orange boxes are "transparent" photodetectors.
Each of these unit cells implements a 2 × 2-port configurable linear device with a built-in transparent detector placed at one of its outputs. A discrete implementation of the full device, using cascaded unit cells, is illustrated in Fig. 1(c).
The unit cell can be implemented in an on-chip circuit using a MZI, as shown of Fig. 1(b). For sake of visualization, we kept the same nomenclature for the ports of the discrete unit and its integrated equivalent [Figs. 1(a) and 1(b)]. In a symmetrical MZI, designed to work in cross configuration and fabricated with ideal splitters and combiners, the light path will normally be from input A to output D and from input B to output C. The transmissions A → D and B → C are given by (1) A differential phase shift between the arms of the MZI (Δϕ) will induce a complementary amplitude modulation at the two outputs, which will make the device behave as a controllable mirror. Common-mode phase shift of the arms (Δθ) will introduce the same phase shift in both outputs. Alternatively, one could design the MZI with two independent heaters, one inside the MZI, to induce the complementary amplitude modulation and a second heater outside the MZI, at one of its outputs. This second heater would directly control the phase in one of the outputs. This approach was explored in [3,6] and has the advantage of not requiring accurate control for a common mode driving. On the other hand, this approach is less compact and, as the heaters are not concentrated inside the MZI where they are actuating, it can increase the thermal crosstalk between the MZIs.
The unit cells are connected together to form one stage of the circuit [Figs. 1(a) and 1(c)]. The stage can pass through a training phase, where it is optimized to couple the incoming light from the n inputs to its specific output, while any orthogonal signal will see the stage as a transparent device. We can use that property to cascade multiples stages to construct a N × N device. In the integrated circuit, to enhance broadband operation we can design the circuit to have equal waveguide lengths between any two connected unit cells. This eliminates any phase delay difference in the circuit besides the actively controlled θ and ϕ in the unit cells.
Local feedback algorithms are used to tune the parameters of those cells by using its local detector as a feedback source. This local feedback loop enables the use of individual algorithms working independently to optimize each unit cell. A global optimization loop is responsible for managing the operation of the circuit by giving goals to each local feedback loop.

CIRCUIT DESIGN AND FABRICATION
We implemented the proposed device as a circuit in IMEC's passive silicon photonics platform, using established building blocks from the supplied process design kit (PDK) [7].
To implement the reconfigurable circuit in a hierarchical way, we first constructed the basic unit cell using a symmetric, thermally tunable, 2 × 2 MZI, as shown of Fig. 1(b). The MZI is implemented using standard 2 × 2 multimode interferometers (MMIs) as splitter/combiner and strip waveguides as its arms. We designed heaters for later post-processing on top of each arm of the MZI to allow individual thermo-optical phase tuning of the two arms.
To collect information for the feedback control loops that drive the phase shifters, we need to add a photodetector at the outputs of the MZIs. The detectors need to be low loss (that is, have high transmission) because, otherwise, the overall power penalty for the circuit will become too large: the light that goes "through" the detectors will proceed to the next stage in the circuit.
To implement detection capability in a passive silicon platform, we tapped a small fraction of the light from the waveguide using a short directional coupler and connected it to a grating coupler to be used as a monitor. The directional coupler was designed to have 1% power coupling efficiency (−20 dB). An external infrared (IR) camera was used to simultaneously detect the light emitted by the grating coupler monitors of the many unit cells. An alternative for using the IR camera would be replacing the grating couplers by some photodetector (such as germanium photodetectors) and proceeding with an electronic readout of the detectors. To get rid of the directional coupler tap, we could use alternatives such as the in-resonator photoconductive heaters (IRPHs [8]) or the contactless integrated photonic probes (CLIPPs [9]) as transparent photodetectors. The disadvantage of these approaches is the increase in complexity of the dedicated electronic circuitry involved to read the optical monitors. The monitor grating couplers, used for the feedback readout of the circuit, are grouped together in a small area, which makes it possible to read all the monitors in a single frame of an IR camera.
The optical input and output are implemented as vertical coupled grating couplers placed in a linear array. This also allows the use of a fiber array. The waveguides to the output couplers also have monitor taps with grating couplers, because it is not always possible to access the signals in the actual outputs. These monitors are identical to the ones used as transparent photodetectors inside the circuit, so they are a good representation of the actual circuit output, and it is not necessary to read the actual output to control the circuit. The electrical connections are routed to a single row of 100 μm × 100 μm electrical pads, allowing the contact by a probe card or wirebonding the chip to a PCB board.
We designed our device as a network of these 2 × 2 MZI building blocks [ Fig. 2(a)]. Our implementation does not compensate for the difference in the optical path length for the inputs of the circuit. For instance, when combining light from inputs 4 and 1 in MZI 1 (by routing the light through 4MZIs, 3, and 2), we notice that the light that enters the circuit from input 4 travels a considerably longer path inside the circuit than does the light from input 1 before reaching MZI 1. The difference in path length traveled by the light in this case (the biggest difference that can happens in this design) is about 3.8 mm. This value has to be observed when regarding the minimum coherence length inside the circuit. In [1,2] the author discusses compensation paths to be added at the input of the circuit to equalize the difference in path length for the inputs of the circuit.
The circuit was designed using the IPKISS toolset from Luceda Photonics [10]. The MZI and the circuit were simulated using the Caphe circuit simulator, which is integrated with IPKISS. The optical circuit is realized in the passive silicon-on-insulator (SOI) platform of IMEC, Belgium, through the Europractice MPW service. The silicon waveguides are 220 nm thick and an additional 2 μm of oxide is deposited as a top cladding. On these, we processed simple resistive titanium heaters with gold wiring using a liftoff process. A picture of the fabricated device is seen in Fig. 2

EXPERIMENTAL RESULTS
To operate the circuit we illuminated it using vertically coupled optical fibers aimed at the grating couplers. We used a laser at 1550 nm, 0 dBm for the training phase and a tunable laser for extracting the spectrum profile of the circuit. For the readout of the grating couplers monitors we used an Infrared (IR) camera with operational wavelength range between 0.9 μm and 1.7 μm. A 32-channel controllable voltage and current source was used for driving the phase shifters. The source was interfaced via Python scripting, fully integrated to the algorithms used in the experiment. To connect the source channels to the device, we used a 20-probe card to contact the electrical pads on the circuit. To guarantee thermal stability during the measurement, the chip was installed on a temperature-controlled sample holder. The measurements were conducted in a stable environment, at a constant 25°C. The schematic of the experiment is shown in Fig. 3(a), and a picture of the experimental setup is shown in Fig. 3 Initial characterization of the optical circuit showed that the on-chip insertion loss at 1550 nm wavelength is 0.9 dB for the individual MZIs and 6.9 dB for the longest path inside the circuit (when routing light from input 4 to output 4). The insertion loss values were derived from the linear fitting of measurement data using the method of the least square to fit the data to a fourth-order polynomial. The standard 2 × 2 MMI building block used in the MZI is specified to an average power imbalance of −0.01 dB with 5% phase accuracy. Measurements of the fabricated device before the addition of the titanium heaters confirmed that the MZIs implemented using such MMIs present negligible power imbalance at the output.
The phase shifter heaters were characterized individually. The MZI exhibits an extinction ratio better than 45 dB when driving the thermo-optical phase shifters. With the data of its characterization, we could estimate the average electrical power consumption by the heaters. The characterization revealed the phase shifters would require typically 30 mW for a complete 2π phase shift, so the electro-optic efficiency is 0.21 rad∕mW.

Research Article
The phase heaters were also characterized to extract the actuation and relaxation time for a π phase shift. The results demonstrated that the phase shifters can operate up to 4 KHz, or a full π change in phase in 0.25 ms. While the exact electrical and optical response curve of the individual heaters is not really required to configure the optical circuit, knowledge of the response can be used to predict the response of the feedback loops and improve convergence.
During the characterization of the circuit, we were able to control the phase in the arms of the MZI with an accuracy of π∕100 rad for the phase shifting. Precise control of the phase shifters is key for the operation of the circuit, since phase errors in the actuation of the MZIs can lead to balance errors, which impacts the circuit when realizing a transformation.
Each cell (MZI) is associated with a monitor detector, as shown in Fig. 2(a). When realizing a differential drive on MZI 3, for instance, detector D3 is used to monitor the light in one output of the MZI (in our design, this light is sent to the next stage of the circuit). Tuning the MZI to achieve the minimum power in its associated monitor will guarantee that the optical power is carried forward in the current stage of the circuit.  Detectors D1 to D5 are implemented using optical taps connected to a grating coupler, for monitoring using an IR camera. The same approach was used with output monitors M1 to M4, which are used to monitor the optical power at the output of the circuit. (b) Microscope image of the fabricated device.

Research Article
As the heater efficiencies in the two arms of the MZI are not necessarily identical, we have to guarantee that an attempt of common-mode modulation will not result in a change in balance of the device. Imperfect and nonidentical heaters can have different thermo-optic efficiency for phase shifting. Because of that, applying identical changes in electrical power in both arms of an MZI can result in a different Δθ in each arm, causing the MZI to move away from its original balance state. To ensure that a common-mode driving will induce only a phase modulation at the output of the MZI we implemented a closed feedback loop to correct potential errors in the process. For this feedback loop we use the same detectors. When performing common-phase driving, the algorithm analyzes eventual changes in the balance of an associated detector to detect whether a change in balance was induced. The algorithm adjusts the electrical power in one of the phase shifters to restore the original balance. Measurements showed that the optical power error at the output during the feedback correction process is less than 1% for a constant optical power at the input of the circuit (during the training phase, for instance). For self-adaptive configurations, when the optical power at the input is not constant, the technique does not guarantee balance stability if the input changes faster than the operating speed of the feedback loops.
The independent control of each MZI is a local optimization process. Our algorithm is designed to allow each cell to operate its local optimization using an individual feedback control loop. A change in the input optical signal in the circuit will be detected by each individual cell via its associated monitor, and the local optimization loop will take actions to compensate for any inadvertent drift away from the optimum. The optimization algorithms are written in Python scripting and are integrated with the control of the instruments.

A. 4 × 4-Port Cross-Bar Switch
To demonstrate the reconfigurable capabilities of the circuit, we implemented a 4 × 4-port cross-bar switch device with arbitrary connectivity between inputs and outputs. This experiment first follows a training phase in which the individual MZIs are optimized using their local feedback loops. Once the training phase is completed and the circuit is operational, the feedback loops are used to keep the operation of the circuit stable, compensating for any eventual disturbance, such as temperature changes.
We trained our circuit to perform the routing from In 1 → Out 4, In 2 → Out 3, In 3 → Out 2, and In 4 → Out 1 [ Fig. 2(a)]. A second configuration was stabilized afterward by swapping the outputs Out 2 and Out 3 to verify the capability of reconfiguration of the circuit.
The training phase starts by optimizing the first stage of the circuit to route the light to Out 1. We shone light at input In 4, and the local optimization algorithms actuate on the MZIs of the first stage to maximize them, reducing the optical power transferred to the second stage (detected by D1, D2, and D3) therefore routing the light to Out 1. After this, the stage is transparent to any input orthogonal to the one it was trained with, so we proceed to illuminate In 3 and optimize the second stage to route the light to Out 2. The same process was repeated to the third stage. With that architecture we were able to cascade multiple stages that just replicated the same local algorithm for each individual MZI. That demonstrates the scalability of this approach, once a circuit with more inputs and outputs can be created by increasing the number of stages in the circuit.
The plot in Fig. 4(a) shows the evolution of the power at three different detectors (D1, D2, and D3) during the optimization process of MZI 3. The aim of the local feedback loop in that case is to minimize the optical power at the detector D3 (red). Notice that when the power at D3 decreases, the optical power in both D2 and D1 increases. This shows the increase of the contribution of the optical power at the output of the circuit along the local optimization process.
In Fig. 4(b) we can see the evolution of the power at Out 1 during the optimization of MZIs 3, 2, and 1. Notice a gain of approximately 10 dB due to the optimization between the initial output power and the power obtained after the optimization process is complete.
After the training phase we measured the spectrum at each output to determine the crosstalk of the device, as well as its wavelength dependence. The measurement was conducted using an auxiliary monitor placed at the output. These monitors are identical to the detectors used internally in the circuit, composed of a directional coupler to tape out a fraction of the light from the

Research Article
output and a grating coupler. The plot in Fig. 5 shows the transmission spectrum for outputs Out 1 to Out 4. We note the Gaussian-like spectrum response of the device, mainly determined by the grating coupler profile. That was possible because the circuit was designed with symmetrical arms connecting the MZIs in order to maintain a broadband operation range. The measured crosstalk in the circuit was below −20 dB between the target output and the remaining ones. Similar values were measured for all the four outputs. The measured on-chip insertion loss for the longest path (when routing light from In 4 to Out 4) was 6.9 dB at 1550 nm wavelength. When comparing with state of the art dedicated silicon-based MZI switches [11], our approach shows compatible performance values in terms of crosstalk and insertion loss for a light path with similar number of components (routing light from In 4 to Out 4 requires the use of 6 MZIs in our design, while in [11] the optical path contains 7 MZIs). The individual insertion loss for each MZI (0.9 dB at 155 nm) and the extinction ratio when tuning the device (−45 dB) indicates that, if further explored, the design can yield similar performance as a dedicated circuit.

B. Universal Coupling
To demonstrate the self-adaptive nature of the device, we reprogrammed the circuit to implement a beam-coupling function. In this experiment, we inject light into the circuit via its four input ports at the same time, and the circuit automatically adjusts its configuration to maximize the power at the output of the circuit.
We inject light into the circuit using flood illumination, which gives us arbitrary power and phase contribution for each input grating coupler. The goal of the circuit is to route all the incoming light with arbitrary power and phase to a predetermined output, Out 1. For this experiment we used a laser with fixed wavelength at 1550 nm and the power was set to 10 dBm (higher than in the previous experiment because of the use of flood illumination). The optimization of the MZIs was done automatically by the local feedback loop, and the readout of the monitors was done using the IR camera. A second optical fiber was vertically coupled to a grating coupler monitor at the output of the circuit to perform real-time measurement of the power at the output and, after the optimization process, to perform a wavelength sweep and extract the spectrum profile of the circuit.
The process of optimization of the circuit is guided by the global optimization algorithms, which coordinate the local optimizers by giving them their objectives. In order to guide all the light from the input of the circuit to output Out 1, each individual cell has as its objective to minimize the optical power at its built-in detector. No power at the detectors means that the optical power is not being forwarded to the next stage of the circuit, Research Article which means that it goes to the output that corresponds to the current stage. The optimization of the circuit is done by adjusting the common mode and the differential modulation parameters of the MZIs in the circuit, following the algorithm described by Miller [2]. For sake of clarity here, we separated the local optimization process into two steps: common-mode optimization and differential optimization.
The common-mode optimization proceeds to adjust the common-mode driving parameters to achieve pure phase modulation at the MZI, while monitoring its associated detector to minimize the power at it. For this process we also use one extra monitor for the closed feedback loop, necessary to detect and correct any eventual change in balance during the common-mode optimization. Figure 6 illustrates how the algorithm uses one extra detector as a feedback monitor to ensure phase-only modulation when driving both arms of the MZI.
The differential optimization is responsible for changing the output balance of the device, and this is achieved by driving one of the heaters of the MZI while monitoring its associated detector to minimize its optical power. In an initial state, at the beginning of the optimization process, all the heaters are at the same power level, so the only option for optimizing the cell is by increasing the electric power applied to the heater. After this initial period, the optimization of the cell might be possible by either increasing or decreasing the electrical power applied to the heater, depending on what Δθ is desired. Note that, theoretically, we could always achieve the desired phase shift by increasing the electrical power and operating with positive integers n for 2nπ Δθ, but that would lead to excessive power consumption. Also, careful control of the electrical signal to the heaters is essential to keep the current level at a safe level, to prevent the heater from burning out. The local optimization algorithm is responsible for this by choosing between increasing or decreasing the driving power based on the behavior of the characterized device and the current power level at the heater.
The optimization steps are repeated for each unit cell in the circuit. At the end of this process, all the light that enters the circuit is guided to the selected output. The combination of independent local optimization stages at the MZIs and a global control algorithm makes the circuit operate in a self-adaptive fashion.
The plot in Fig. 7 shows the evolution of the power levels at the detectors during four steps of the optimization process. For clarity, the MZIs were optimized sequentially, but in practice all optimizations can run simultaneously and continuously. First, the algorithm tunes MZI 4 to obtain maximum power at detector D3, then it proceeds to MZI 3, but now looking to minimize the power at D3. The algorithm then proceeds to tune MZI 2 to minimize D2 and MZI 1 to minimize D1. Note that, when the algorithm optimizes the last MZI, the power at detectors D1 and D2 is negligible. This indicates that there is no power going through these detectors to the next stage, so the light is being correctly guided to the output of the circuit as desired.
The plot in Fig. 8 shows the evolution of the total power at the output of the circuit (Out 1) after each optimization step (each step being either the balance optimization or the phase optimization of one MZI). Note that the power increase during a common-mode optimization is substantially smaller than the contribution due to differential optimization. The reason for that is the flood illumination process. The spacing of the input grating couplers is constant and the arm lengths are equal for all the input waveguides, so the phase difference between the inputs is quite small. Also, the total coupled power is fairly small, because the Fig. 6. Evolution of the optical power at D2 and D3 during the common-mode driving of MZI 3. The detector D3 is used as a reference monitor during the common-mode driving of the MZI. The algorithm monitors the power at D3 to make sure that it remains constant during the common-mode driving, which guarantees that no change in balance was induced in MZI during the common-mode driving. Detector D2 shows a decrease in power as long as the algorithm operates the common-mode driving at MZI 3. The pure phase shift introduced by the common-mode driving changes the interference at MZI 2, which gives us the change in power at D2.

Research Article
grating couplers are not very close together and a lot of light is not coupled to the chip at all.
Because the circuit was designed with symmetrical arm lengths connecting all the MZIs, we can keep broadband operation of the device, as can be seen in Fig. 9. The Gaussian-like wavelength dependence is due to the transmission spectrum of the grating coupler used to couple the light in and out of the circuit. It is important to remember that the measurement was realized in an auxiliary monitor placed at the output of the circuit. The monitor couples just a fraction of the light that goes to the output. That explains the range of output power presented in Figs. 8 and 9.
The circuit response was also measured over a large range of temperatures, as can be seen in Fig. 9. The circuit managed to keep the operating point stable when the whole device temperature changed. This was accomplished due to the symmetry of the design, which ensures equal phase changes due to temperature change across the circuit and also due to the constant actuation of the feedback loops. In the case of an uneven change in temperature across the circuit (i.e., a gradient of temperature is applied over the chip), the feedback loops are able to optimize themselves and maintain operating stability.
The stability of the circuit over time can be seen in Fig. 10. For this experiment, once the circuit was optimized to guide all the light to one output, we monitored the power at the output of the circuit for 1 h at the same time that we gradually increased the temperature of the device from 20°C to 30°C. We realized the experiment with and without the feedback loop mechanism to correct the stability of the circuit. As can be noticed in Fig. 10, the circuit was able to keep the power at the output of the circuit within a deviation of less than −0.25 dB after 1 h of experiment when the feedback loops were operating. The same circuit operating without the feedback correction mechanism registered a loss in the output power of the order of 4 dB. We attribute the 0.25 dB loss in the first scenario to fiber misalignment during the experiment due to thermal expansion of the device.

DISCUSSION AND PERSPECTIVES A. T -Matrix and S-Matrix Devices
The circuit can be considered a mode converter [12]; therefore, this linear optical device can be described mathematically in terms of a linear operator that relates an input wave to an output wave. This linear operator can be described by a transmission matrix (T -matrix) and its parameters can be extracted from the mesh of MZIs that constitute the circuit [ Fig. 2(a)]. To introduce more freedom to the device, it can be extended to an S-matrix circuit by including controllable loop mirrors at the output of the circuit, thereby including a reflection component in the device. The control algorithm has to be upgraded to make use of the reflection properties and implement a true S-matrix circuit. The user could interface to the circuit by changing the parameters of the S-matrix Fig. 8. Optical power at monitor M1, placed at Out 1. The blue region represents steps where a common-mode optimization step happened, while the white regions are refer to differential optimization steps. Fig. 9. Optical power at monitor M1, placed at Out 1 after the optimization process. The measurement was done using an optical fiber vertically coupled to the grating coupler at M1. Research Article using a programmable interface, and the global optimization algorithm would be responsible for translating it to parameters usable by the local optimization algorithm. Such approach would enable the implementation of arbitrary configuration schemes by changing a virtual S-matrix related to the circuit.

B. Topology and Algorithms
In the current implementation, once all the local optimization algorithms are actuating their respective cells, they start changing both the balance and the total phase delay at the output of each MZI. Each MZI has two optical input contributions, one coming from the input of the circuit and a second contribution from the previous MZI. Because of these multiple contributions, the local optimization algorithm of one specific MZI is affected not only by the optical input of the circuit, but also by the contributed signal coming from the previous MZI optimization. That creates a chain of dependencies between the unit cells of the circuit where the adjustment of one cell will impact the balance of the following cell. Such a characteristic can lead to misinterpretation of the monitor signals by the local optimization algorithm during its actuation.
To avoid this problem, the current implementation uses a sequential algorithm to enable the actuation of the local optimization loops, each one on its own time slot. That approach guarantees that during the optimization of one unit cell, a second unit cell will not interfere by changing its optical contribution to a cell that is also on an optimization process. To allow parallel actuation of the local optimization loops, the global optimization algorithm can actuate as a coordinator that would inform the local optimization cells if one of its neighbors is also on an optimization process. With that information, each unit cell can take into account the change in the contributed optical signal coming from a neighbor cell (that information would be provided by the global optimization algorithm) and neutralize its effect in the local optimization process. That configuration would allow parallel operation of the local optimization loops, reducing the time needed for the circuit to run a full optimization cycle, which increases the capability for self-adapting applications.

C. Circuit Implementation
The titanium top heaters used in the circuit have both speed and power consumption limitations. The use of the current phaseshift heaters limits the driving speed of the circuit, which should not exceed 4 KHz, while the total power consumption for a 2π rad phase shift is around 30 mW. To reduce the power consumption by the shifters, one could use doped side heaters [7,13] or liquid-crystal-based phase shifters [14], or modify the design of the MZIs [15,16]. For improving the speed of the circuit, the use of a PN junction phase shifter [17] can be considered, since they do not rely on the thermo-optic effect for the phase shifting, which is the main limitation for increasing the speed of actuation of the phase shifters.
The use of grating coupler monitors as detectors forces the use of an IR camera for the readout of the detectors. This solution has multiple drawbacks, such as the bulky size of the required setup to use the camera, the high cost of the equipment, and the nonportability of the apparatus. To reduce the size of the device and make it compatible with electronics circuits, instead of relying on measurement instrumentation, we could look at more effective detection solutions. The use of germanium photodiodes, such as the one provided by IMEC's ISIPP25G silicon photonics platform [7], provides an electronic compatible detector capable of actuating at a high-speed rate. This, together with higher speed modulation of the MZIs, can not only reduce the size of the device, but also increase the speed of operation, since faster feedback loops could be implemented.
Alternatively, one could use CLIPPs [9] for the monitor readout. The CLIPP detector is compatible with passive silicon photonics platforms, which reduces the cost of the circuit. The disadvantage of using CLIPPs instead of germanium photodiodes is the electronic circuitry involved. A CLIPP device requires more complex electronics to read the detector, including oscillators and lock-in amplifiers.
With on-chip detectors instead of an IR camera, the circuit can be used in a stand-alone application. To accomplish this, we should move the control center from the computer (Fig. 3) to a dedicated microcontroller or similar device. Also, we would have to replace the 32-channel DC source to a compact solution for driving the heaters.
To drive the heaters, a fixed-voltage pulse width modulation (PWM) could be used instead of our current approach, which uses variable level DC current driving. That can be easily accomplished by the microcontroller for managing the PWM signal and a switch circuit as a voltage driver. This solution not only reduces the size and complexity of a multiple-channel analog source, but it also makes the optical phase shift induced by the heater linear to the duty cycle of the signal, since the electric power delivered by a PWM signal is proportional to its duty cycle.

CONCLUSION
We have demonstrated a working implementation of a 4 × 4-port universal linear circuit realizing two distinct operations: a 4 × 4-port matrix switch and a self-adapting beam coupler. That was achieved by changing the algorithm that controls the circuit.
The circuit works with self-adaptive algorithms and uses individual local feedback loops to enforce the adaptation of the circuit.
Reconfigurable and adaptive multiport optical linear devices can be seen as a building block to complex but flexible optical circuits. To achieve this, it is key to have integration among the photonics circuit, the electronics for controlling and tuning the device, and the algorithm to control and give objectives to the local feedback loops.