Deep learning-enabled compact optical trigonometric operator with metasurface

In this paper, a novel strategy based on a metasurface composed of simple and compact unit cells to achieve ultra-high-speed trigonometric operations under specific input values is theoretically and experimentally demonstrated. An electromagnetic wave (EM)-based optical diffractive neural network with only one hidden layer is physically built to perform four trigonometric operations (sine, cosine, tangent, and cotangent functions). Under the unique composite input mode strategy, the designed optical trigonometric operator responds to incident light source modes that represent different trigonometric operations and input values (within one period), and generates correct and clear calculated results in the output layer. Such a wave-based operation is implemented with specific input values, and the proposed concept work may offer breakthrough inspiration to achieve integrable optical computing devices and photonic signal processors with ultra-fast running speeds.

Recently, as a two-dimensional (2D) version of metamaterial with an attractive ability to manipulate electromagnetic waves [14][15][16][17], metasurface concept brings new developments to optical computing [18]. Compared to conventional Fourier-based optical computing devices, metasurfaces can achieve modulation of the EM profile within the sub-wavelength thickness, which facilitates the miniaturization of photonic signal processors in volume. The superiority of such a metasurface-based optical computing strategy has been demonstrated in various optical signal processing scenarios, such as spatial differentiation, integration, and convolution [19][20][21], Laplacian operation [22], image processing and classifications [23,24], solving equations [25,26]. However, the proposed metasurface-based optical computing works have mainly dealt with spatialdomain filtering and frequency-domain filtering, while lack of the solutions for optical function operations with specific numerical inputs. Besides, in such traditional metasurface-based photonic signal processing solutions, the structural parameters of metasurface need to be reconstructed and continuously adjusted to obtain specific outputs when facing a new task, which hinders flexibility and cost optimization. Notably, as a powerful numerical tool that has made significant advances in the fields of optical logic computing [27,28], image processing [29,30], cloaking [31], target recognition [32], excitation of bound states in the continuum (BIC) [33] and holographic generation [34], to name a few, deep learning approach provides a feasible route to simplify the design of photonic signal processors that perform mathematical function operations.
To this end, we propose a compact metasurface-based platform driven by deep learning, which enables the implementation of four basic trigonometric operations at the speed of light. Our design features several attractive advantages: Firstly, we achieve EMbased basic trigonometric operations under specific input values and the optimized visualized outputs allow clear and recognizable operation results. Secondly, only one hidden layer is utilized in the diffractive neural network under the proposed composite input mode strategy, which considerably reduces the resources and time required to train the network and improves integration with other photonic systems. Finally, the deep learning approach based on the backpropagation (BP) algorithm enables to remarkably improve the efficiency and flexibility when designing the proposed optical trigonometric operator.

