## 2 Methods
### Diffraction Waveguide System Modeling  
The diffractive waveguide and its coupler are the most critical components in diffractive waveguide systems capable of achieving 2D-EPE. To make the diffractive waveguide system more compact and lightweight, we used a VHG as the input coupler and a 2D holographic grating as the output coupler to achieve 2D-EPE. The grating layout in these two regions effectively reduced the volume of the optical system, providing a better user experience for wearing and use. In the modeling process, a traditional reflecting volume holographic grating was used as the input coupler due to its wider angular bandwidth than a transmitting volume holographic grating, which allows for a larger field of view and higher energy utilization, as it only has one diffraction order. In this work, the designed 2D holographic grating was used as the output coupler. In optical simulation software such as Zemax OpticStudio, tracing of light rays requires attention to their deflection direction and energy distribution, which is achieved through phase modulation of the incident light according to the diffraction plane [25]. This is  
Figure 3: Two-dimensional hexagonal periodic lattice (Greens represent the Primitive Translation Vectors of periodic structure (here is grating). Blues represent grating vectors). expressed as \(\Delta\mathrm{L}_{\mathrm{out}}=\Delta\mathrm{L}_{\mathrm{in}}+\frac{\lambda}{2\pi}\varphi\), where \(\Delta\mathrm{L}_{\mathrm{out}}\) and \(\Delta\mathrm{L}_{\mathrm{in}}\) are the optical path differences at the output and input:  
\[\left\{ \begin{array}{rl}&n_{1}L^{\prime}=n_{0}L+\frac{m\lambda}{\Lambda_{1}} L_{f}\\ &n_{1}M^{\prime}=n_{0}M+\frac{n\lambda}{\Lambda_{2}}M_{f}\end{array} \right. \tag{5}\]  
\(n_{0}\) and \(n_{1}\) are the refractive indices of the incident and exit media, respectively. \(L\) and \(L^{\prime}\) are the direction cosines of the incident and exit light in the x direction, while \(M\) and \(M^{\prime}\) are the direction cosines of the incident and exit light in the y direction. \(\Lambda_{1}\) and \(\Lambda_{2}\) are the moduli of the initial basic displacement vectors of the two-dimensional periodic structure; \(L_{f}\) and \(M_{f}\) are the direction cosines of the initial basic displacement vector in the x and y directions, respectively. \(m\) and \(n\) are the orders of the two-dimensional diffraction. The Zemax OpticStudio nonsequential mode enables free definition of optical surfaces by custom objects with DLL functions. In order to realize ray tracing of 2D gratings, a DLL is developed based on the ray tracing k-vector circle diagram model proposed in Section 2.1 and the analysis of 2D grating ray tracing in Equation (5), which has the function of 2D ray tracing and the ability to adjust the primitive lattice slip vector, thus allowing the simulation of all types of 2D gratings. This DLL function can still predefine its own diffraction efficiency and use the diffraction efficiency hyperparameters as optimization variables to participate in the optimization of optical uniformity and optical energy utilization. As shown in Figure 4, an out-coupler with a custom DLL as a spectral function is used as a coupled-out device for the diffractive waveguide system. Its (0,2) order reflection is injected into the human eye as the coupled-out light, while the diffracted light of the (0,0), (\(-\)1,1), and (1,1) order expand the image to the left, right, and front directions, respectively. The stray light appears because the (0,0) order coupled out light passes through the upper surface of the flat waveguide and is generated due to the reflection of the interface. In order to improve the light efficiency of the whole system and the imaging quality, the upper surface of the flat waveguide needs to be coated with an antireflection. When designing a diffractive waveguide coupling device using a custom DLL, the diffraction order and diffraction efficiency can be determined first based on the optical index.