## Low-depth, compact and error-tolerant photonic matrix-vector multiplication beyond the unitary group

Suren A. Fldzhyan, 1 Mikhail Yu. Saygin, 2, 1, ∗ and Stanislav S. Straupe 2, 1

1 Faculty of Physics, M. V. Lomonosov Moscow State University, Leninskie Gory 1, Moscow, 119991, Russia 2 Sber Quantum Technology Center, Kutuzovski prospect 32, Moscow, 121170, Russia

Large-scale programmable photonic circuits are opening up new possibilities for information processing providing fast and energy-efficient means for matrix-vector multiplication. Here, we introduce a novel architecture of photonic circuits capable of implementing non-unitary transfer matrices, usually required by photonic neural networks, iterative equation solvers or quantum samplers. Our architecture exploits compact low-depth beam-splitter meshes rather than bulky fully connected mixing blocks used in previous designs, making it more compatible with planar integrated photonics technology. We have shown that photonic circuits designed with our architecture have lower depth than their standard counterparts and are extremely tolerant to hardware errors.

## I. INTRODUCTION

Programmable photonic circuits are indispensable ingredients of classical [1-3] and quantum information processing devices [4, 5]. For these devices to achieve the ultimate efficiencies promised by photonics, namely, accelerated speed and energy-efficiency of computation, it is necessary to use programmable interferometers capable of implementing large-scale and high-quality linear transformations. However, fabrication of programmable interferometers with the required scale and quality is challenging due to hardware errors [6-9]. Therefore, developing interferometer architectures that are less susceptible to errors, while optimally exploiting the resources of a specific photonic platform is very important and timely [10].

Aclass of linear transformations broader than unitaries is usually required for photonic information processing, in particular, in classical photonic neural networks [24], iterative equation solvers [2] or quantum graph problem solvers [25]. Fortunately, one can use programmable unitary circuits to implement these generic linear transformations. Common approaches embed the transformation in a larger unitary leading to an overhead in the circuit depth that is typically two times larger than the number of modes in the desired transformation. It turns out that this depth scaling is suboptimal [26, 27].

The fundamental mathematical operation of matrixvector multiplication (MVM) can be efficiently performed by programmable photonics. In particular, this operation is essential for data transformation, weight adjustments, and learning processes in photonic neural networks [11]. In recent years, the development of novel architectures has been primarily focused on programmable interferometers that implement multiplications by unitary transfer matrices. In particular, the planar meshes of MachZehnder interferometers (MZIs) proposed by Reck [12] and Clements [13] can implement arbitrary unitary transfer matrices. These architectures are well suited for fabrication by the mature integrated photonics technology enabling massive production of sophisticated optical circuits [14-16]. Sadly, errors in the constituent directional couplers introduce errors in the implemented multimode transformations [17]. The effect of errors can be alleviated by adding extra elements into optical circuits that correct the errors, however, this makes the circuits larger and harder to program [18]. Several error-tolerant architectures for programmable unitaries that do not require extra phase-shift elements have been proposed [19-22] and demonstrated in experiments [7, 23].

∗ saygin@physics.msu.ru

Recently, Tang et al. [26] have shown that arbitrary transfer matrices can be implemented by programmable circuits with twice lower depths than in the aforementioned approaches. To achieve that, the authors considered a low-depth version of the architecture [19], known to be universal and exhibiting high tolerance to hardware errors. This architecture relies on static fully-connected mixing blocks requiring interaction between all participating modes at once, which is costly to accomplish, especially by planar integrated photonics technologies.

Here we propose an architecture of programmable interferometers that are simultaneously low-depth and error-tolerant. The architecture relies on partially mixing static blocks conveniently realized by a minor modification of the beam-splitter (BS) mesh, which we have studied previously as means to implement programmable unitaries [21]. The proposed programmable circuits are more compatible with planar manufacturing technologies, since they do not require multimode mixing contrary to [26]. As a result, the overall footprint, that includes both static and programmable elements, is more compact than that of the known counterparts.

The paper is organized as follows. In Sec. II we review the methods of constructing programmable multimode optical circuits relevant for understanding our results that follow. In Sec. III we introduce our architecture of programmable circuits and study its performance. We conclude in Sec. IV.

## II. PROGRAMMABLE MULTIMODE OPTICS

The transformation of a linear N -mode optical device can be described by its complex-valued N × N transfer matrix U linking the input, a = ( a , . . . , a 1 N ) T , and output, b = ( b 1 , . . . , b N ) T amplitude vectors:

$$b = U \mathbf a. \quad \ \ ( 1 ) \quad P \mathbf \circ$$

Multimode interferometers performing linear transformations have the form of sequence of layers, each consisting of tunable phase-shifts and static multimode blocks, as illustrated in Fig. 1a. The transfer matrices of such interferometers can be written as

$$U = \Phi ^ { ( L + 1 ) } ( \varphi ^ { ( L + 1 ) } ) \prod _ { l = 1 } ^ { L } V ^ { ( l ) } \Phi ^ { ( l ) } ( \varphi ^ { ( l ) } ), \quad ( 2 ) \underset { l _ { m m i } } { \mod } \text{mat} ;$$

where Φ ( ) l ( ϕ ) = diag( e iϕ 1 , . . . , e iϕ N -1 , 1) is the diagonal matrix of a tunable layer with index l ( l = 1 , L +1) with ϕ j being tunable phase-shifts, V ( ) l - the transfer matrix of a static layer with index l . In the following, we consider interferometers with programmable transfer matrices, which is achieved by properly setting the tunable phase-shifts.

