# Two-Dimensional Beam Steering Based on Compact Programmable Coding Metasurface
## 2 Design and Simulation
According to a generalized [PERSON]'s law of reflection, the dir ection of the reflected beam is determined by the phase gradient along the metasurface [4]:  
\[\sin\theta_{\mathrm{r}}-\sin\theta_{i}=\frac{\lambda_{0}}{2\pi}\frac{d\varphi}{ dx} \tag{1}\]  
where \(\theta_{i}\) is the angle of the incident wave, \(\theta_{r}\) is the angle of the reflected wave, \(\lambda_{0}\) is the wavelength, and \(\frac{d\varphi}{dx}\) is the phase gradient. However, the wave excited by the horn is not a plane wave, and the phases of the impacted wave for these meta-atoms are different. Therefore, we can obtain the coordinates of the phase center of the transmitter horn through full-wave simulation, and the compensation phase for the meta-atom (\(m\), \(n\)) can be written as:  
\[\varphi_{\mathrm{c}}(m,n)=\frac{2\pi}{\lambda}\Big{|}\overrightarrow{r}_{mm} -\overrightarrow{r}_{f}\Big{|} \tag{2}\]  
where \(\overrightarrow{r}_{mm}\) and \(\overrightarrow{r}_{f}\) are the position vectors of the meta-atom (\(m\), \(n\)) and the phase center of the transmitter horn. Therefore, if the metasurface is normally incident by an EM wave (\(\theta_{\mathrm{i}}=0\)), the phase required for the meta-atom (\(m\), \(n\)) can be written as [15]:  
\[\varphi(m,n)=-\frac{2\pi}{\lambda_{0}}(md_{x}\sin\theta\cos\phi+nd_{y}\sin \theta\sin\phi)+\varphi_{\mathrm{c}}(m,n)+\varphi_{0} \tag{3}\]  
where \(\theta\) and \(\phi\) are the elevation and azimuth angles of the desired direction, \(\mathrm{d}_{x}\) and \(\mathrm{d}_{y}\) are the periodic lengths in the x and y directions, and \(\varphi_{0}\) is the initial phase. The phase calculated by Equation (3) is a continuous value, so it needs to be quantized. The phase profile is calculated and quantized using the following equation:  
\[code(m,n)= \begin{cases}0&0<\varphi(m,n)<\pi\\ 1&\pi<\varphi(m,n)<2\pi\end{cases}  \tag{4}\]  
Figure 4 is the simulated far-field of the beam steering in the xoz plane at 28 GHz, and the details of the simulated results are listed in Table 1, which is simulated by CST Microwave Studio software with a PML (perfectly matched layer) boundary. As can be seen, with the increase in deflection angle, the gain decreases and the half-power beam width  
Figure 3: The simulated reflection amplitude and phase of the designed meta-atoms under x-polarized normal incident wave. increases. The results are in good agreement with the designed ones, and the difference between the design angle and measured angle (beam-pointing error) is less than 3\({}^{\circ}\). In addition, the specular reflection beam is significantly enhanced as the scan angle increases, which should be the reason for the decrease in gain. This problem is more pronounced when the beam scans to other directions in the upper half-plane, as shown in Figure 5.  
Figure 4: The coding pattern and simulated far\(-\)field pattern in the xoz plane. (**a,b**) 10\({}^{\circ}\); (**c,d**) 20\({}^{\circ}\); (**e,f**) 30\({}^{\circ}\); (**g,h**) 40\({}^{\circ}\); (**i,j**) 50\({}^{\circ}\); (**k,l**) 60\({}^{\circ}\). The simulations are under x\(-\)polarized normal incident wave.