An Application of Quantum Annealing Computing to Seismic Inversion

Quantum computing, along with quantum metrology and quantum communication, are disruptive technologies that promise, in the near future, to impact different sectors of academic research and industry. Among the computational challenges with great interest in science and industry are the inversion problems. These kinds of numerical procedures can be described as the process of determining the cause of an event from measurements of its effects. In this paper, we apply a recursive quantum algorithm to a D-Wave quantum annealer to solve a small scale seismic inversions problem. We compare the obtained results from the quantum computer to those derived from a classical algorithm. The accuracy achieved by the quantum computer is at least as good as that of the classical computer.


I. INTRODUCTION
Seismic geophysics relies heavily on subsurface modeling based on the numerical analysis of data collected in the field. The computational processing of a large amount of data generated in a typical seismic experiment can take an equally large amount of time before a consistent subsurface model is produced. Electromagnetic reservoir data, like CSEM (Controlled Source Electromagnetic), petrophysical techniques, such as electrical resistivity and magnetic resonance on multi-wells, and engineering optimization problems like reservoir flux simulators, well field design and oil production maximization also need a strong computational apparatus for analysis.
On the other hand, in the past decade, there has been much progress in the development of quantum computers: machines exploiting the laws of quantum mechanics to solve hard computational problems faster than conventional computers. A concrete example of such progress is the so-called quantum supremacy, that has been recently demonstrated using specific purpose quantum computers [1][2][3]. The Geoscience field and related industries, such as the hydrocarbon industry, are strong candidates to benefit from those advances brought by quantum computing.
Currently, different quantum technologies and computational models are being advanced. Giant companies like IBM, Google, and Intel are developing quantum computers based on superconducting technologies [4]. Other companies are also putting considerable effort into building a fully functional quantum computer based on Josephson junctions, such as the North American Rigetti, whereas, * Electronic address: amsouza@cbpf.br the also American IonQ and the Austrian AQT are working on computers based on trapped ions [5]. The Canadian company D-Wave, leader in the computational model known as quantum annealing [6], is already trading quantum machines, and the also Canadian Xanadu is providing cloud access to their photonic quantum computer [7,8]. Recent reviews comparing superconducting and trappedion technologies and different cloud-based platforms can be found in references [9] and [10], respectively.
In the field of Geoscience, recent works have used quantum annealers to hydrology inversion problems [11,12]. In those works, it was shown that, although the size of the problem that can be solved on a third-generation D-Wave quantum annealer is considered small for modern computers, they are larger than the problems solved with similar methodology with Intel's third and fourth generation chips. It is also important to mention that optimization techniques are widely used in seismic inversions, but usually classical algorithms get stuck in local minima. Previous works [13][14][15] have indicated that quantum annealing can be advantageous to solve seismic problems. However, the potential applications of quantum computing in Geoscience has so far been largely unexploited in the specialized literature.
In this work, we present a formulation of a seismic problem as a binary optimization, and one small scale subsurface seismic problem is solved using the D-Wave quantum annealer available in the Amazon Braket service. We have evaluated the performance of the quantum computer comparing the results obtained to those derived from a classical computer. Our analysis was focused on the accuracy. It was found that the accuracy achieved by the quantum computer is at least as good as that of the classical computer for the problem we have studied.
This paper is organized as follows. In Sec. II we introduce the basic idea of quantum annealing. In Sections III and IV, we present the formulation of a seismic inversion as a binary optimization problem and the methods used, respectively. In Sec V, the results obtained in the D-Wave quantum annealer are shown. In the last section, we draw the conclusions.