The transformation (2) with N -1 phase-shifts per layer corresponds to the circuit with densest possible packing of these elements. In this work, we are interested in low-depth architectures of programmable circuits and, thus, from the very beginning consider interferometers of this kind. However, it should be noted that not all programmable circuits can be reduced to the form. For example, the unitary architectures [13, 19, 21] can be compactified to form (2) using the method proposed in [28], whereas the architecture proposed in [22] cannot.

## A. Unitary transformations

In real programmable photonic devices tunable phaseshifts are relatively large and lossy. This hinders the scaling of the programmable circuits and motivates the development of low-depth architectures. Therefore, an important parameter that should be kept in mind at designing a programmable circuit is its depth D , which we define as the number of phase-shift layers, i.e. D = L +1. For universal unitary architectures the minimal depth of an N -mode circuit is D = N +1, which corresponds to the total of N 2 -1 phase-shifts - the number of real parameters necessary to describe an arbitrary N × N unitary matrix up to a global phase.

In (2), the choice of particular static transfer matrices V ( ) l specified by a chosen architecture, has a strong effect on the circuit functionality. For example, according to our previous work [19], error-tolerance of programmable unitaries is achieved by choosing static multimode mixing linear optics for which V ( ) l are dense matrices. However, the experimental realizations of such transfer matrices requires organization of interference between all participating modes in each layer. As a result, the area required to allocate the circuit scales unfavorably with the size of the target transformations N , thereby limiting the size of achievable circuits. To illustrate this issue, Fig. 1b shows an example of a multimode mixing block implemented by coupled waveguide arrays [29, 30]. The transformation performed by the coupled waveguides is governed by the coupling taking place between neighbouring waveguides, which necessitates increasing the interaction length l int as N grows in order to achieve a fully mixing matrix V ( ) l . Moreover, the bends required to couple the waveguides should have longer length l bend with increasing N (see Fig. 1b). Another way to implement fully mixing matrices V ( ) l by integrated photonics is using the multimode interferometers (MMI) [31], shown in Fig. 1c. Similarly to the coupled waveguides arrays, the MMIs' length l mmi scales with the size N of the programmable circuits. More sophisticated methods of designing mixing blocks in planar integrated photonics do not aid in precluding the scaling of the static blocks either [32].

As an alternative, compact circuits can be realized by another programmable unitary architecture that uses meshes of beam-splitters (BSs), which has been proposed in our previous work [21]. The corresponding static block used in this architecture is depicted in Fig. 1d. The block consists of two BS layers, so that the static block transfer matrices read:

$$V _ { \text{BS} } ^ { ( l ) } = \prod _ { k \in \Omega _ { 2 } } T _ { B S, k } ^ { ( l, 2 ) } \prod _ { j \in \Omega _ { 1 } } T _ { B S, j } ^ { ( l, 1 ) }, \ \ ( l = \overline { 1, L } ), \quad ( 3 )$$

where

$$T _ { \text{BS}, j } ^ { ( l, m ) } = \left ( \begin{array} { c c c c } 1 & \cdots & \cdots & \cdots & 0 \\ \vdots & \ddots & & & \vdots \\ \vdots & \rho _ { j } ^ { ( l, m ) } & i \tau _ { j } ^ { ( l, m ) } & \vdots \\ \vdots & i \tau _ { j } ^ { ( l, m ) } & \rho _ { j } ^ { ( l, m ) } & \vdots \\ \vdots & & & \ddots & \vdots \\ 0 & \cdots & \cdots & 1 \end{array} \right ) \quad ( 4 )$$

designate the transfer matrix of a single BS acting on modes j and j + 1 in the sub-layer with index m m ( = 1 2). , Ω 1 and Ω 2 denote the ordered sequence of BSs in the first and second sub-layer, respectively. The BS matrix (4) has all diagonal elements equal to one except those labeled by reflectivity ρ ( l,m ) j , and all off-diagonal elements equal to zero except those labeled by transmissivity τ ( l,m ) j ( τ ( l,m )2 j + ρ ( l,m )2 j = 1). Obviously, matrices (3) are radically different from the ones of the multimode mixing blocks, e.g. implemented by coupled waveguide arrays, in that they provide much lesser connectivity.

At the same time the BS-based architecture with static blocks depicted Fig. 2c is advantageous compared to the architecture based on multimode mixing blocks, such as those shown in Fig. 2b. This is due to the fact that the length of the static block l BS is independent on the

FIG. 1. Layered structure of multimode programmable circuits: a) optical scheme consisting of L layers of interleaving static blocks V ( ) l and tunable phase-shifts Φ ( ) l ; the output phase-shift layer Φ ( out ) is added which is not a part of the layers. Implementations of the static blocks by b) coupled waveguide arrays [19, 23, 26], c) planar multimode interforometers (MMI) [20], and d) beam-splitter (BS) meshes (one BS element is highlighted) [21].

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00669v2-figure-eb271ad9-40ac-4044-a739-54e79aa794db.jpg)

scale of the multimode transformation N . In addition, the BS-based architecture is better suited for fabrication by intergated photonics technology, wherein it enables the creation of deeper programmable circuits as demonstrated recently in [7]. Despite having a lower degree of connectivity and experimental complexity than the architectures based on fully mixing static blocks, the BS-based architecture still offers ultimate error-tolerance [21].

## B. Transformations beyond the unitary group

