  Euler's formula, an extraordinary mathematical formula, establishes a vital
link between complex-valued operations and trigonometric functions, finding
widespread application in various fields. With the end of Moore's Law,
electronic computing methods are encountering developmental bottlenecks. With
its enviable potential, optical computing has successfully achieved high-speed
operation of designed complex numbers. However, the challenge of processing and
manipulating arbitrary complex numbers persists. This study introduces a
generalized complex exponential operator (GCEO), utilizing a diffractive
optical neural network (DONN) for the computation of the complex exponential
through Euler's formula. Experiments validate a series of complex exponential
calculations using the GCEO. The GCEO has demonstrated generalizability and can
compute inputs of any precision within an appropriate error margin. The
proposed operator highlights the immense potential of DONN in optical
computation and is poised to significantly contribute to the development of
computational methods for optoelectronic integration.
