# Optical Realization of Wave-Based Analog Computing with Metamaterials
## 2 Computational Metamaterials
### Metasurface Approach  
Initially, let us consider a pure mathematical transformation of convolution operation in Fourier domain. For an given input function \(f(x,y)\), the corresponding output function \(g(x,y)\) is the result of a desired mathematical operator which is indicated by the Green's function \(h(x,y)\), \(x\) and \(y\) denote the spatial coordinates on the two-dimensional (2D) plane. By applying the linear convolution operation, \(g(x,y)\) can be described by  
\[g(x,y)=\iint f(x^{\prime},y^{\prime})h(x-x^{\prime},y-y^{\prime})dx^{\prime}dy ^{\prime} \tag{1}\]  
Based on convolution theorem, the Fourier transform of \(g(x,y)\) is equivalent to the multiplication of functions \(f\) and \(h\) in the Fourier domain:  
\[g(x,y)=\mathcal{F}^{-1}\big{\{}H(k_{x},k_{y})\mathcal{F}[f(x,y)]\big{\}} \tag{2}\]  
where \((\mathcal{F}^{-1}\{\cdot\})\mathcal{F}\{\cdot\}\) represents the (inverse) Fourier transform, abbreviated (\(I\))_FT_. \(k_{x}\) and \(k_{y}\) are frequency variables in the spatial Fourier space, \(H(k_{x},k_{y})\) is spatial _FT_ of the transfer function \(h(x,y)\). It is actually easy to implement Equation (2) in the practical systems by simulating the input (output) function with a classical electric field \(E_{in}(x,y)\) (\(E_{out}(x,y)\)), in this case, the spatial variables \((x,y)\) can play the role of \((k_{x},k_{y})\). In wave-based computing system, Equation (2) can be rewritten as:  
\[E_{out}(x,y)=\mathcal{F}^{-1}\{H(x,y)\mathcal{F}[E_{in}(x,y)]\} \tag{3}\]  
Figure 1: (**a**) The conceptual sketch of computational metamaterials; schematic of the general protocol for (**b**) MS approach; and (**c**) GF approach; adapted with permission from [102], AAAS, 2014. According to Equation (3), the optical computing system should comprise of three cascade metamaterial functional subblocks which are designed to accomplish \(FT\), \(H(x,y)\) and \(IFT\) sequentially. In order to realize the \(FT\) subblock, an analog of traditional lenses is employed since the converging lenses can achieve 2D Fourier transform in the focal plane. In [102], a graded-index (GRIN) dielectric slab with a parabolic variation of permittivity is introduced to realize \(FT\) operator [103; 104]. Besides of GRIN medium, meta-lens can also be applied to perform \(FT\) operator [105; 106; 107; 108; 109]. It worth nothing that, although we can define a GRIN(\(-\)) subblock to perform \(IFT\) in which the effective constitutive parameters should satisfy \(\varepsilon(\mu)_{GRIN(-)}(x,y)=-\varepsilon(\mu)_{GRIN(+)}(x,y)\), it is not feasible for natural materials or practical for metamaterials to realize simultaneously negative permeability and permittivity. Therefore, as an alternative method, we can use additional \(FT\) subblock to approximate output profile according to the relation:  
\[\mathcal{F}\{\mathcal{F}\{E_{out}(x,y)\}\}\propto E_{out}(-x,-y) \tag{4}\]  
In this way, the electric field distribution is proportionate to the mirror image of the desired output function. Based on above discussion, the fundamental components of MS approach are represented in Figure 1b. Next, we will go to the details of how to design transfer functions when implementing different mathematical operations, such as differentiation, integration and convolution. Firstly, for simplicity, we discuss the cases of one-dimensional \(n\)th derivation operators. Based on derivative property of the Fourier transform, \(d^{n}f(y)/dy^{n}=\mathcal{F}^{-1}\big{\{}\big{(}ik_{y}\big{)}^{n}\mathcal{F}[f( y)]\big{\}}\), according to Equation (3), the expression \(\big{(}ik_{y}\big{)}^{n}\) is the required transfer function, where \(H(y)\propto\big{(}ik_{y}\big{)}^{n}\) or \(H(y)\propto\big{(}iy\big{)}^{n}\).