Numerous applications require programmable interferometer architectures that can implement arbitrary transfer matrices beyond the unitary group. Hereinafter, we will designate such non-unitary matrices by A , in order to distinguish them.

It is known that programmable unitaries can be utilized to implement non-unitary matrices. The architectures capable of performing this task can be divided into two categories as illustrated in Fig. 2. Firstly, using a singular value decomposition (SVD) method, an N × N matrix A can be represented as a product of three N × N

matrices:

$$A = W \Sigma U,$$

each of which can be implemented by optics, as shown in Fig. 2a. Here, U and W are N × N unitary matrices that can be implemented by any programmable unitary interferometer. The realization of the non-unitary diagonal matrix Σ = diag( σ , . . . , σ 1 N ), comprised of singular values σ j , requires individual modulation of field amplitudes. In Fig. 2a this is attained by N parallel MachZehnder modulators (MZIs) programmed by phase-shifts located in their arms. It should be noted that such amplitude modulation is limited to singular values | σ j | ≤ 1. However, it does not diminish the applicability of the SVD-based interferometers, since in photonic information processing devices, in particular, in photonic neural networks, scaled target transfer matrices A (e.g., divided by the maximum singular value to meet the requirements) have the same utility as the original ones. The circuit depth of the SVD-based interferometers scales as:

$$D = 2 N + 3. \text{ \quad \ \ } ( 6 )$$

The second approach is based on considering a target N × N non-unitary matrix A as being a submatrix a

FIG. 2. Two approaches to implement generic N -mode programmable transfer matrices A : a) singular value decomposition with two programmable N × N unitaries U and W and one programmable diagonal Σ, b) embedding A into a 2 N × 2 N programmable unitary.

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00669v2-figure-70403786-1587-45d7-bb87-5a33a27ed22c.jpg)

larger M × M unitary one ( M &gt; N ). This embedding becomes obvious when we use the fact that any A with the singular values obeying | σ j | ≤ 1 can be always represented as a part of a 2 N × 2 N unitary matrix U of the form:

$$U = \left ( \begin{array} { c c } A & \sqrt { \mathbb { I } _ { N \times N } - A ^ { \dagger } } \\ \sqrt { \mathbb { I } _ { N \times N } - A ^ { \dagger } A } & - A ^ { \dagger } \end{array} \right ), \quad ( 7 ) \quad \text{the $1$} \\ \text{where $\mathbb{ }P$}... is an $N \times N$ is dontitiv matrix $a\alpha$ for $1$} \quad \text{$1$} \quad \text{$1$} \quad \text{$1$}$$

where I N × N is an N × N identity matrix, e.g. [33]. In this approach, a straightforward method to implement arbitrary non-unitary matrices A (with singular values | σ j | ≤ 1) is using a universal programmable 2 N × 2 N interferometer, as shown in Fig. 2b. The circuit depth of the optical scheme scales as D = 2 N +2.

The circuit depth can be made substantially shallower than (6). As has been demonstrated in the recent paper by Tang et al. [26], arbitrary non-unitary N × N matrices can be embedded into 2 N × 2 N programmable unitary circuits with depth scaling as D = N + 2 - a two-fold improvement over the previously known results for complex-valued matrices. The architecture by Tang et al. [26] uses the unitary architecture depicted in Fig. 1a with L = N +1 multimode mixing blocks. In this work, we propose an even more compact and practical architecture.

## III. LOW-DEPTH ERROR-TOLERANT ARCHITECTURE

The proposed architecture is illustrated in Fig. 3. Here, the constituent static blocks V ( ) l take the form of BS meshes acting on 2 N modes, which are more compact than the previously used multimode mixing blocks [26]. This blocks resemble the planar meshes used in the unitary programmable architecture [21] shown in Fig. 2d. However, there is an important modification making the circuit non-planar. Namely, there is an additional BS coupling two distant modes, thereby the whole mesh has the circular topology shown in Fig. 3b, with the transfer matrices having the following form:

$$V _ { \text{circ} } ^ { ( l ) } = \prod _ { k \in \Omega _ { \text{circ} } } T _ { \text{BS}, k } ^ { ( l, 2 ) } \prod _ { j \in \Omega _ { 1 } } T _ { \text{BS}, j } ^ { ( l, 1 ) } = T _ { \text{BS}, N } ^ { ( l, 2 ) } V _ { \text{BS} } ^ { ( l ) }, ( l = \overline { 1, L } ), \\ \text{where } O \,. \ \ i e \, \text{a como} \, \text{of BS are using on naire of nait}.$$

where Ω circ is a sequence of BSs acting on pairs of neighbouring modes in a circular manner (see Fig. 3b). The sequence Ω circ is simply the sequence Ω 2 from (3) with an added BS described by the following transfer matrix:

$$T _ { \text{BS}, N } ^ { ( l, 2 ) } = \left ( \begin{array} { c c c c } \rho _ { N } ^ { ( l, 2 ) } & 0 & \cdots & 0 & i \tau _ { N } ^ { ( l, 2 ) } \\ 0 & 1 & 0 & 0 \\ \vdots & & \ddots & & \vdots \\ 0 & 0 & 1 & 0 \\ i \tau _ { N } ^ { ( l, 2 ) } & 0 & \cdots & 0 & \rho _ { N } ^ { ( l, 2 ) } \end{array} \right ). \quad ( 9 ) \\ \intertext { A will be shown below, to the common library union modif }$$

