## 3 Material and Methods
### The Art of Gradient Tensor Analysis  
Tensors are an extension to the concepts of scalars, vectors and matrices. A tensor is represented as an organized multidimensional array of numerical values. A practical example of this is the magnetic gradient tensor (Figure 3) [37]:  
\[B= \begin{bmatrix}\frac{dB_{x}}{dx}&\frac{dB_{y}}{dy}&\frac{dB_{x}}{dz}\\ \frac{ddy}{dx}&\frac{dB_{y}}{dy}&\frac{dB_{y}}{dz}\\ \frac{dB_{y}}{dx}&\frac{dB_{y}}{dy}&\frac{dB_{y}}{dz}\\ \end{bmatrix} = \begin{bmatrix}B_{xx}&B_{xy}&B_{xz}\\ B_{yx}&B_{yy}&B_{yz}\\ B_{zx}&B_{zy}&B_{zz}\\ \end{bmatrix}  \tag{1}\]  
where \(B_{x}\), \(B_{y}\) and \(B_{z}\) are: \(x\), \(y\) and \(z\) magnetic field components. The sheer volume increase in measured data presents many opportunities for new input into source detection and forward modelling algorithms. Tensors can be categorized based on their rank or order [40]. This categorization is evident in the count of components that a tensor has within an \(N\)-dimensional space. Hence, a tensor with order \(p\) comprises \(N^{p}\) components. For instance, in a three-dimensional Euclidean space, the number of components in a tensor is \(3^{p}\). From this, for example:  
\(\circ\) A zero-order tensor (\(p=0\)) contains a single element and is referred to as a scalar. Physical quantities that only possess magnitude are depicted using scalars;  
\(\circ\) A tensor of order one (\(p=1\)) consists of three elements and is termed a vector. Quantities that encompass both magnitude and direction are depicted using vectors. \(B_{x}\) is an example of a first rank tensor component;A tensor of order two (\(p=2\)) comprises nine elements and is commonly illustrated using a matrix. \(B_{xx}=\frac{dB_{x}}{dx}\) is an example of a second rank tensor component;  
A tensor of order three (\(p=3\)) has twenty-seven components. \(B_{xxy}=\frac{d^{2}B_{x}}{dx}\) is an example of a third rank tensor component. A structure tensor is a matrix derived from the gradient of a function. It is a second order tensor (Figure 3) (has components such as \(B_{xy}\)), and has 2D and 3D forms (can be represented by either two or three variables). The 3D form is used in gradiometer surveys. Assume that \(B\) is a function of three variables (\(x\), \(y\), \(z\)). We can recognize that since  
Figure 3: Calculated gradient tensor from Bou Azzer aeromagnetic datasets. \(H=-\
abla\varphi\), this implies that (in SI units) \(B_{x}=-\mu_{0}\frac{d\varphi}{dx}\), \(B_{y}=-\mu_{0}\frac{d\varphi}{dy}\), \(B_{z}=-\mu_{0}\frac{d\varphi}{dz}\) Therefore, the structure tensor would be [41]:  
\[B=\
abla\otimes\mu_{0}\
abla\varphi= \begin{bmatrix}\frac{d}{dx}\\ \frac{d}{dx}\\ \frac{d}{dz}\\ \end{bmatrix}\begin{bmatrix}-\mu_{0}\frac{d\varphi}{dx}&-\mu_{0}\frac{d \varphi}{dy}&-\mu_{0}\frac{d\varphi}{dz}\\ \frac{d}{dz}\\ \end{bmatrix} =-\mu_{0} \begin{bmatrix}\frac{d\varphi}{dx^{2}}&\frac{d^{2} \varphi}{dx\times dy}&\frac{d^{2}\varphi}{dx\times dz}\\ \frac{d^{2}\varphi}{dx\times dy}&\frac{d^{2}\varphi}{dz\times dz}\\ \end{bmatrix}  \tag{2}\]  
\[\implies B= \begin{bmatrix}B_{xx}&B_{xy}&B_{xz}\\ B_{yx}&B_{yy}&B_{yz}\\ B_{zx}&B_{zy}&B_{zz}\\ \end{bmatrix}  \tag{3}\]  
where \(\otimes\) is the dyadic product. Since the magnetic field represents a gradient of potential, where the tensor elements correspond to second-order derivatives of the scalar potential (\(\varphi\)). As a result, the tensor components exhibit symmetry. Therefore:  
\[B_{xy}=B_{yx},\ B_{yz}=B_{zy},\ B_{xz}=B_{zx} \tag{4}\]  
According to [PERSON]'s equation:  
\[\
abla^{2}\varphi=0 \tag{5}\]  
\[\
abla\times\text{B}=0 \tag{6}\]  
From this it can be seen that:  
\[B_{xx}+B_{yy}+B_{zz}=0 \tag{7}\]  
Based on previous equations we have:  
\[B= \begin{bmatrix}B_{xx}&B_{xy}&B_{xz}\\ B_{yx}&B_{yy}&B_{yz}\\ B_{zx}&B_{zy}&B_{zz}\\ \end{bmatrix} = \begin{bmatrix}B_{xx}&B_{xy}&B_{xz}\\ B_{xy}&B_{yy}&B_{yz}\\ B_{xz}&B_{yz}&-B_{xx}-B_{yy}\\ \end{bmatrix}  \tag{8}\]  
This means that there exist only five distinct and unconnected tensor components with magnetic and gravity data.