Results
For the realization of deep learning-driven optical operators, it is crucial to establish a proper mapping relationship between virtual computing and physical implementation. Figure 1 shows the conceptual representation of the proposed diffractive neural network and the corresponding physical model in action. A single layer metasurface is trained to recognize each input mode represented by the plane wave from the input layer, and then image the calculated results of specific trigonometric operations on the output layer. The nodes in each layer of the diffractive neural network are mapped as electric fields distributed at the incident light source, metasurface, and output plane, respectively. In particular, the final operation result can be judged by the energy distribution in the predesigned five focal regions of the output layer. The underlying physics of the designed optical trigonometric operator is analyzed in detail below.
First, the electric field intensity of the input light source generated under the designed composite input mode strategy can be expressed as: where E 0 and φ 0 are the initial amplitude and phase of the electric field, respectively, and here these parameters are set as: E 0 = 1 and φ 0 = 0. m l represents the different input modes, and R is the set of coordinates of the points located in the illuminated zone under the specific input mode. Figure 2a demonstrates the design details of the composite input mode strategy, where the entire illuminated zone of the metasurface is divided into two types of functional regions, which are mode selection and value selection zones, respectively. Each operation mode contains several input values that are selected at equal intervals within a function period. Since the period of cotangent or tangent function is only half that of sine or cosine function, half of the value selection zones are unused under these two operation modes. By activating the unit cells embedded in these mode selection regions on the metasurface, it is possible to switch between four basic trigonometric operations arbitrarily. Moreover, the input The conceptual representation of the designed optical trigonometric operator patterns of all trigonometric operations are independent of each other and do not create ambiguity. Then, the electric field distribution before arriving at the hidden layer is defined as: Where w 1 j , b 1 j are the weight and bias between the input and hidden layers, respectively. Here, these two parameters are set as:w 1 j = 1 and b 1 j = 0 . The electric field distribution after modulation by the metasurface can be written as: with φ j being the bias imposed to the phase of the incident wave, which can be obtained after sufficient training of the proposed neural network. After propagating through the last scattering distance, the electric field distribution on the output layer can be defined as: where w 2 j = e −jkr j r j and b 2 j are the weight and bias between output layer and hidden layer, respectively. k = 2π , r j = x − x j 2 + y − y j 2 + z − z j 2 and the bias is set In the end, the output calculated result is determined by the electric field energy distribution of several predesigned zones in the output layer, which can be expressed as: where Y j is the electric field intensity of each focal zone in the output layer. A detailed description of the output layer is given in Fig. 2b. It can been seen that the five focal zones at separate positions represent the designated output values, which ensures that the results are clear and judicious. Notably, due to the difference in the value range of trigonometric function, the same output condition may represent different calculated results under different operation modes, for example, "-1", " − √ 2 2 ", "0", " √ 2 2 ", "1" for sine and cosine functions, while " −∞ ", "-1", "0", "1", " ∞ " for tangent and cotangent functions, respectively. In addition, a function is also defined to evaluate the performance between the output intensity E y ij and the target intensity T ij of each node: where N is the number of nodes on the output layer. Furthermore, taking into account the number of samples that need to be calculated, we train the phase bias φ with the stochastic gradient descent (SGD) algorithm to reduce the loss value F loss : Here, β is the learning rate for training the neural network and is set to be 0.5 after optimization. So far, we have demonstrated the superiority of our strategy from a (5) E h2 (x j , y j , z j ) = e jϕ j E h1 (x j , y j , z j ) ∂ϕ theoretical point of view, which will be further supported by the following numerical demonstrations, simulations, and experimental validations. After sufficient training the designed diffractive neural network, the numerical demonstration of the functions for the proposed system is performed at the operating frequency of 10 GHz, while the distance between the output layer and hidden layer is set to be 3λ. As shown in Fig. 2c, the designed neural network has basically converged and obtained good training results after only 300 iterations. In order to quantify and analyze the calculated output results of all the considered trigonometric operations, the electric field intensities of five focal regions for all calculated output results are demonstrated in the form of histograms, as shown in Fig. 3. According to the Eqs. (7) and (8), the calculated output results presented in these histograms are consistent with the target outputs, which means that correct calculated results under all input cases are achieved by the designed optical trigonometric operator. The calculated electric field intensity distributions in the output layer of all trigonometric operations are shown in detail in Figure S1 of the Supplementary Information.
Metasurfaces with the ability to introduce an abrupt phase change to the incident wave play a core role in the physical implementation. As illustrated in Fig. 2d,   Fig. 3 The calculated output results of all the trigonometric operations, which are demonstrated in the form of histograms split-ring resonator (SRR) meta-atoms are utilized as the Pancharatnam-Berry (P-B) phase elements. The specific structural parameters of the utilized unit cell are set as: P = 7.4 mm, L = 0.5 mm, G = 2 mm, and R = 2.9 mm. A 3 mm thick dielectric substrate with relative permittivity of 2.2 + 0.001i is used and its top and bottom faces are cladded with 18-µm-thick copper layers. The phase control performance of the SRR unit cell is numerically simulated by using a commercial full-wave simulation software. As shown in Fig. 2d, periodic boundary conditions are applied along x-and y-directions and a right-handed circularly polarized (RHCP) plane wave is set as the incident wave when performing the numerical simulations. According to the P-B phase principle, the transmitted cross-polarized circularly polarized component introduces an abrupt phase change, which is twice the rotation angle θ. Therefore, any phase value between 0 and 2π obtained from the training of the diffractive neural network can be achieved, which indicates that the hidden layer can be well mapped by the designed metasurface.
The phase bias is obtained after sufficient training for constructing the metasurface corresponding to the hidden layer. Figure 2e shows a photograph of the proposed metasurface and its phase map, respectively. In comparison to previous works on all-optical computing system based on multiple-layer metasurfaces, such as optical logical operator [28] and multi-objective classification [35][36][37], here the designed optical trigonometric operator is composed of single layer metasurface with a compact size of 12 × 10 , which provides significan superiority in terms of integration. Simulations are performed for the designed optical trigonometric operator under all input conditions, where the incidence is set as RHCP plane wave with uniform amplitude and phase at the microwave frequency of 10 GHz. The distance between the output plane and the metasurface is set as 3 after optimization. The simulated output results in the form of histograms under all input conditions are displayed in Fig. 4, which agrees well with the calculated results shown in Fig. 3. In addition, the simulated electric field intensity distributions in the output layer of all trigonometric operations can be found in Figure S2 of the Supplementary Information.
A test scenario operating at microwave frequency is built to verify the practicability of the designed optical trigonometric operator presented in this paper, as shown in Fig. 5, details can be found in the Method. To evaluate and validate the practicality of our strategy, experiments are performed for all the trigonometric operations and the normalized electric field intensity histograms of five focal regions measured in the output layer are shown in Fig. 6. It can be seen that the measured output results presented in the figure are clear and consistent with the theoretical values, which are also in good agreement with the calculated and simulated results displayed in Fig. 3 and Fig. 4. The measured electric field intensity distributions in the output layer of all trigonometric operations are shown in Figure S3 in the Supplementary Information. Notably, due to the actually nonideal excitation input in the experiments, a small part of the energy leaks to other focal areas than the designed one in the output layer. However, these experimental errors do not affect the judgment of the output calculated results and can be reduced by improving the experimental scenario, for example, by enabling the input light source to be as close to plane waves as possible. Consequently, our design that enables the simultaneous implementation of four basic trigonometric operations at ultra-high operating speeds in an extremely compact device volume with only one metasurface has been rigorously validated in theory and experiment. Furthermore, the types of operations and input values can be enriched by adding value and mode selection zones under our strategy. Specifically, the largest achievable number of output values (the focal regions) depends on the diameter of Airy disk generated in our proposed computing system. Here, the diameter of Airy disk is given by 1.22 NA , where NA = ρsinδ is the numerical aperture, ρ is refractive index, and δ is half the aperture angle. The maximum value of NA in air being 1, the smallest Airy disk diameter is about 36 mm when the proposed computing system operates at 10 GHz. For the size of the designed output plane demonstrated in Fig. 2(b), if we want to ensure no interference between adjacent foci, up to 10 focal regions can be set in the y direction on the output layer, which corresponds to 10 types of output values within one period for each trigonometric operation.