As will be shown below, the seemingly minor modification of the planar BS mesh has a strong effect on the capability of the programmable circuits, especially on their tolerance to hardware errors. We notice that the modification of the planar mesh does not present an issue from the hardware perspective, since the waveguide crossings, necessary to implement the circular mesh on a planar chip, is the standard element accessible in mature integrated photonic technologies [34, 35]. Moreover, modern facilities offer fabrication of multilayer photonic integrated circuits, making the proposed architecture even easier to implement [36-38].

To study the capabilities of the architecture in implementing non-unitary transfer matrices, we consider N × N submatrices A of the transfer matrix of the 2 N -mode interferometer corresponding to the field amplitudes, a n and b n , occupying the inputs and outputs alternately, as illustrated in Fig. 3a. To quantify the fidelity of the programmable circuits, we use the normalized square error (NSE):

$$N \mathrm E ( A ^ { ( 0 ) }, A ) = \frac { 1 } { N } \sum _ { i, j = 1 } ^ { N } | A _ { i j } ^ { ( 0 ) } - A _ { i j } | ^ { 2 }, \quad ( 1 0 )$$

FIG. 3. The proposed architecture of programmable non-unitary transfer matrices: a) the N -mode interferometer embedded into the 2 N × 2 N BS mesh. One static block V (1) circ is highlighted. The phase-shifts in the input and output layer colored in grey are irrelevant during operation of the interferometer; b) the 3D layout of the static blocks V ( ) l circ .

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00669v2-figure-cb878e10-4dec-4b43-9a8d-67ad2a7eb11a.jpg)

which compares the target matrix A (0) consisting of elements A (0) ij and the actual transfer matrix A consisting of elements A ij realized by the interferometer, where N is the size of the matrices. Provided that the matrices A (0) and A are equal, (10) gets its minimal value of NSE = 0.

Until now, we did not specify the required parameters of the programmable circuits, namely, the depth D and the values of BS's transmissivities τ ( l,m ) j , corresponding to high-fidelity implementation of non-unitary transfer matrices. To find the minimal depth D = L + 1 necessary to implement target matrices of given size N , we performed numerical simulations at various values of D . In parallel with this, we analyze the dependence of (10) on τ ( l,m ) j 's that allowed us to investigate the error-tolerance capabilities of the circuit at specified N and D . First, we study the effect of coherent errors where all BSs are identical τ ( l,m ) j = τ , but τ can take various values.

## A. Non-unitary transfer matrices

We investigate the capabilities of our architecure to implement randomly generated non-unitary matrices.

We used SVD (5) to generate a target matrix A (0) , wherein the unitary complex-valued matrices U and V were drawn from the Haar random distribution using the method based on the QR-decomposition of random matrices from the Ginibre ensemble [39]. The diagonal matrix Σ was filled with independently generated values from a uniform distribution in the [0 , 1] range.

There is no known analytical solution for the values of phase shifts that minimize the fidelity measure (10), except for some specific architectures [12, 13], thereby necessitating the use of a numerical optimization algorithm (see Appendix A for details). Given a target matrix A (0) , the algorithm was searching towards a global minimum of NSE over the space of phase-shifts ϕ ( ) l ( l = 1 , D ). To decrease the chance of falling into local minima, we used multiple runs of optimization ( ∼ 100) with random initial values of the phases. Each numerical experiment involved optimization over a series of target matrices A (0) .

Using the optimization method, we studied the effect of different values of τ on attained NSE values. In addition to the circuits with the circular BS mesh, we also conducted simulations for the circuits based on the traditional planar BS meshes (see Fig. 1c). Fig. 4 shows the obtained dependencies of NSE on τ for the proposed

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00669v2-figure-ce4b3623-f840-4e22-970d-9d83aaf9d44c.jpg)

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00669v2-figure-11276b56-a578-4e5e-bfb1-f5eae44748a0.jpg)

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00669v2-figure-21a91cce-3b03-410a-937e-fff2b9d008eb.jpg)

FIG. 4. The effect of coherent hardware errors on the performance of programmable interferometers: a) and b) the dependence of NSE on the BS transmissivity for the proposed circular programmable BS meshes at N = 5 and N = 10, respectively; c) and d) the dependence of NSE on the BS transmissivity for the planar programmable BS meshes at N = 5 and N = 10, respectively. The dependencies are calculated at 41 values of τ , evenly taken in the range [0 , 1]. For each τ value the optimization has been performed over 100 randomly sampled target matrices.

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00669v2-figure-3c9592f4-8e16-4ca0-8f03-54297ef5c788.jpg)

circular programmable BS meshes (Fig. 4a,b) and the planar programmable BS meshes (Fig. 4c,d). For the circuits built with the circular BS meshes, two dependencies are plotted that correspond to corresponding static errors in BS elements, that should fall well in this plateau, are far beyond what is likely to be encountered in practice.

- 1. a value of depth D ET at which the circuit exhibits a high-fidelity plateau with NSE ≈ 0, where a particular value of τ does not matter, and
- 2. a value of depth D ET -1, to demonstrate the threshold-like appearance of the NSE ≈ 0 plateau.

Specifically, for N = 5 and N = 10 we arrive at D ET = 7 and D ET = 12, respectively. Therefore, this suggests that D ET = N +2, which is the same as shown in [26] for the architecture based on the multimode mixing blocks, implemented as coupled waveguides (Fig. 1b) or MMIs (Fig. 1c).

Obviously, the appearance of a wide plateau of τ 's with NSE ≈ 0 suggests that the programmable circuits are tolerant to hardware errors that comes in the form of deviations in the constituent static BS elements. Also notice that the NSE ≈ 0 plateau is so wide that the

