Arbitrary linear transformations for photons in the frequency synthetic dimension

Arbitrary linear transformations are of crucial importance in a plethora of photonic applications spanning classical signal processing, communication systems, quantum information processing and machine learning. Here, we present a photonic architecture to achieve arbitrary linear transformations by harnessing the synthetic frequency dimension of photons. Our structure consists of dynamically modulated micro-ring resonators that implement tunable couplings between multiple frequency modes carried by a single waveguide. By inverse design of these short- and long-range couplings using automatic differentiation, we realize arbitrary scattering matrices in synthetic space between the input and output frequency modes with near-unity fidelity and favorable scaling. We show that the same physical structure can be reconfigured to implement a wide variety of manipulations including single-frequency conversion, nonreciprocal frequency translations, and unitary as well as non-unitary transformations. Our approach enables compact, scalable and reconfigurable integrated photonic architectures to achieve arbitrary linear transformations in both the classical and quantum domains using current state-of-the-art technology.

A rbitrary linear transformations in photonics 1-3 are of central importance for optical quantum computing 4 , classical signal processing and deep learning [5][6][7][8][9][10] . A variety of architectures are being actively studied to implement linear transformations for quantum computation and photonic neural networks, including those based on Mach-Zender interferometers (MZI) 4,5 , microring weight banks 6,7,11 , phase-change materials 8,9 , and diffractive metasurfaces 10 . All such approaches use path encoding of photons in real space. By contrast, implementing such linear transformations in the frequency space would open avenues beyond those possible with previously reported architectures, which are inherently time-invariant. For example, frequency-space transformations allow spectrotemporal shaping of light and generation of new frequencies, with wide-ranging applications in frequency metrology, spectroscopy, communication networks, classical signal processing [12][13][14] and linear optical quantum information processing [15][16][17][18][19][20][21][22][23][24] . Nonlinear optics has traditionally been the workhorse for such spectrotemporal shaping, but the requirement of high-power fields and the difficulty of implementing arbitrary linear transformations motivates new architectures for manipulating states in the frequency domain. To that end, photonic synthetic dimensions offer an attractive solution to implement linear transformations in a single physical waveguide by harnessing the internal degrees of freedom of a photon [25][26][27][28][29][30][31][32] . Synthetic frequency dimensions in particular offer a small spatial footprint and inherent reconfigurability since multiple frequency modes can be addressed simultaneously, and the short-and long-range coupling 29,30,33,34 between them can be controlled by applying an appropriate time-domain signal to a modulator.
Previous works have considered implementing photonic linear transformations using different frequency channels in parallel but without frequency conversions among them 6,7,9,11 by demultiplexing the different frequencies into separate spatial channels. Additionally, optimized fast modulation has been used for tailoring single photon spectra from two-level quantum emitters 35 , or for quantum frequency conversion 15 and linear optical quantum computation 17,36 , where the modulator is used as a generalized beam splitter in synthetic frequency dimensions. However, the design of an entire scattering matrix that implements an arbitrary N × N linear transformation in synthetic space, which is essential for many applications in quantum information processing and neural networks, has not yet been shown.
Here, we show that arbitrary linear transformations can be performed directly in the synthetic space spanned by the different frequency modes carried by a single physical waveguide. We use gradient-based inverse design to automate the process of designing the linear transformations, and demonstrate that a wide variety of transformations can be realized. As examples, we show single-frequency conversion, nonreciprocal frequency translations as well as general arbitrary unitary and non-unitary transformations, all achieved with high fidelities in a fully reconfigurable fashion.