Discussion
In summary, a deep learning-enabled compact optical trigonometric operator implemented by a single layer metasurface is reported. The design has theoretically and experimentally validated the possibility to precisely implement four basic trigonometric operations of sine, tangent, cosine, and cotangent functions, by well-fitting calculated, Fig. 4 The simulated output results of all the trigonometric operations, which are demonstrated in the form of histograms simulated, and measured results. The designed diffractive neural network based on the composite input mode strategy significantly improves the performance in training speed and resource usage, while bringing a highly compact device structure and attractive integration in physical implementation. The simple and practical SRR meta-atoms used to construct the metasurface ensures the robustness of the system while avoiding complicated and high-cost processing. Furthermore, our proposed strategy allows for further miniaturization of the device at higher frequencies, such as terahertz and optical ranges, which may lead to chip-scale ultra-fast computing and signal processing systems. The performance of phase and amplitude modulation of nanostructured PB phase elements composed of gold, which has been previously verified [38], can be readily applied for the physical implementation of metasurface-based optical diffractive neural networks.

Method
A test scenario is built to verify the practicability of the designed optical trigonometric operator. To generate the desired quasi-plane wave, a horn antenna is placed far enough away (around 50λ) from the metasurface. In front of the metasurface, the tailored absorbers are placed to shape the incident wave to illuminate specific mode selection and value selection zones of the metasurface. In particular, to reduce testing cost and time, here we disassemble the absorbers into two kinds of modules with different sizes, Fig. 5 Schematic diagram of the measured scenario for the optical trigonometric operator. The inset shows the design of the shaped incident beam that performs as the input layer which represent the input value and mode selection zones. As shown in Fig. 5, when performing experiments on certain trigonometric operations, these modules are assembled together to form an absorber with a specific shape to obtain the desired incidence. Finally, an EFS-105-12 fiber optic active antenna probe mounted on two orthogonal linear computer-controlled translation stages is used to measure the left-handed circularly polarized (LHCP) electric field in the output layer.