We used the obtained depth values D ET and D ET -1 to plot the corresponding dependencies for the planar BS meshes in Fig. 4c,d. One can see that, in strike contrast to the circular BS meshes, the planar BS meshes do not exhibit the high-fidelity plateau, necessary for tolerance to hardware errors.

In addition to the coherent errors, assuming correlated deviations of the BS parameters, we studied the influence of incoherent BS errors. For this, we generated τ ( l,m ) j independently from the gaussian random distribution for various distribution widths. The high-fidelity plateau, similar to the case of coherent errors, is observed, thereby proving the tolerance to hardware errors of our architecture.

FIG. 5. The dependence of fidelity measure NSE on the BS transmissivity for the proposed circular programmable BS meshes at N = 5 (a) and N = 10 (b) in the case of unitary target matrix A (0) . Several dependencies are plotted in the figures that correspond to the circuit depth D = N +1 , N +2 , N +3 and N +4. The dependencies are calculated at 41 values of τ , evenly taken in the range [0 , 1]. For each τ value the optimization has been performed over 100 randomly sampled unitary target matrices.

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00669v2-figure-26b247f4-929d-4237-a35a-b568c15d526c.jpg)

## B. Special cases

The analysis of the capabilities of the proposed architecture on randomly sampled non-unitary matrices by no means prove its operation for arbitrary transfer matrices that can be encountered in real uses. Therefore, we have also considered a special case of transfer matrices that fall out of the analysis conducted above.

In particular, we analyse the implementation of generic unitary transfer matrices, which is also a case very unlikely to be caught by sampling non-unitary matrices of the larger size. We generated the target matrix A (0) to be a unitary matrix sampled from the Haar random distribution using the method based on the QR-decomposition of random matrices from the Ginibre ensemble. As before, we used the fidelity measure (10). Fig. 5a and Fig. 5b demonstrate the obtained results for unitary transfer matrices of N = 5 and N = 10, respectively. As can be seen from the figures, the circular interferometer does not work in error-tolerant way, as it did for non-unitary target matrices. In addition to generic unitary matrices, we also studied the implementation of permutation matrices which are unitary, but present a more narrower class. The obtained results turned out to be similar to the ones illustrated by Fig. 5.

## C. Relaxed requirements for target matrices

FIG. 6. The dependence of the scaled NSE fidelity measure and the absolute value of the matrix scaling factor | s | on the BS transmissivities τ in the proposed programmable BS meshes at N = 5 (a) and N = 10 (b). The dependencies are calculated at 41 values of τ , evenly taken in the range [0 , 1]. For each τ value the optimization has been performed over 100 randomly sampled unitary target matrices.

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00669v2-figure-9cb34aa4-d5ac-4931-81a2-5828a2007f79.jpg)

To achieve high-fidelity matrix-vector multiplication by programmable photonic circuits in general and our circular architecture, in particular, we suggest the following trick. In many applications, matrix-vector multiplication is allowed to be performed up to a global complex value s . In other words, multiplication by the matrix sA (0) can be as useful as multiplication by the specified one A (0) . For example, this is usually the case in opto-electronic devices [1, 2], wherein the vector result of the photonic multiplication is immediately measured and converted to

electronic format for further processing. The scaling operation present a simple routine, which can be easily performed by electronics.

We used the modified fidelity measure that takes into account the freedom of scaling factor:

$$N S E _ { s } ( A ^ { ( 0 ) }, A ) = \frac { 1 } { | s | ^ { 2 } } N S E ( s A ^ { ( 0 ) }, A ), \quad ( 1 1 ) \quad \text{the i} \\ \text{and}$$

which we optimize in the space of phase-shifts { ϕ ( ) l } and the scaling factor s (see Appendix B for details). It should be noted that, because lower values of | s | are associated with higher losses introduced to the transformation, higher | s | are usually preferable. Our optimization algorithm used to minimize (11) opts for higher values of | s | .

We challenge our architecture again in the task of implementing unitary transfer matrices. The results obtained in optimization of (11) are shown in Fig. 6. Comparing these results with those shown in Fig. 5, we see the significant effect of using the relaxed fidelity measure (11) on the quality of implemented unitary matrices. The high-fidelity plateau with NSE s ≈ 0 is observed, which suggest the tolerance to hardware errors.

## IV. CONCLUSION

In this work we proposed a novel architecture of programmable circuits capable of implementing transfer matrices beyond the unitary group. Our architecture has the advantage of having a lower depth than the previously known counterparts and possess tolerance to hardware errors. In addition, the programmable circuits designed with the architecture is compatible with planar integrated photonics. All these properties, simultaneously offered by our architecture, facilitate the fabrication of large-scale programmable circuits performing photonic matrix-vector multiplication by mature integrated photonics technologies. Taking into account the typical scale of matrix-vector multiplications required by modern computing, in particular, deep neural networks, the advantages of our circuits are decisive for practical implementation in real-world computing systems. This makes us believe that the results of this work are of interest for both fundamental and applied fields.

## V. ACKNOWLEDGEMENTS

This work is supported by Sber under the project with M.V.Lomonosov Moscow State University 'Development of approaches to creating programmable optical matrixvector multipliers for artificial intelligence tasks' (Contract № 50005018373). S.A.F. is grateful to the Russian Foundation for the Advancement of Theoretical Physics and Mathematics (BASIS) (Project № 23-2-10-15-1)

## Appendix A: Optimization algorithm for NSE

