## 2 Theory
### An Accelerated 3D Fast Inversion Algorithm for Gravity Data  
The efficiency of a computer is related to the memory occupied by data. Under the condition of achieving the same calculation results, finding a way to make the data occupy less memory is the key for improving the calculation efficiency. For the traditional conjugate gradient algorithm of gravity data inversion, it can be observed that three large matrices of size \(N\times N\), \(Q\), \(W_{m}\) and \(W_{m}{}^{-1}\) are involved in the inversion iteration process. Their existence consumes a considerable amount of computer memory. It is precisely due to their frequent involvement in the iterative calculation process that the algorithm's operating efficiency is very low. It also results in considerable memory usage. To address the issues present in the existing algorithm, we propose three improvements from the standpoint of reducing matrix dimension and optimizing the calculation flow of the algorithm. (a) the large matrix \(Q\) involved in the traditional algorithm appears to simplify the calculation process by calculating and storing \(S^{T}S\) in advance, but it actually increases the burden on the computer, and this approach is unnecessary. In fact, \(Q\) is the coefficient matrix of \(m_{w}\) in Equation (16). Although it has mathematical significance, in computer operation, we only need to expand Equation (16) directly and replace the key item \(S_{w}^{T}S_{w}m_{w}\) in the calculation order. In other words, we can change the order of calculation by using the associative law and transform it to \(S_{w}^{T}(S_{w}m_{w})\), thus successfully avoiding the generation and participation of the large matrix in the computer calculation. Therefore, in the process of algorithm improvement, we no longer store \(Q\) in advance for step (4) of the traditional algorithm, but instead only redistribute the storage of \(q\). And \(q\) is defined as other items excluding \(S_{w}^{T}(S_{w}m_{w})\) in the expansion of Equation (16), namely, \(q\) is redefined as:  
\[q_{k}=S_{w}^{T}d_{w}-\alpha_{k}W_{m}^{-2}m_{wk} \tag{20}\]  
In this way, the calculation expression involving the negative gradient in step (5) and (8) is modified as follows:  
\[r_{k}=q_{k}-S_{w}^{T}(S_{w}m_{w0}) \tag{21}\]  
Essentially, the change made to the denominator of the search step length in step (10) is simply a rearrangement of the calculation order of parameters, resulting in the final improvement shown as follows:  
\[t_{k}=\frac{r_{k}^{T}r_{k}}{{(S_{w}p_{k})}^{T}(S_{w}p_{k})+\alpha_{k}p_{k}^{T} p_{k}W_{m}^{-2}} \tag{22}\]  
For the above improvements, although the formal expression becomes complicated, the actual computer operation process avoids \(N\times N\) oversized array, thus improving the computation efficiency. (b) We consider the improvement in compression for the large matrix \(W_{m}\). In fact, for the matrices \(W_{m}\) and \({W_{m}}^{-1}\), even though they are large matrices of type \(N\times N\), \(W_{m}\) is essentially a diagonal square matrix with the useful information being distributed along the diagonal, and the values in other positions are 0. In other words, the valuable information in \(W_{m}\) is \(\frac{1}{N}\) of its total matrix size. As a result, when \(W_{m}\) is stored as a matrix in a computer, it consumes a significant amount of memory space, even though the crucial information only takes up a fraction of the storage space, this leads to an inefficient utilization of memory. In this study, we suggest expressing the original large matrix \(W_{m}\) in the form of vector using linear representation:  
\[{W_{m}}^{N\times 1}=diag\Big{(}S^{T}S\Big{)}^{\frac{1}{2}} \tag{23}\]  
The vector representation still retains all of the useful information from the original matrix and requires only \(\frac{1}{N}\) of the storage space.