II. QUANTUM ANNEALING
In the literature, there are many different quantum computational models developed. Currently, three main models of quantum computing are being considered: the logic gate model, or circuit model, boson sampling and the adiabatic model. The gate model is an universal quantum computation model that is performed programming a step-by-step instruction build from basic building blocks, known as quantum gates, similar to the classical circuit model [16]. This model is exploited by companies such as IBM, Intel, Rigetti, IonQ, AQT, and Google. Boson sampling computers consists in sampling from the output distribution of bosons in a linear interferometer [8,17]. There is strong evidence that such an experiment is hard to be simulated in classical computers, but it is efficiently solved by special purpose photonic chips. The adiabatic computation model [18,19] is a model in which the computational problem is mapped into a Hamiltonian, in such a way that the solution of the computational problem is encoded in the ground state of the quantum system represented by the Hamiltonian H f inal . The computation is performed starting from the ground state of a known Hamiltonian H initial . The Hamiltonian is slowly modified towards to the target Hamiltonian H f inal . During the process, the total Hamiltonian of the system is given by where p ∈ [0, 1]. According to the adiabatic theorem, if the evolution is performed adiabatically, the quantum state of the system remains in the instantaneous ground state throughout the entire process. The adiabatic model is equivalent to the gate model [20], i.e., any problem that can be computed in the gate model will also be computable in the adiabatic model. This statement is valid for certain types of k−local Hamiltonians [20]. For example, considering a system of n qubits, we can perform universal adiabatic computation by choosing [21] where σ k i , with k = x, y, z, is one of the Pauli matrices of the i th qubit, δ i and H i are local transverse and longitudinal fields, respectively, and J i,j and K i,j are coupling constants.
The adiabatic model can be viewed as a special case of the quantum annealing computing. In quantum annealers, the Hamiltonian change is not adiabatic. Therefore, quantum annealing is a heuristic type of computation. The D-Wave computer is a quantum annealer that uses Ising chains The quantum annealing performed with Ising chains is unlikely to implement universal quantum computation [22]. Therefore, D-Wave annealers are more restrictive than the universal adiabatic model. Quantum annealing with Ising chains can be applied to a class of computational problems known as NP-hard problems [23]. It is believed that quantum annealing will be able to find better approximate solutions or find such approximate solutions faster then classical computers [22]. Here, it is also important to mention that the advantage of quantum annealers over classical methods is still under debate [24][25][26]. Recent works have proposed that, in some cases, quantum annealing is advantageous over classical computing [27][28][29][30], on the other hand, no advantage was reported in references [24,31]. The origin of the possible speedup is also under debate. Quantum tunneling is often claimed to be the key mechanism underlying possible speedups of quantum annealing. However, recent work has found numerical evidence that quantum tunneling processes can be efficiently simulated by Monte Carlo methods [32] . There is also evidence to suggest that it is unlikely to achieve exponential speedups over classical computing solely by the use of quantum tunneling [33]. The role of the temperature in the performance of quantum annealing has been also studied in [34].
To solve a problem in the D-Wave quantum annealer [6], it is necessary first to express the problem to be solved as an Ising problem or as a quadratic unconstrained binary optimization (QUBO), which is equivalent to Ising but defined on the binary values 0 and 1, whereas the Ising problem is defined on the binary values ±1/2. The QUBO problem can be written as the minimization of the quadratic function where q ∈ {0, 1} n , Q is a n × n upper (lower) triangular matrix and the vector q T = (q 1 , q 2 , · · · , q n ) contains n binary variables. QUBO problems are commonly used in machine learning and many important computational problems can be translated to a QUBO formulation as well [35]. Examples of problems that have been addressed with a D-Wave quantum annealer are: the classification of human cancer types [36], traffic optimization [37], transcription factor DNA binding [29], metamaterial designing [38] and Higgs boson data analysis [39].
Recently, there has been a growing interest in quantum algorithms for systems of linear equations, Ax = b, where A is a n×n matrix and b is a unit vector. Such algorithms may find applications in different research areas, including Geoscience. In the quantum gate model, the quantum version of such problem is called Quantum Linear Systems Problem (QLSP) [40,41], and it is defined as the problem of preparing the state In 2008, Harrow, Hassidim, and Lloyd (HHL) proposed a quantum algorithm for the QLSP problem [42]. Given some assumptions [43], the run time of HHL is O(k 2 s 2 log(n)/ ) where k is the condition number of the matrix A, defined as the absolute value of the ratio between the largest and smallest eigenvalues of A, s is the sparsity of A, defined as the number of nonzero entries per row, and is the desired precision.
After the initial HHL proposal, several improvements were achieved: the condition number dependence was reduced from k 2 to k log 3 (k) [44], the error dependency was reduced from 1/ to a polynomial function in log(1/ ) [45], and a sparsity-independent runtime scaling was achieved in [46]. The QLSP problem can also be solved using iterative quantum solvers in runtime O(k 2 log(k)/log(1/ )) [47] and with runtimes O(k log(k)/ ) and O(k 2 log(k)/ ) using the evolution randomization method, a simple variant of adiabatic quantum computing where the parameter p in (1) varies discretely, rather than continuously [48]. The best general-purpose classical conjugate gradient algorithm to solve Ax = b has the runtime O(nks log(1/ )). Here, we must emphasize a fundamental difference between classical and quantum algorithms. While the conjugate gradient returns the solution vector x, quantum algorithms return a quantum state, equation (6), that approximately contains all the components x i of the solution vector x. It is possible to obtain any specific entry x i by measuring the output state (6), but in general, it will require repeating the algorithm many times, which would kill the exponential speedup. Still, quantum algorithms can be used as subroutines in different applications [40,43].
In quantum annealers, the problems of solving a system of linear equations and a system of polynomial equations were previously studied in [49][50][51] and [52], respectively. Unlike the previously mentioned quantum algorithms, quantum annealing solves Ax = b completely, i.e., it returns the vector x. To compare the performances of a quantum annealer and a classical computer, we must take into account the cost to prepare the problem, i.e., the procedure to map Ax = b into a QUBO or Ising problem, the cost to perform the annealing, and also the cost to post-process the results. The performance of quantum annealers to solve linear systems was studied in detail in reference [50]. It was shown that quantum annealers might be competitive if there exists a post-processing method that is polynomial in the size of the Matrix A with a degree less then 3.