The optimization algorithm used to find the phaseshift values corresponding to a minimum of the NSE (10) works as follows.

Consider one phase-shift layer with index l , so that the interferometer transfer matrix A = C Φ ( ) l B , where B and C are the matrices describing the parts of the interferometer acting before and after the phase-shift layer, respectively (see Fig. 1a).

Then, the NSE may be rewritten as

$$N N S E ( A ^ { ( 0 ) }, A ) =$$

$$\mathfrak { e s o f } \quad \text{Tr} ( A ^ { ( 0 ) \dagger } - B ^ { \dagger } \bar { \Phi } ^ { ( l ) } C ^ { \dagger } ) ( A ^ { ( 0 ) } - C \Phi ^ { ( l ) } B ) = \sum _ { i, j = 1 } ^ { N } | A _ { i j } ^ { ( 0 ) } | ^ { 2 } + \\.. \quad \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$$

$$\lim _ { \sim k } \quad + \text{Tr} ( \bar { \Phi } ^ { ( l ) } C ^ { \dagger } C \Phi ^ { ( l ) } B B ^ { \dagger } ) - 2 \Re [ \text{Tr} ( \bar { \Phi } ^ { ( l ) } C ^ { \dagger } A ^ { ( 0 ) } B ^ { \dagger } ) ]. \ \ ( A 1 )$$

$$& A ^ { ( 0 ) }, A ) = \\ & - B ^ { \dagger } \bar { \Phi } ^ { ( l ) } C ^ { \dagger } ) ( A ^ { ( 0 ) } - C \Phi ^ { ( l ) } B ) = \sum _ { i, j = 1 } ^ { N } | A _ { i j } ^ { ( 0 ) } | ^ { 2 } + \\ & ) C ^ { \dagger } C \Phi ^ { ( l ) } B B ^ { \dagger } ) - 2 \Re [ \text{Tr} ( \bar { \Phi } ^ { ( l ) } C ^ { \dagger } A ^ { ( 0 ) } B ^ { \dagger } ) ]. \quad ( A 1 ) \\ & \cdot \text{mochik} \, \det \, \det \, \min \, \mathfrak { t h o n t h o n t h t h }$$

Next, it is possible to determine the NSE minimum with respect to a single phase-shift φ ( ) l k , 0 &lt; k &lt; N in layer l , using the condition:

$$\frac { \partial N S E ( A ^ { ( 0 ) }, A ) } { \partial \phi _ { k } ^ { ( l ) } } = 0, \text{ \quad \ \ } ( A 2 )$$

which yields

/negationslash

$$\text{$num_y=true$} \\ \otimes \left [ e ^ { - i \phi _ { k } ^ { ( l ) } } \left ( \sum _ { \substack { n \\ j = 1 \\ j \neq k } } ^ { N } ( C ^ { \dagger } C ) _ { k j } e ^ { i \phi _ { j } ^ { ( l ) } } ( B B ^ { \dagger } ) _ { j k } - ( C ^ { \dagger } A ^ { ( 0 ) } B ^ { \dagger } ) _ { k k } \right ) \right ] = 0, \\ \text{$of pro-} \\ \text{for $a$-} \\ \text{re has} \\ \text{assumption $\phi^{\prime}^{\prime}$} \, = \, 0 \text{ and is not changeable.} \text{   From } ( A 3 )$$

assuming φ ( ) l N = 0 and is not changeable. From (A3) follows the analytical solution corresponding to a minima of the NSE with respect to the phase-shift parameter:

/negationslash

$$\ t s \, \text{de} _ { \text{lanar} } \quad \phi _ { k } ^ { ( l ) * } = \arg \left ( ( C ^ { \dagger } A ^ { ( 0 ) } B ^ { \dagger } ) _ { k k } - \sum _ { \substack { j = 1 \\ j \neq k } } ^ { N } ( C ^ { \dagger } C ) _ { k j } e ^ { i \phi _ { j } ^ { ( l ) } } ( B B ^ { \dagger } ) _ { j k } \right ). \\ \text{grad} \quad \text{Our algorithm iteratively chooses a programmable}$$

Our algorithm iteratively chooses a programmable phase-shift layer and a phase-shift within it, to which the analytical solution (A4) is applied. Namely, one iteration updates phase-shifts φ ( ) l k one-by-one using (A4) by sequentially selecting layer index l and phase-shifts index k . We run this process until one of the following conditions is met: 1) NSE &lt; 10 -10 , 2) the relative difference between successive iterations (NSE t +1 -NSE ) NSE t / t &lt; 10 -8 , or 3) the maximum number of iterations 10 6 has been reached. To find optimal phase-shift values corresponding to a global minimum of (10), the optimization procedure was conducted 100 times, each time initialized by random starting values.

## Appendix B: Optimization algorithm for NSE s

The optimization algorithm used to find the phaseshift values and scaling factor s simultaneously corre-

sponding to the highest possible quality and lowest level of introduced losses was as follows.

For a target matrix A (0) and actual transfer matrix A the scaling factor s minimizing NSE s can be found analytically. For this, NSE s is written explicitly

$$N N S E _ { s } ( A ^ { ( 0 ) }, A ) = \sum _ { i, j = 1 } ^ { N } | A _ { i j } ^ { ( 0 ) } | ^ { 2 } -$$

$$-$$

