 Research
 Open Access
 Published:
Deep learningenabled compact optical trigonometric operator with metasurface
PhotoniX volume 3, Article number: 15 (2022)
Abstract
In this paper, a novel strategy based on a metasurface composed of simple and compact unit cells to achieve ultrahighspeed 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 wavebased 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 ultrafast running speeds.
Introduction
As one family of the basic mathematical operations, trigonometric operations lie at the core position in the field of communication and signal processing [1]. Conventional devices used to perform trigonometric operations, such as fieldprogrammable gate array (FPGA) [2] and digital signal processors (DSPs) [3], are usually based on electronic components which result in low speed, high power consumption, and inevitable complexity [4, 5]. Nowadays, exponentially growing communication data and information need to be processed and stored in realtime, which poses a tough challenge to conventional electronbased operations. Therefore, a disruptive solution for numerical trigonometric operations is highly desired.
Over the past few years, the emergence of optical computing has provided the possibility to break several limitations of conventional signal processors [6]. Such an EMwavebased computing strategy avoids analogtodigital conversion and allows ultrahighspeed massively parallel operations [7], which has been proven to have great potential in temporal integration and differentiation [8, 9], Hilbert transformation [10], spatial differentiators [11], logic gate [12], and arbitrary waveform generation [13]. Recently, as a twodimensional (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 Fourierbased optical computing devices, metasurfaces can achieve modulation of the EM profile within the subwavelength thickness, which facilitates the miniaturization of photonic signal processors in volume. The superiority of such a metasurfacebased 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 metasurfacebased optical computing works have mainly dealt with spatialdomain filtering and frequencydomain filtering, while lack of the solutions for optical function operations with specific numerical inputs. Besides, in such traditional metasurfacebased 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 metasurfacebased 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 learningdriven 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 \({\phi }_{0}\) are the initial amplitude and phase of the electric field, respectively, and here these parameters are set as: \({E}_{0}\) = 1 and \({\phi }_{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 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}_{j}^{1}\), \({b}_{j}^{1}\) are the weight and bias between the input and hidden layers, respectively. Here, these two parameters are set as:\({w}_{j}^{1}=1\) and \({b}_{j}^{1}=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}_{j}^{2}= \frac{{e}^{{jkr}_{j}}}{{r}_{j}}\) and \(b_{j}^{2}\) are the weight and bias between output layer and hidden layer, respectively. \(k=\frac{2\pi }{\lambda }\), \({r}_{j}=\sqrt{{\left(x{x}_{j}\right)}^{2}+{\left(y{y}_{j}\right)}^{2}+{\left(z{z}_{j}\right)}^{2}}\)and the bias is set as \({b}_{j}^{2}=0\) . 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”, “\(\frac{\sqrt{2}}{2}\)”, “0”, “\(\frac{\sqrt{2}}{2}\)”, “1” for sine and cosine functions, while “\(\infty\)”, “1”, “0”, “1”, “\(\infty\)” for tangent and cotangent functions, respectively. In addition, a function is also defined to evaluate the performance between the output intensity \({E}_{ij}^{y}\) 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 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, splitring resonator (SRR) metaatoms are utilized as the PancharatnamBerry (PB) 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µmthick copper layers. The phase control performance of the SRR unit cell is numerically simulated by using a commercial fullwave simulation software. As shown in Fig. 2d, periodic boundary conditions are applied along x and ydirections and a righthanded circularly polarized (RHCP) plane wave is set as the incident wave when performing the numerical simulations. According to the PB phase principle, the transmitted crosspolarized 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 alloptical computing system based on multiplelayer metasurfaces, such as optical logical operator [28] and multiobjective classification [35,36,37], here the designed optical trigonometric operator is composed of single layer metasurface with a compact size of \(12\uplambda \times 10\uplambda\), 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\uplambda\) 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 ultrahigh 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 \(\frac{1.22\lambda }{NA}\) , where \(NA=\rho \mathrm{sin}\delta\) is the numerical aperture, \(\rho\) is refractive index, and \(\delta\) 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 learningenabled 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 wellfitting calculated, 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 metaatoms used to construct the metasurface ensures the robustness of the system while avoiding complicated and highcost 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 chipscale ultrafast 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 metasurfacebased optical diffractive neural networks.
Method
A test scenario is built to verify the practicability of the designed optical trigonometric operator. To generate the desired quasiplane 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, 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 EFS105–12 fiber optic active antenna probe mounted on two orthogonal linear computercontrolled translation stages is used to measure the lefthanded circularly polarized (LHCP) electric field in the output layer.
Availability of data and materials
The data that support the findings of this study are available from the corresponding author on request.
Abbreviations
 EM:

Electromagnetic wave
 FPGA:

Fieldprogrammable gate array
 DSPs:

Digital signal processors
 2D:

Twodimensional
 BIC:

Bound states in the continuum
 BP:

Backpropagation
 SDG:

Stochastic gradient descent
 SRR:

Splitring resonator
 PB:

PancharatnamBerry
 RHCP:

Righthanded circularly polarized
 LHCP:

Lefthanded circularly polarized
References
Considine V. CORDIC trigonometric function generator for DSP. In: International Conference on Acoustics, Speech, and Signal Processing. 1989;4:2381–4.
Tianli L, Tao Y, Xing W, Haigang Y. An efficient singleprecision floatingpoint trigonometric function calculation circuit structure and implementation. Microelectronics & Computer. 2018;35:33–7.
Ma S, Wang Z. Rapid computation of trigonometric function on DSP. Comput Eng. 2005;31:12–4.
Price DDS. A history of calculating machines. IEEE Micro. 1984;4:22–52.
Clymer AB. The mechanical analog computers of Hannibal Ford and William Newell. IEEE Annals Hist Comput. 1993;15:19–34.
Wu J, Lin X, Guo Y, Liu J, Fang L, Jiao S, et al. Analog Optical Computing for Artificial Intelligence. Engineering. 2021;10:13345.
ZangenehNejad F, Sounas DL, Alù A, Fleury R. Analogue computing with metamaterials. Nat Rev Mater. 2020;6:207–25.
Slav´ık R, Park Y, Ayotte N, Doucet S, Ahn TJ, LaRochelle S, et al. Photonic temporal integrator for alloptical computing. Opt Express. 2008;16:18202–14.
Michalska M, Swiderski J, Mamajek M. Arbitrary pulse shaping in erdoped fiber amplifierspossibilities and limitations. Opt Laser Technol. 2014;60:8–13.
Ashrafi R, Dizaji MR, Cortés LR, Zhang J, Yao J, Azaña J, et al. Timedelay to intensity mapping based on a secondorder optical integrator: application to optical arbitrary waveform generation. Opt Express. 2015;23:16209–23.
Pérez D, Gasulla I, Crudgington L, Thomson DJ, Khokhar AZ, Ke L, et al. Multipurpose silicon photonics signal processor core. Nat Commun. 2017;8:636.
Boolakee T, Heide C, GarzónRamírez A, Weber HB, Franco I, Hommelhoff P. Lightfield control of real and virtual charge carriers. Nature. 2022;605:251–5.
Zhao W, Liu S, Qi H, Peng G, Shen M. Sampled fiber grating for wdm signal queuing with picosecond time interval. Opt Laser Technol. 2017;97:302–7.
Ding X, Wang Z, Hu Z, Liu J, Zhang K, Li H, et al. Metasurface holographic image projection based on mathematical properties of Fourier transform. PhotoniX. 2020;1:1–12.
Lee D, So S, Hu G, Kim M, Badloe T, Cho H, et al. Hyperbolic metamaterials: fusing artificial structures to natural 2D materials. eLight. 2022;2:1–23.
Wang Z, Hu G, Wang X, Ding X, Zhang K, Li H, et al. Singlelayer spatial analog metaprocessor for imaging processing. Nat Commun. 2022;13:2188.
Zhao Z, Ding X, Zhang K, Fu J, Burokur SN, Wu Q. Generation and deflection control of a 2D Airy beam utilizing metasurfaces. Opt Lett. 2021;46:5220–3.
Hossein B, Zahra K, Somayyeh K, Amin K. Integration in analog optical computing using metasurfaces revisited: toward ideal optical integration. J Opt Soc Am B. 2017;34:1270–9.
Zhu T, Zhou Y, Lou Y, Ye H, Qiu M, Ruan Z, et al. Plasmonic computing of spatial differentiation. Nat Commun. 2017;8:1–6.
Zuo SY, Tian Y, Wei Q, Cheng Y, Liu X. Acoustic analog computing based on a reflective metasurface with decoupled modulation of phase and amplitude. J Appl Phys. 2018;123:091704.
Fu W, Zhao D, Li Z, Liu S, Tian C, Huang K. Ultracompact metaimagers for arbitrary alloptical convolution. Light Sci Appl. 2022;11:1–13.
Kwon H, Sounas D, Cordaro A, Polman A, Alù A. Nonlocal metasurfaces for optical signal processing. Phys Rev Lett. 2018;121: 173004.
Huo P, Zhang C, Zhu W, Liu M, Zhang S, Zhang S, Xu T. Photonic spinmultiplexing metasurface for switchable spiral phase contrast imaging. Nano Lett. 2020;20:2791–8.
Wang Z, Chang L, Wang F, Li T, Gu T. Integrated photonic metasystem for image classifications at telecommunication wavelength. Nat Commun. 2022;13:1–8.
Cordaro A, Edwards B, Nikkhah V, Alù A, Engheta N, Polman A. Solving integral equations in freespace with inversedesigned ultrathin optical metagratings. 2022. arXiv preprint arXiv:2202.05219.
Zhang W, Qu C, Zhang X. Solving constantcoefficient differential equations with dielectric metamaterials. J Opt. 2016;18: 075102.
Zhao Z, Wang Y, Ding X, Li H, Fu J, Zhang K, et al. Compact logic operator utilizing a singlelayer metasurface. Photon Res. 2022;10:316–22.
Qian C, Lin X, Lin X, Xu J, Sun Y, Li E, Chen H. Performing optical logic operations by a diffractive neural network. Light Sci Appl. 2020;9:1–7.
Lin W, Chen L, Chen Y, Cai W, Hu Y, Wen K. Singleshot speckle reduction by eliminating redundant speckle pattern in digital holography. Appl Opt. 2020;59:5066–72.
Luo Y, Zhao Y, Li J, Çetintaş E, Rivenson Y, Jarrahi M, Ozcan A. Computational imaging without a computer: seeing through random diffusers at the speed of light. eLight. 2022;2:1–16.
Qian C, Zheng B, Shen Y, Jing L, Li E, Shen L, Chen H. Deeplearningenabled selfadaptive microwave cloak without human intervention. Nat Photonics. 2020;14:383–90.
Lin X, Rivenson Y, Yardimci NT, Veli M, Luo Y, Jarrahi M, et al. Alloptical machine learning using diffractive deep neural networks. Science. 2018;361:1004–8.
Lin R, Alnakhli Z, Li X. Engineering of multiple bound states in the continuum by latent representation of freeform structures. Photon Res. 2021;9:B96–103.
Ren H, Shao W, Li Y, Salim F, Gu M. Threedimensional vectorial holography based on machine learning inverse design. Sci Adv. 2020;6:eaaz4261.
Khoram E, Chen A, Liu D, Ying L, Wang Q, Yuan M, et al. Nanophotonic media for artificial neural inference. Photon Res. 2019;7:823–7.
Wu Z, Zhou M, Khoram E, Liu B, Yu Z. Neuromorphic metasurface. Photon Res. 2020;8:46–50.
Rahman MSS, Li J, Mengu D, Rivenson Y, Ozcan A. Ensemble learning of diffractive optical networks. Light Sci Appl. 2020;10:1–13.
Li Z, Cheng H, Liu Z, Chen S, Tian J. Plasmonic airy beam generation by both phase and amplitude modulation with metasurfaces. Adv Opt Mater. 2016;4:1230–5.
Acknowledgements
Not applicable.
Supporting Information
Supplementary information accompanies this paper.
Funding
This work is supported by Natural Science Foundation of Heilongjiang Province (YQ2021F004), National Natural Science Foundation of China (Nos. 61871152 and 62171153).
Author information
Authors and Affiliations
Contributions
X. D. proposed the idea. Z. Z., Y. W. and C. G. designed and fabricated the samples and performed the numerical simulations. S. N. B. performed the measurements. Z. Z., X. D., H. L. and K. Z. wrote the manuscript. X. D., Q. W. and J. L. supervised the overall projects. All the authors analyzed the data and discussed the results. All the authors read and approved the final manuscript.
Corresponding authors
Ethics declarations
Competing interests
The authors declare that they have nonfinancial competing interests.
Additional information
Publisher’s Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Supplementary Information
Additional file 1:
Figure S1. Calculated results for all designed trigonometric operations. Figure S2. Simulated results for all designed trigonometric operations. Figure S3. Measured results for all designed trigonometric operations. Figure S4. Measured results for sin(270\(^\circ\)). Figure S5. Shapes of the incident light signal (white regions) corresponding to each input mode. Figure S6. Normalized electric field distribution of incident plane wave, after modulation by the tailored absorbers, on the metasurface. Figure S7. (a) Magnitude variation of the crosspolarized transmission coefficient as the inner radius R of the ring changes. (b) Phase variation of the crosspolarized transmission coefficient when rotating the unit cell. (c) Phase variation of the transmitted crosspolarized wave in the 812 GHz frequency range under different rotation angles of the unit cell. (d) Measured results of cos (90°) at 9 GHz and 9.5 GHz.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Zhao, Z., Wang, Y., Guan, C. et al. Deep learningenabled compact optical trigonometric operator with metasurface. PhotoniX 3, 15 (2022). https://doi.org/10.1186/s43074022000624
Received:
Accepted:
Published:
DOI: https://doi.org/10.1186/s43074022000624
Keywords
 Optical trigonometric operations
 Metasurface
 Diffractive neural network