III. SEISMIC INVERSION WRITTEN AS A QUBO PROBLEM
We considered the propagation of sound waves in a multi-layered medium, as shown in Figure 1. Multiple sources produce sound waves that can be reflected in the interface of each layer. Assuming that the wave propagation can be modeled as narrow beams or rays, the sound trace originated in the i th source reaches the i th detector after the time interval where d ij and v j are the distance traveled by the sound waves and the sound speed in the j th layer, respectively. If we consider the thickness of each layer as h j and the distance between two consecutive sources (detectors) as ∆ i , we can write d ij = h j / cos θ j where θ j = arctan(∆ j /h j ). The layered model described above is commonly used in seismic explorations, either offshore or onshore [53]. In seismic experiments the goal is to determine the velocities {v j } from the time intervals {t i }, by solving the system where t T = (t 1 , t 2 , · · · , t m ), is the slowness vector, M is a m × m lower triangular matrix with nonzero elements given by M .,j = 2h j / cos θ j , and m is the number of layers.
In order to use a quantum annealer to solve the above seismic problem it is necessary to translate the problem into a QUBO formulation. To proceed, first, we rewrite the system (8) as a minimization problem with the objective function where s ∈ R m . Next we write the slowness vector as s = s 0 + L(x − I), where L defines the bounding limits of s, 0 ≤ x i < 2 ∀ x i , I T = (1, 1, · · · ) and the vector s 0 is an initial guess for s. The objective function f (s) is rewritten as where x ∈ R m and b = (t + LMI − Ms 0 )/L. The matrix M and the vector b are parameters of the objective function while the vector x must be converted into a binary format. Here we discretized each x i variable with the R-bit approximation To formulate our QUBO problem, we construct a new binary vector q and a new real matrix A in order to form the binary system of equations Aq = b. It is straightforward to reformulate this system as a binary optimization problem [49][50][51], whose solution vector, q * , is given by = arg min q∈{0,1} R×m where and C = m k=1 b 2 k is an additive constant that does not change the ground state.
The precision of the solution depends on how many binary digits are used to represent the real variables of the problem, a solution with good precision would consume a large number of qubits of the quantum hardware. Here we have used a recursive approach similar to what was used in [49] to improve the precision of floating-point division. Our recursive approach is described in the algorithm (1), using such an approach we could improve the solution of a system of linear equations with 46 real variables, using just a few qubits to represent each variable. Next, we will show in our example that using R = 3, in equation (11), and carrying 20 iterations is sufficient to reach a good solution.

IV. METHODS
We have performed the quantum computation with the D-Wave computer provided by the Amazon Braket service. Currently, there are two versions of quantum annealer available in Amazon Braket. The first is the Dwave 2000Q version, this computer contains 2041 working qubits. The connections among the qubits are represented by a graph called Chimera [54]. In this topology, each qubit is coupled to no more than 6 other qubits. We can call Chimera as a graph of degree 6. The second version is the D-Wave Advantage system, it is a more advanced computer with 5436 working qubits disposed in a Pegasus graph with degree 15 [55]. A QUBO problem can also is represented by a graph, where each vertex of the graph corresponds to a binary variable q i . When the QUBO problem is represented by a graph with degree greater then 6, for Chimera, or 15, for Pegasus, it is necessary to embed the QUBO graph onto the chip topology. The present seismic problem, for example, is represented by a full graph, where each vertex is connected to all other vertices. In this work, the embeddings were obtained using a heuristic algorithm [56] provided by D-Wave.
Errors during the computation are important issues to be considered. In quantum annealing, the computational problem is encoded into the ground state of the Ising Hamiltonian (4), the gap between the ground state and the excited states is a key property of the system. If the gap is too small, thermal excitations and non-adiabatic transitions can induce transitions, as a consequence, the computer will output an excited state, which can be viewed as a computational error [57]. In addition, the wrong implementation of the Hamiltonian (4) may result in the wrong ground state [57]. We have noticed that the ground state was achieved with high probability. Therefore, unwanted transitions due to thermal fluctuations or non-adiabatic evolution do not represent an important issue in our case. The annealing time used was 20 µs, the minimal and default value of the D-Wave machine. To post-process the output we use default D-Wave' routines.
In our implementation, analog errors are the most important, i.e., inaccurate implementations of the parameters H i and J i,j described in the equation (4). To reduce the impact of analog errors, we have used 10 spin-reversal transforms, also known as gauge transformations [58,59]. This type of transformation is based on the fact that the structure of the Ising problem is not affected when the following transformations are applied: . The original and transformed problems have identical energies. However, the sample statistics are affected by the spin-reversal transform because the quantum hardware is a physical object subject to errors.