$$- \frac { 2 \Re [ e ^ { - i \arg ( s ) } \text{Tr} [ A ^ { \dagger } A ^ { ( 0 ) } ] ] } { | s | } + \frac { \sum _ { i, j = 1 } ^ { N } | A _ { i j } | ^ { 2 } } { | s | ^ { 2 } }, \ ( B 1 )$$

which readily yields the optimal value

$$s = \frac { \sum _ { i, j = 1 } ^ { N } | A _ { i j } | ^ { 2 } } { \text{Tr} [ A ^ { \dagger } A ^ { ( 0 ) } ] }. \quad \quad ( B 2 )$$

- [1] S. Pai, Z. Sun, T. W. Hughes, T. Park, B. Bartlett, I. A. D. Williamson, M. Minkov, M. Milanizadeh, N. Abebe, F. Morichetti, A. Melloni, S. Fan, O. Solgaard, and D. A. B. Miller, Experimentally realized in situ backpropagation for deep learning in photonic neural networks, Science 380 , 398 (2023).
- [2] M. Chen, Q. Cheng, M. Ayata, M. Holm, and R. Penty, Iterative photonic processor for fast complex-valued matrix inversion, Photon. Res. 10 , 2488 (2022).
- [3] Y. Shen, N. C. Harris, S. Skirlo, M. Prabhu, T. BaehrJones, M. Hochberg, X. Sun, S. Zhao, H. Larochelle, D. Englund, and M. Soljaˇi´, Deep learning with coherent c c nanophotonic circuits, Nature Photonics 11 , 441 (2017).
- [4] S. Chen, L.-C. Peng, Y.-P. Guo, X.-M. Gu, X. Ding, R.-Z. Liu, X. You, J. Qin, Y.-F. Wang, Y.-M. He, J. J. Renema, Y.-H. Huo, H. Wang, C.-Y. Lu, and J.-W. Pan, Heralded three-photon entanglement from a single-photon source on a photonic chip (2023), arXiv:2307.02189 [quant-ph].
- [5] L. S. Madsen, F. Laudenbach, M. F. Askarani, F. Rortais, T. Vincent, J. F. F. Bulmer, F. M. Miatto, L. Neuhaus, L. G. Helt, M. J. Collins, A. E. Lita, T. Gerrits, S. W. Nam, V. D. Vaidya, M. Menotti, I. Dhand, Z. Vernon, N. Quesada, and J. Lavoie, Quantum computational advantage with a programmable photonic processor, Nature 606 , 75 (2022).
- [6] M. G. Anderson, S.-Y. Ma, T. Wang, L. G. Wright, and P. L. McMahon, Optical transformers (2023), arXiv:2302.10360 [cs.ET].
- [7] I. Kondratyev, V. Ivanova, S. Fldzhyan, A. Argenchiev, N. Kostyuchenko, S. Zhuravitskii, N. Skryabin, I. Dyakonov, M. Saygin, S. Straupe, A. Korneev, and S. Kulik, Large-scale error-tolerant programmable interferometer fabricated by femtosecond laser writing, Photon. Res. 12 , A28 (2024).
- [8] C. Taballione, M. C. Anguita, M. de Goede, P. Venderbosch, B. Kassenberg, H. Snijders, N. Kannan, W. L. Vleeshouwers, D. Smith, J. P. Epping, R. van der Meer, P. W. H. Pinkse, H. van den Vlekkert, and J. J. Renema, 20-Mode Universal Quantum Photonic Processor,

To optimize the NSE , we modify the procedure for s NSE by adding updating the s value after each iteration of the algorithm. If NSE s &lt; 10 -10 was reached, then the next optimization procedure starting from a new random point had a lower bound on | s | . This bound was gradually increased as the iterations proceeded. This was done in order to determine the scaling factor with the maximum possible amplitude, which is preferable to minimize losses.

## Quantum 7 , 1071 (2023).

- [9] J. Spall, X. Guo, T. D. Barrett, and A. I. Lvovsky, Fully reconfigurable coherent optical vector-matrix multiplication, Opt. Lett. 45 , 5752 (2020).
- [10] B. Wu, H. Zhou, J. Dong, and X. Zhang, Programmable integrated photonic coherent matrix: Principle, configuring, and applications, Applied Physics Reviews 11 , 011309 (2024).
- [11] T. F. de Lima, H.-T. Peng, A. N. Tait, M. A. Nahmias, H. B. Miller, B. J. Shastri, and P. R. Prucnal, Machine learning with neuromorphic photonics, J. Lightwave Technol. 37 , 1515 (2019).
- [12] M. Reck, A. Zeilinger, H. J. Bernstein, and P. Bertani, Experimental realization of any discrete unitary operator, Phys. Rev. Lett. 73 , 58 (1994).
- [13] 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 (2016).
- [14] S. Y. Siew, B. Li, F. Gao, H. Y. Zheng, W. Zhang, P. Guo, S. W. Xie, A. Song, B. Dong, L. W. Luo, C. Li, X. Luo, and G.-Q. Lo, Review of silicon photonics technology and platform development, Journal of Lightwave Technology 39 , 4374 (2021).
- [15] S. Shekhar, W. Bogaerts, L. Chrostowski, J. E. Bowers, M. Hochberg, R. Soref, and B. J. Shastri, Roadmapping the next generation of silicon photonics, Nature Communications 15 , 751 (2024).
- [16] C. Zhang, M. A. Tran, Z. Zhang, A. E. Dorche, Y. Shen, B. Shen, K. Asawa, G. Kim, N. Kim, F. Levinson, J. E. Bowers, and T. Komljenovic, Integrated photonics beyond communications, Applied Physics Letters 123 , 230501 (2023).
- [17] 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 (2017).
- [18] D. A. B. Miller, Perfect optics with imperfect components, Optica 2 , 747 (2015).
- [19] M. Y. Saygin, I. V. Kondratyev, I. V. Dyakonov, S. A.

