## 3 Results  
This study first examines a uniform pixel configuration based on an LC infinite cell. Throughout this work, the pixels are arranged two-dimensionally in the \(xy\) plane, with the \(z\) plane representing the direction of light propagation. This configuration enables us to obtain a set of canonical curves related to the director distribution along the thickness of the LC layer. Figure 3 shows solid-line results obtained through the minimisation of the free energy [8; 9] via Equation (2), and our scheme based on the genetic algorithm (discrete points in Figure 3). Figure 3a shows the results for an infinite cell in the \(xy\) plane with a small pretilt and a parallel-aligned configuration, with the director lying in the \(xz\)-plane [8; 36]. More specifically, the parameters considered are defined in Table 1.1 in [36]. The GA algorithm considers here a mesh of [\(z\),\(x\),\(y\)] = [54 \(\times\) 5 \(\times\) 5] with a spatial resolution of 0.1 \(\mu\)m in the \(x\) and \(y\)-axis, and 50 nm for the \(z\)-axis. This setup implies solving 2700 unknown variables. However, with our PCA-GA method, the unknown variables are decoded by only 314 components. Figure 3a shows the twist angle related to Twisted-Nematic LC structures for different external voltages applied. Again, the results obtained through the genetic algorithm are compared to those obtained by minimising the elastic Frank-Oseen (FO) free energy by the Euler-Lagrange method, showing a good agreement between methods in all cases. The next system analysed is based on a set of binary phase gratings with period 8 \(\upmu\)m, i.e., each pixel size is 4 \(\upmu\)m. The fill factor considered in the simulations is close to 90%. The fill factor is the surface ratio between the active pixel size and the total pixel area, which includes the interpixel gap. The parameters considered for the physical parameters of the LC are summarised in Table 1 in [7]. The GA algorithm considers a spatial grid of [\(z\),\(x\),\(y\)] = [12 \(\times\) 13 \(\times\) 25] for vertical gratings and [\(z\),\(x\),\(y\)] = [12 \(\times\) 25 \(\times\) 13] for horizontal gratings (with a spatial resolution of 0.32 \(\upmu\)m for the \(x\) and \(y\)-axis, and 0.21 \(\upmu\)m for the \(z\)-axis) implying the resolution of 7800 unknown parameters. Here, the PCA-GA scheme solves the problem with only 494 principal components. The number of parameters to be solved by PCA-GA is the same for both types of gratings considered here. Here, the PCA-GA scheme solves the problem with only 494 principal components. The liquid crystal used is the commercially available E7, typically chosen in simulation works [8,13], and the thickness, 3 \(\upmu\)m, is the range of what present PA-LCoS implement. The binary phase grating generated by the PA-LCoS display with the highest frequency possible is based on two binary phase gratings with a 2-pixel period along the \(x\)-axis (horizontal grating with the grating vector defined as \(\hat{K}=\hat{x}\)) and \(y\)-axis (vertical grating with the grating vector defined as \(\hat{K}=\hat{y}\)), respectively. The \(x\)-axis is defined parallel to the predominant director orientation, while the \(y\)-axis is orthogonal. Figure 4a,b represents the phase shift profile along the direction of the grating vector for horizontal (\(x\)-axis) and vertical (\(y\)-axis) binary phase gratings, respectively. Equation (8) in [8] computes the phase shift once the final distribution of \(\mathbf{n}\) is calculated. Figure 4c,e represents the director and voltage distributions for \(xz\) and \(yz\) planes for a two-pixel horizontal grating (\(\hat{K}=\hat{x}\)) with a pixel size of \(w_{\text{pixel}}\) = 4 \(\upmu\)m. The same planes are represented for a two-pixel vertical grating (\(\hat{K}=\hat{y}\), being both unitary vectors) in Figure 4d for \(yz\) plane, and Figure 4f for \(xz\) plane. In this configuration, the LC director has a twist around the \(z\)-axis induced by the component of the fringing electric field at the pixel borders.