Results
Theory. Consider a ring of radius R formed by a single mode waveguide with a refractive index n. The ring is coupled to an external waveguide of the same refractive index. Assuming sufficiently weak coupling between the ring and the external waveguide and neglecting group-velocity dispersion, the eigenmodes of the ring occur at frequencies ω m = ω 0 + mΩ R , where ω 0 is the central frequency, m is an integer and Ω R = c/nR is the free spectral range (FSR) of the ring in angular frequency units, with c being the speed of light in vacuum. These eigenmodes take the form e Àiðm 0 þmÞϕ , where m 0 denotes the angular momentum of the 0 th mode and ϕ is the azimuthal coordinate of the ring. Corresponding to these eigenmodes, we define a m ðtÞe iω m t to be the amplitude of the mode centered at ω m , normalized such that |a m (t)| 2 corresponds to the photon number in the m th mode. Likewise, we define s ± m ðtÞe iω m t to be the amplitudes of the modes of the external waveguide at the input and output ports, respectively, as shown in Fig. 1b. The coupling between the ring modes and waveguide modes at frequency ω m is described by an external coupling rate γ e m , while other losses occurring in the ring, such as absorption or bending loss, are captured by an internal decay rate γ i m . Lastly, we assume that the dielectric constant of the ring is modulated using an electro-optic modulator in the form ∑ N f l¼1 δϵ l ðϕÞ cosðlΩ R t þ θ l Þ, where δϵ l is the depth of the modulation and θ l is the phase of the modulation at frequency lΩ R . The angular dependence δϵ l (ϕ) occurs due to the physical localization of the electro-optic modulator to a specific range of ϕ, as shown in Fig. 1. The dynamics of the coupled ring-waveguide system can be described by a coupled-mode theory (see Supplementary Note 1) given by: where is the modulation-induced coupling between the modes of the ring, with α l describing the radial and zenith-angle overlap of the eigenmodes of the ring with the electro-optic modulator (see Supplementary Note 1). If the δϵ l 's are real, i.e., only the real part of the refractive-index is modulated, then κ Ã l ¼ κ Àl . Therefore, the modulation conserves the total photon number summed across all frequency channels. Further, if γ i m are negligible, then no photons are lost to absorption or radiation. Under these conditions, the setup of Eqs.
(1-2) implements a unitary transformation between the fields s þ m at the input ports and the fields s À m at the output ports. This unitary transformation can be obtained by first converting Eq. (1) to the frequency domain, resulting in where a ¼ f a À1 ; a 0 ; a 1 ; Þ, Δω is a constant detuning of the equally spaced frequencies of input comb s + from the ring's resonant frequencies, and K mm 0 κ mÀm 0 as defined by Eq. (3). Then, from Eq. (2), we obtain s À ¼ Ms þ , where A direct verification of the unitarity of M is included in Supplementary Note 2. In the idealized situation as described above, where the ring-waveguide system is assumed to be singlemoded over a broad bandwidth and is free from group velocity dispersion, the matrix M is infinite-dimensional. In practice, the dimensionality of the scattering matrix can be controlled by introducing a "truncation" along the frequency dimension. Such a truncation can be implemented using one or more auxiliary rings coupled to the main ring (see Supplementary Note 3). The auxiliary rings couple to and perturb a few modes immediately outside the (2N sb + 1) modes around the 0 th mode, dispersively shifting and splitting them. These perturbed modes have frequencies such that the modulation tones of lΩ R cannot couple these modes to the (2N sb + 1) modes of interest. Therefore, the total number of modes under consideration in the coupled ringwaveguide system is 2N sb + 1, and the scattering matrix defined in Eq. (5) is of size (2N sb + 1) × (2N sb + 1). The main objective of our paper is to show that an arbitrary scattering matrix of size (2N sb + 1) × (2N sb + 1) can be created. To that end, we first note that the number of real degrees of freedom in the scattering matrix (Eq. (5)) of a single ring under modulation is equal to twice the number of distinct modulation tones, 2N f , provided the modulation amplitudes δϵ l and phases θ l are independently controllable. Since the system is truncated to have 2N sb + 1 frequencies, the largest harmonic of Ω R that will result in nonzero coupling between any two modes is 2N sb , i.e., N f ≤ 2N sb . Since an arbitrary unitary matrix of size (2N sb + 1) × (2N sb + 1) has ð2N sb þ 1Þ 2 real degrees of freedom whereas N f ≤2N sb , we conclude that a single modulated ring is insufficient to approximate an arbitrary unitary matrix to a high degree of accuracy, even if all modulation tones up to 2N sb Ω R are used. To overcome this problem, notice that products of unitary transformations are also unitary 37 . Therefore, as shown in Fig. 1a, instead of a single ring, we consider a sequence of N r number of rings with each ring providing N f complex degrees of freedom. Thus, if the total degrees of freedom in series of rings coupled to the waveguide, given by 2N f N r , exceeds ð2N sb þ 1Þ 2 , then the setup of Fig. 1a should be able to approximate an arbitrary unitary transformation to a high degree of accuracy.
Below, we optimize these 2N f N r degrees of freedom to enable physical approximation of arbitrary unitary and certain nonunitary transformations. For unitary transformations or parts thereof, we use as the objective function the fidelity, which measures the accuracy of an approximation V to a unitary transformation U: is the Frobenius norm. The use of an absolute value in Eq. (6) allows for the tolerance of a single global phase, i.e., if F ðU; VÞ ¼ 1, then the transformation V achieved by the architecture is equal to Ue iΦ for some phase Φ. To achieve a high fidelity for a given target matrix we use gradient-based inverse design to optimize the parameters of the modulated system. To enable such optimization, we implemented a numerical model of the unitary transformations defined by Eq. (5) in an automatic differentiation framework 38 . While explicitly defined adjoint variable methods have been widely used for photonic inverse design 39 , automatic differentiation is the generalization of the adjoint variable methods to arbitrary computational graphs. Automatic differentiation has recently been successfully applied to the inverse design of photonic band structures 40 as well as photonic neural networks 41 , where explicit adjoint methods are challenging to implement. Here, automatic differentiation enables the efficient computation of the gradients of a scalar objective function with respect to complex control parameters, which in this case are the coupling constants κ ±l as defined in Eq. (3). The advantage of using automatic differentiation is that one needs only to implement the computational model as described above, while the automatic differentiation framework manages the gradient computation through an efficient reverse-mode differentiation. Using the gradients from automatic differentiation, the Limited-memory Broyden-Fletcher-Goldfarb-Shanno (LBFGS) algorithm 42 is used for optimization.
Implementation of linear transformations. For the results in this Section, we assume that the ring-waveguide system under consideration operates with N sb = 2, i.e., 5 equally spaced lines followed by at least 4 perturbed lines on each side. The five relevant modes are indexed {−2, −1, 0, 1, 2}. For simplicity, we assume that all five ring modes couple to the waveguide with equal strength, i.e., γ e m γ and γ i m ¼ 0 8m. We also assume that the source frequencies in the waveguide are on resonance with the ring, i.e., Δω = 0 in Eq. (5). Examples of finite intrinsic loss (γ i m ≠0) and non-uniform detuning (Δω ≠ 0) are considered in   Supplementary Notes 4 and 5. Note that the different source frequencies' phases should not drift with respect to each other during the timescale of the transformation. To ensure such phase coherence between the different input frequency modes, the source could be a mode-locked laser or an electro-optic frequency comb with a tailored amplitude/phase spectrum to implement the input vector. Alternatively, active phase stabilization could be implemented to compensate for slow-timescale phase drifts. Under the assumptions made in this Section, the transformation in Eq. (5) is completely determined by the ratios κ l /γ, where κ l is controlled by the index perturbation amplitude δϵ l and phase θ l , as described by Eq. (3). Therefore, we optimize the amplitude and phase of κ l (in units of γ) for N r rings and N f modulation tones per ring to implement a variety of transformations. Note that since we only optimize for the ratios κ l /γ, our approach is robust to variations in γ during fabrication.
First, we consider the application of such ring-waveguide networks to implement high-fidelity frequency translation that is useful for frequency-domain beam-splitters or single-qubit gates.
As an example, we show a design where an input signal in mode 0, after forward propagation through the network, results in a complete conversion to mode +2. Using our inverse-design framework, such a frequency translation corresponds to designing only one column of a unitary transformation and can be achieved with a fidelity exceeding 1 − 10 −5 using just two rings and two modulation tones per ring, as shown in Fig. 2a, b. In Fig. 2c, we present the error function versus the number of iterations. The error function is defined as 1 − F +2 , where F +2 is the normalized output photon flux in the mode +2. After a few iterations, almost all the photon flux is converted to frequency ω +2 at the output.
In addition to such high-fidelity frequency conversion implemented in forward propagation through the network, the transformations achieved in this architecture can be different in forward and reverse propagation due to the relative phase shift between the modulation tones across the different rings and the explicit time-varying nature of the dynamically modulated system 43 . This is in sharp contrast with MZI-based architectures, which are inherently reciprocal. As an example, we show in Fig. 3 that we can simultaneously realize with a fidelity exceeding 1 − 10 −5 a frequency shift, say, 0 → 2, in forward propagation (Fig. 3a) and a different shift, say, 2 → 1, in reverse propagation (Fig. 3b) with three modulated rings.
Achieving frequency shifts using modulated rings, as shown in Figs. 2 and 3, requires designing only one and two columns of the 5 × 5 unitary matrix, respectively. On the other hand, if the number of modulation tones N f and/or the number of rings N r are increased, an arbitrary unitary transformation can be achieved with a high fidelity. As an example, we depict in Fig. 4a a 5 × 5  Fig. 4b, we present the amplitudes of the matrix achieved using one ring and four modulation tones, resulting in a fidelity of 1 − 5.9 × 10 −3 . With four rings and four modulation tones, the fidelity is boosted to over 1 − 3.8 × 10 −6 , as shown by the amplitudes in Fig. 4c. In Fig. 4d, we tabulate as a function of N r and N f one minus the maximum fidelities obtained in approximating the 5 × 5 permutation matrix, showing that very high fidelities can be achieved using a wide variety of N r and N f combinations.
In Fig. 4, we considered only the accuracy of the amplitudes achieved by our inverse-design approach. We now show that our architecture can also capture the phase of an arbitrary unitary transformation with a high fidelity. To demonstrate this, we consider a normalized 5 × 5 Vandermonde matrix, which is used to implement the discrete Fourier transform. This unitary transformation, defined by U mn ¼ e À2πimn=5 = ffiffi ffi 5 p , has a constant amplitude across its matrix elements but significantly varying phase, as shown in Fig. 5a. With the use of one ring and four modulation tones, the inverse-design algorithm is able to achieve a fidelity of 0.8, with the corresponding phase profile shown in Fig. 5b up to a global phase of 0.0099π. As depicted in Fig. 5c, a significantly better performance is possible with the use of four rings and four modulation tones per ring, achieving a fidelity of 1 − 7.25 × 10 −7 with a global phase of 0.596π. A map of one minus the maximum fidelities achieved by our inverse design approach as a function of the number of rings and modulation tones is shown in Fig. 5d.
While unitary transformations are usually required for quantum information processing, matrices used in classical signal processing and in neural networks are in general non-unitary. The architecture presented thus far can also be used to implement non-unitary matrices with singular values less than or equal to one using one of two techniques. First, such non-unitary matrices can provably be embedded in larger unitary matrices 44 using their singular value decomposition. Subsequently, the larger unitaries can be implemented using refractive index modulation as discussed thus far. As an example, we consider the following 3 × 3 non-unitary matrix that was randomly generated subject to the constraint that its largest singular value is equal to one:  Since there are two singular values less than 1, M can be extended into a unitary matrix by adding two dimensions. The elementwise amplitude and phase corresponding to the extended 5 × 5 unitary matrix are shown in Fig. 6a, c, respectively. Using four rings (N r = 4) and four modulation tones per ring (N f = 4), our inverse-design algorithm achieves the extended unitary matrix with a fidelity exceeding 1 − 10 −5 , as shown in Fig. 6b, d. Notice that the phase of element (5,4) is significantly different between Fig. 6c, d, but this is because the target amplitude for this element is zero. As an alternative approach, amplitude modulation, where the imaginary part of the refractive index is also modulated, can also be used to directly implement non-unitary matrices since the transformation of Eq. (5) is non-unitary under modulation of the imaginary part of the refractive index. Lastly, in order to implement matrices with singular values greater than 1, a gain element is necessary. For such matrices, a scaled version such that the singular values are below 1 can first be implemented using the methods outlined above, after which a uniform amplification for all frequency channels can rescale the matrix to its intended form.

