## 2 Theory
### Lower-Dimensional Remapping: PCA Analysis  
Given our objective to address the distribution of unit vector directors in three-dimensional space and leveraging spherical coordinates with a fixed radial distance of \(r=1\), a set of one \(\theta\) and one \(\phi\) value for each voxel in space is enough to characterise the whole vector solution space. These values are represented as two independent scalar fields (an example is shown in Figure 1a). The \(\theta\) angle represents the tilt angle, and \(\phi\) is the twist angle of each LC nematic cell. The expected values for \(\theta\) and \(\phi\) are expected to exhibit a degree of smoothness, which implies gradual variation concerning neighbouring values. This characteristic is informed by practical observations indicating that liquid crystal nematic cells tend to distribute and orientate in a structured or smooth configuration. The lower-dimensional remapping of the space to be optimised is thus conducted after the assumption that the solution space must be smooth, which leads to a statistical dependence or a positive degree of spatial autocorrelation. One common way of calculating this spatial autocorrelation, the so-called Moran's \(I\), is given by [32]:  
\[I=\frac{n}{W}\frac{\sum_{i=1}^{n}\sum_{j=1}^{n}w_{ij}(x_{i}-\bar{x})(x_{j}-\bar {x})}{\sum_{i=1}^{n}(x_{i}-\bar{x})^{2}}, \tag{4}\]  
where \(I\) is the Moran's I statistic, \(n\) is the number of spatial units, \(x_{i}\) is the value of the variable of interest in unit \(i\), \(\bar{x}\) is the mean of the variable of interest, \(w_{ij}\) is the spatial weight between units \(i\) and \(j\), and \(W\) is the sum of spatial weights. [PERSON]'s \(I\) ranges from \(-1\) to \(1\). A positive value indicates positive spatial autocorrelation (similar values cluster together), while a negative value indicates negative spatial autocorrelation (dissimilar values cluster together). Thus, we expected the solution to have a positive Moran's I. On the other hand, given a sufficiently large set of random 3D smooth scalar field distributions, we can reconstruct any new smooth scalar field, including our problem's solution, as a linear combination of a number of those random scalar fields. The idea here is that since our solution is assumed to be a part of a broader set of 'all possible smooth scalar fields', we only need to characterise and seek the solution in a new space of 'all possible smooth scalar fields', which since featuring spatial autocorrelation, can be expressed in a way lower number of variables than in the original Cartesian 3D space. To find the minimum number of smooth scalar fields capable of reconstructing any smooth scalar distribution, or in other words, that explains the maximum variance possible, PCA is conveniently used. PCA serves as a method for simplifying and understanding complex datasets by transforming the original data into a new set of maximally uncorrelated coordinates, known as principal components, that highlight the directions in which the data varies the most [33; 34; 35]. In our case, PCA starts with the original dataset, a matrix where each row corresponds to a different random smooth distribution as shown in Figure 1a, which will either depict the \(\theta\) or the \(\phi\) distributions and is obtained through repeatedly averaging the elements with respect of its neighbors of initial 3D random uniform scalar distributions. Then, the covariance matrix of the dataset is calculated, representing the relationships between various variables. Following this, the eigenvectors and eigenvalues of the covariance matrix are computed, with each eigenvector representing a principal component and the eigenvalues indicating the variance each component explains. Following this method, principal components are sorted by their eigenvalues' magnitude. The first \(x\) principal components with a cumulative variance close enough to 1 (typically around 0.995) are selected, serving as a new base of variables to express any smooth distribution.