# Enhancing Efficiency of Electromagnetic Simulation in Time Domain with Transformation Optics
## 2 Coordinate Transformation Applied in Simulation and Mapping Functions  
The methodology of transforming EM waves between two coordinates can be implemented by utilizing the optical transformation medium, of which the optical properties can be obtained from the following equation [34]:  
\[\varepsilon^{\prime}=\frac{\mathsf{J}\varepsilon\mathsf{J}^{\mathsf{T}}}{ \mathsf{det}\mathsf{J}},\;\;\mu^{\prime}=\frac{\mathsf{J}\mu\mathsf{J}^{\mathsf{ T}}}{\mathsf{det}\mathsf{J}}, \tag{1}\]where \(\varepsilon\) and \(\mu\) are the relative permittivity and permeability tensors of the real medium in the physical coordinate (\(x\), \(y\), \(z\)), while \(\varepsilon\)' and \(\mu\)' are the tensors of the optical transformation medium in the numerical coordinate (\(u\), \(v\), \(w\)), \(\mathbf{J}\) is a \(3\times 3\) Jacobian matrix, which can be expressed as:  
\[\mathbf{J}=\left[ \begin{array}{ccc}\frac{\partial u}{\partial x}&\frac{ \partial u}{\partial y}&\frac{\partial u}{\partial z}\\ \frac{\partial v}{\partial x}&\frac{\partial v}{\partial y}&\frac{\partial v}{ \partial z}\\ \frac{\partial u}{\partial x}&\frac{\partial v}{\partial y}&\frac{\partial v}{ \partial z}\\ \end{array} \right], \tag{2}\]  
and det is the determination of a matrix. The electric and magnetic fields in both coordinates have the following relationship:  
\[\mathbf{E}^{\prime}=\left(\mathbf{J}^{T}\right)^{-1}\mathbf{E},\ \mathbf{H}^{ \prime}=\left(\mathbf{J}^{T}\right)^{-1}\mathbf{H}. \tag{3}\]  
Hence, the optical transformation medium (usually anisotropic) depends on the derivative of these coordinates. To utilize the methodology in the finite-difference simulation, we consider \(2n\) grids, with various cell sizes, distributed in the physical coordinate \(x\) with the system length \(L_{x}\), as shown in Figure 1a. The points \(\{x_{-n},\ \ldots,\ x_{i},\ \ldots,\ x_{n}\}\) are employed to define the domain of each grid, where \(i\) is an integer from \(-n\) to \(n\). The system length \(L_{x}\) and the points \(\{x_{-n},\ \ldots,\ x_{i},\ \ldots,\ x_{n}\}\) are predefined according to the structure of interest. On the other hand, the same number of grids, each with the constant cell size \(\Delta u\), can be used in the numerical coordinate \(u\) with the system length \(L_{u}\), as shown in Figure 1b. In this time, the length \(L_{u}\) is decided by a designated mapping function, i.e., \(u=f(x)\). Tailoring the function depends on the non-uniformity of the physical grids (which we will discuss later). Similarly, the points \(\{u_{-n},\ \ldots,\ u_{i},\ \ldots,\ u_{n}\}\) can be used to represent the domain of each grid, where \(u_{i}=-L_{u}/2+(i+n)\Delta u\). Assume that \(f(x)\) is known. Then, for a physical grid centered at \(x_{i+1/2}=(x_{i+1}+x_{i})/2\) and the corresponding numerical grid centered at \(u_{i+1  
Based on the theoretical work in [33], the simulation with the proposed method to obtain the transmission spectrum through a rectangular sub-wavelength aperture, as shown in Figure 2, is considered for the demonstration. The aperture size is fixed to \(w=100\) nm, \(l=300\) nm, and \(h=100\) nm. The lengths of the metallic film in both directions are \(L_{x}=L_{z}=8\)\(\upmu\)m.  
To properly resolve the aperture in the physical coordinate \((x,y,z)\), fine grids should be applied in the central area while coarse grids can be applied to the side area; thus, the total cell can be intensively reduced in order to save the computational resource. Then, the mapping function can be designed as that depicted in Figure 3, where the slope in the central area is sharp while that in the side area is smooth. The mapping function could be composed of multiple functions with their neighboring end points connected to divide the system into a number of regions properly. Since the aperture is symmetrical, we discuss the \(x\geq 0\) domain at first. In this demonstration, the domain is divided into \(m\) regions, and  
Figure 3: Schematic of the mapping function \(u=f(x)\).