Discussion
We have shown that combining the concepts of synthetic dimensions and inverse design enables the implementation of versatile linear transformations in photonics. A major advantage of using synthetic frequency dimensions for implementing an N × N linear transformation is that only O(N) photonic elements (modulators in our case) need to be electrically controlled. This is in contrast to real-space dimensions using path-encoding, such as MZI meshes or crossbar arrays, where the full O(N 2 ) degrees of freedom need to be electrically controlled. Such control is nontrivial both from a scalability perspective as well as from a practical geometrical perspective of connecting N 2 tunable elements (e.g. phase-shifters) to their driving electronics off-chip. The reduction in the number of individually controlled elements from O(N 2 ) to O(N) in our scheme comes from the fact that the driving signal on each of the N r EOMs can simultaneously address N f frequency modes in the synthetic dimension.
Future work could leverage synthetic frequency dimensions for complicated quantum information protocols beyond single-qudit unitary transformations, such as realizing probabilistic entangling gates for linear optical quantum computing (LOQC) 17,36 . In particular, spectral LOQC using EOMs and pulse shapers has been shown to be universal for quantum computation 17 . However, pulse shapers involve demultiplexing the frequency modes into distinct spatial channels using gratings to apply mode-bymode phase shifts, and limit the number of modes that can be accommodated within the modulator bandwidth due to a finite spectral resolution, thus reducing the benefit of using synthetic NATURE COMMUNICATIONS | https://doi.org/10.1038/s41467-021-22670-7 ARTICLE frequency dimensions. Such pulse shapers are also lossy and challenging to integrate on chip. Our architecture obviates the pulse shaper by exclusively using EOMs. The advent of ultralowloss nanophotonic EOMs in lithium niobate 45,46 , as well as progress in silicon 47,48 and aluminum nitride 49 makes our architecture fully compatible with on-chip integration, since modulation at frequencies exceeding the ring's FSR have been demonstrated 14,47,50 .
For applications in neural networks, the performance of our architecture in terms of the speed, compute density and energy consumption for multiply-and-accumulate (MAC) operations is important 51 . Assuming we need N modulation tones and N rings with FSR Δf = Ω R /2π to implement a matrix, we can input information encoded in the N frequencies and read out the matrix-vector product, which amounts to N 2 MAC operations. Since we need a frequency-resolved measurement, the fastest readout bandwidth is Δf. We assume that the input data can be prepared at speed comparable to or faster than the readout speed. Then, the computational speed in MACs per second is given by The maximum number of channels is limited by the FSR and the modulation bandwidth. If we utilize the whole available bandwidth, B = NΔf, then the speed is For a modulation bandwidth of 100 GHz and an FSR of 100 MHz (such that N = 1000), this yields a speed C = 10 14 MACs per second or 100 TMAC per second, which is comparable with MZI meshes 5,51,52 . Although achieving such small FSRs on chip is challenging, recent progress in integrating low-loss delay lines on chip 53,54 holds promise, since meter-scale delays were reported in an 8 mm 2 footprint using spiral resonators, corresponding to an equivalent FSR of~350 MHz 53 . These design techniques can be extended to lithium niobate rings with high modulation bandwidths 14,46 .
To optimize for computation density, i.e. MACs per second per unit area 51 , one can use a larger FSR Δf = 1 GHz, in a 1-mm 2 footprint, and combine synthetic frequency dimensions within each 100-GHz modulation bandwidth with wavelength-division multiplexed channels separated by 100-GHz-wide stopbands, to parallelize several uncoupled MAC operations across the 5 THz telecommunications band, as has been done for crossbar arrays 6,7,9,51 . This leads to a compute density of~10 TMAC s −1 mm −2 , which is much better than MZI meshes and comparable with standard silicon microring crossbar arrays 51 , with the added advantage of only O(N) electronically controlled elements. We anticipate that future progress in modulation speed and power using high-confinement integrated photonic platforms will push these current estimates further, leading to experimental implementations of MAC operations using the architecture proposed here with improvements in complexity, speed, power and footprint.

Data availability
The data related to this study is available in the manuscript and the Supplementary Materials. Additional data is available from the authors upon reasonable request. Correspondence and requests for materials should be addressed to S.F.