- Mironov, S. S. Straupe, and S. P. Kulik, Robust architecture for programmable universal unitaries, Phys. Rev. Lett. 124 , 010501 (2020).
- [20] R. Tang, T. Tanemura, and Y. Nakano, Integrated reconfigurable unitary optical mode converter using mmi couplers, IEEE Photonics Technology Letters 29 , 971 (2017).
- [21] S. A. Fldzhyan, M. Y. Saygin, and S. P. Kulik, Optimal design of error-tolerant reprogrammable multiport interferometers, Opt. Lett. 45 , 2632 (2020).
- [22] R. Hamerly, S. Bandyopadhyay, and D. Englund, Asymptotically fault-tolerant programmable photonics, Nature Communications 13 , 6831 (2022).
- [23] R. Tang, R. Tanomura, T. Tanemura, and Y. Nakano, Ten-port unitary optical processor on a silicon photonic chip, ACS Photonics 8 , 2074 (2021).
- [24] L. De Marinis, M. Cococcioni, P. Castoldi, and N. Andriolli, Photonic neural networks: A survey, IEEE Access 7 , 175827 (2019).
- [25] R. Mezher, A. F. Carvalho, and S. Mansfield, Solving graph problems with single photons and linear optics, Phys. Rev. A 108 , 032405 (2023).
- [26] R. Tang, R. Tanomura, T. Tanemura, and Y. Nakano, Lower-depth programmable linear optical processors, Phys. Rev. Appl. 21 , 014054 (2024).
- [27] Y. Tian, Y. Zhao, S. Liu, Q. Li, W. Wang, J. Feng, and J. Guo, Scalable and compact photonic neural chip with low learning-capability-loss, Nanophotonics 11 , 329 (2022).
- [28] B. A. Bell and I. A. Walmsley, Further compactifying linear optical unitaries, APL Photonics 6 , 070804 (2021).
- [29] J. Zhou, J. Wu, and Q. Hu, Tunable arbitrary unitary transformer based on multiple sections of multicore fibers with phase control, Opt. Express 26 , 3020 (2018).
- [30] A. Yariv, Coupled-mode theory for guided-wave optics, IEEE Journal of Quantum Electronics 9 , 919 (1973).
- [31] L. Soldano and E. Pennings, Optical multi-mode interfer-
- ence devices based on self-imaging: principles and applications, Journal of Lightwave Technology 13 , 615 (1995).
- [32] V. Nikkhah, A. Pirmoradi, F. Ashtiani, B. Edwards, F. Aflatouni, and N. Engheta, Inverse-designed lowindex-contrast structures on a silicon photonics platform for vector-matrix multiplication, Nature Photonics 10.1038/s41566-024-01394-2 (2024).
- [33] P. R. Halmos, Normal dilations and extensions of operators, Summa Brasil. Math. 2 , 125 (1950).
- [34] M. Johnson, M. G. Thompson, and D. Sahin, Low-loss, low-crosstalk waveguide crossing for scalable integrated silicon photonics applications, Opt. Express 28 , 12498 (2020).
- [35] S. Wu, X. Mu, L. Cheng, S. Mao, and H. Fu, State-ofthe-art and perspectives on silicon waveguide crossings: A review, Micromachines 11 (2020).
- [36] R. Tang, M. Okano, K. Toprasertpong, S. Takagi, D. Englund, and M. Takenaka, Two-layer integrated photonic architectures with multiport photodetectors for highfidelity and energy-efficient matrix multiplications, Opt. Express 30 , 33940 (2022).
- [37] W. D. Sacher, J. C. Mikkelsen, P. Dumais, J. Jiang, D. Goodwill, X. Luo, Y. Huang, Y. Yang, A. Bois, P. G.-Q. Lo, E. Bernier, and J. K. S. Poon, Tri-layer silicon nitride-on-silicon photonic platform for ultra-lowloss crossings and interlayer transitions, Opt. Express 25 , 30862 (2017).
- [38] Y. Zhang, A. Samanta, K. Shang, and S. J. B. Yoo, Scalable 3d silicon photonic electronic integrated circuits and their applications, IEEE Journal of Selected Topics in Quantum Electronics 26 , 1 (2020).
- [39] F. Mezzadri, How to generate random matrices from the classical compact groups (2007), arXiv:math-ph/0609050 [math-ph].

This figure "frog.jpg" is available in "jpg"GLYPH&lt;10&gt; format from:

http://arxiv.org/ps/2408.00669v2
S. A. Fldzhyan M. Yu. Saygin S. S. Straupe
Low-depth, compact and error-tolerant photonic matrix-vector multiplication beyond the unitary group
Large-scale programmable photonic circuits are opening up new possibilities
for information processing providing fast and energy-efficient means for
matrix-vector multiplication. Here, we introduce a novel architecture of
photonic circuits capable of implementing non-unitary transfer matrices,
usually required by photonic neural networks, iterative equation solvers or
quantum samplers. Our architecture exploits compact low-depth beam-splitter
meshes rather than bulky fully connected mixing blocks used in previous
designs, making it more compatible with planar integrated photonics technology.
We have shown that photonic circuits designed with our architecture have lower
depth than their standard counterparts and are extremely tolerant to hardware
errors.