V. RESULTS
We have applied the above formulation to solve a small scale underwater seismic inversion problem. Artificial data were generated by simulating sound traces in ocean. We have used the sound speed profile of the Philippine Sea, available to public [60], as shown in Figure 2. From the simulation, we obtained the travel times between the sources and detectors. The seismic inversion model was constructed using 46 layers while the real variables were digitalized with R = 3 bits. This model yields 138 binary variables, for the present type of problem, it is the maximum number of variables that we can embed in the working graph of the D-Wave Advantage system available in Amazon.
To perform the seismic inversion we have considered that all layers in the model match the position where the sound wave is reflected, as shown in Figure 2. The solution is presented in Figure 3, as can be seen, good results are obtained with 20 iteractions. We have also performed the inversion with a classical computer running the forward substitution algorithm to invert the lower triangular matrix in equation (8). When classical and quantum inversions are compared, we found that the relative error between them was ≈ 10 −4 , as shown in figure 3. This result shows that the quantum computer using the recursive approach to solve a system of linear equations has enough control to find solutions with good precision.
The results could also be compared to the benchmark provided by the condition number of the numerical problem at hand. When performing a numerical inversion procedure on the lower triangular matrix M to recover the solution s in Equation (8), a straightforward estimation of the lower bound of the relative error s in s arising from the relative error t in the righthand side vector t due to the numerical conditioning of M is given by [61] where κ ∞ is the condition number given by Therefore, the condition number relates the error associated with t, s , and the error of the solution s, s . In this particular application of seismic inversion, where distances are generally in the scale of 10 3 m, it is reasonable to assume that the figures are accurate up to the order of ≈ 10m, with the next order of magnitude (1m) giving the scale of the error t . Given that the error t can be estimated as ≈ 10 −3 and the condition number is κ ∞ ≈ 1, then we can estimate s ≈ 10 −3 from (16 ). This shows that the error of the quantum approach comes from the inversion problem by itself and is of the same order as the classical approach.

VI. CONCLUSIONS
Quantum computing represents a fundamentally different paradigm, an entirely different way to perform calculations. The Geoscience field and related industries are strong candidates to benefit from it. However, the performance of Geoscience inversion problems on current available quantum computers has so far been largely unexploited.
In this paper, we have solved a seismic inversions in a D-Wave quantum annealer. The seismic problem was written as a system of linear equations and then translated into a QUBO formulation. The results presented here indicate that the current available quantum annealers can solve a seismic inversion at a relatively small size with nearly the same accuracy as a classical computer. The proof-ofprinciple computations performed here show some promise for the use of quantum annealing in Geosciences.
The practical use of quantum annealing in Geosciences will require the ability to solve large problems. To address this issue, decomposer tools have been proposed to divide a large problem into small subproblems which can be solved individually by the quantum hardware [62][63][64]. Using such approach, it is possible to solve a large-sized problem using just a limited number of available qubits. Another interesting approach is the reverse annealing. Within this method, one starts from known local solutions which can be obtained in a classical computer. The annealing is performed backward from the known classical state to a state of quantum superposition, then proceeding forward it is possible to reach a new classical state that is a better solution than the initial one. Recently, it has been shown that it is possible to refine local solutions with recursive applications of reverse annealing [65][66][67][68]. We believe that the development of hybrid quantum-classical methods, such as mentioned above, will be essential to solve complex seismic problems on quantum annealers in the near future.
Finally, we should mention that the problem solved here is well-conditioned, however, often Geoscience problems are ill-conditioned. An interesting question is whether quantum computers can solve ill-conditioned problems efficiently. In reference [69], it was theoretically proposed that preconditioning methods can expand the number of linear systems problems that can achieve exponential speedup over classical computers. In future works, we plan to study the performance of the quantum annealers to solve ill-conditioned problems. Another attractive prospect for future work is the implementation of Geoscience problems in gate model computers, based either on superconducting or trapped ions technologies.

Conflict of Interest Statement
The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Author Contributions
A. M. Souza ran the quantum computer, analyzed the results, co-wrote, and reviewed the manuscript. E. O. Martins initiated the study, co-wrote, and reviewed the manuscript. N. Sá, I. Roditi , R. Sarthour and I. S. Oliveira co-wrote and reviewed the manuscript.

Figure captions
Algorithm 1 Function to solve the system of equations Ms = t. The vector s 0 is the initial guess for s, is the tolerance, N max is the maximum number of iterations, and L defines the interval where we expect to find the solutions (see text). for c ← 1 to Nmax do 4: b ← (t + LMI − Ms0)/L

5:
Construct the vetor q and the Matrix A