Next Article in Journal
Correcting Coherent Errors by Random Operation on Actual Quantum Hardware
Next Article in Special Issue
Quantum Machine Learning for Distributed Quantum Protocols with Local Operations and Noisy Classical Communications
Previous Article in Journal
Quick Estimate of Information Decomposition for Text Style Transfer
Previous Article in Special Issue
Quantum Control by Few-Cycles Pulses: The Two-Level Problem
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Toward Prediction of Financial Crashes with a D-Wave Quantum Annealer

1
International Center of Quantum Artificial Intelligence for Science and Technology (QuArtist) and Department of Physics, Shanghai University, Shanghai 200444, China
2
Department of Physical Chemistry, University of the Basque Country UPV/EHU, Apartado 644, 48080 Bilbao, Spain
3
ProQuam Co., Ltd., Shanghai 200444, China
4
Quantum Mads, Uribitarte Kalea 6, 48001 Bilbao, Spain
5
EHU Quantum Center, University of the Basque Country UPV/EHU, Apartado 644, 48080 Bilbao, Spain
6
Departamento de Física Atómica, Molecular y Nuclear, Universidad de Sevilla, 41080 Sevilla, Spain
7
Instituto Carlos I de Física Teórica y Computacional, 18071 Granada, Spain
8
IDAL, Electronic Engineering Department, University of Valencia, Avgda. Universitat s/n, 46100 Burjassot, Spain
9
ValgrAI: Valencian Graduated School and Research Network of Artificial Intelligence, Camí de Vera, s/n, Edificio 3Q, 46022 Valencia, Spain
10
Multiverse Computing, Pio Baroja 37, 20008 San Sebastián, Spain
11
Donostia International Physics Center, Paseo Manuel de Lardizabal 4, 20018 San Sebastián, Spain
12
IKERBASQUE, Basque Foundation for Science, Plaza Euskadi 5, 48009 Bilbao, Spain
13
Kipu Quantum, Greifswalderstrasse 226, 10405 Berlin, Germany
14
Basque Center for Applied Mathematics (BCAM), Alameda de Mazarredo 14, 48009 Bilbao, Spain
*
Author to whom correspondence should be addressed.
Entropy 2023, 25(2), 323; https://doi.org/10.3390/e25020323
Submission received: 12 January 2023 / Revised: 3 February 2023 / Accepted: 5 February 2023 / Published: 10 February 2023
(This article belongs to the Special Issue Quantum Control and Quantum Computing)

Abstract

:
The prediction of financial crashes in a complex financial network is known to be an NP-hard problem, which means that no known algorithm can efficiently find optimal solutions. We experimentally explore a novel approach to this problem by using a D-Wave quantum annealer, benchmarking its performance for attaining a financial equilibrium. To be specific, the equilibrium condition of a nonlinear financial model is embedded into a higher-order unconstrained binary optimization (HUBO) problem, which is then transformed into a spin- 1 / 2 Hamiltonian with at most, two-qubit interactions. The problem is thus equivalent to finding the ground state of an interacting spin Hamiltonian, which can be approximated with a quantum annealer. The size of the simulation is mainly constrained by the necessity of a large number of physical qubits representing a logical qubit with the correct connectivity. Our experiment paves the way for the codification of this quantitative macroeconomics problem in quantum annealers.

1. Introduction

Economics is a complex science in which the agents’ psychology plays an essential role that is often hardly grasped by mathematical models. However, economists persist in trying to predict market behavior employing sophisticated models, which has resulted in the field of quantitative finance. Following this idea, quantitative finance and economics emerged, which were applied to understand the evolution of financial markets and economies, as well as provide forecasts. A realistic question in risk management is whether there would be a drastic drop in market values if the prices of assets suffered some small perturbations. The cross-holdings and nonlinear nature of financial network dynamics can cause chain reactions, implying that sudden drops in market value might affect other nodes in the network resulting in a financial crisis. Presently, the prediction of crashes is mainly performed by studying previous cases in history and comparing these with the current configuration [1,2,3,4,5,6]. Although this empirical approach has been successful [7], the economic environment is constantly evolving. Hence, we cannot limit ourselves to predicting economic disasters that are qualitatively similar to past events. Therefore, ab initio simulations of financial networks will become essential for avoiding financial crises. This problem was recently shown to be NP-hard [8]. Therefore, given the current standpoint on complexity theory, this problem is not expected to be efficiently solvable by a classical computer. Indeed, given the global knowledge of a financial network, the time to compute the consequences of a perturbation would far exceed the age of the universe.
An alternative approach to this problem was presented in Refs. [9,10], where ways to tackle this type of problem using quantum annealers were presented. In particular, a mathematically identical problem was simulated, and the corresponding results measured [11,12,13,14]. Specifically, it was shown that obtaining the equilibrium configuration of a financial network is equivalent to solving a higher-order unconstrained binary optimization (HUBO) problem, which should be feasible for a quantum annealer that allows for multi-qubit interactions. Unfortunately, this hardware has not been realized yet, as state-of-the-art quantum annealers are restricted to two-qubit interactions [15]. A possible workaround, which comes at the cost of introducing ancillary qubits, is to find an effective Hamiltonian with the same low-energy subspace and two-qubit interactions at most. This leaves us with the problem of solving a quadratic unconstrained binary optimization (QUBO) problem, whose optimum encodes the equilibrium configuration of a financial network. This problem can be addressed by employing a quantum annealer. The D-Wave 2000Q quantum annealer equipped with a Chimera architecture requires a large number of physical qubits to obtain the desired connectivity and limits the number of institutions and assets considered. An analysis of the changes experienced by the financial network to reach its equilibrium configuration will determine whether a crash has occurred.
In this paper, we experimentally implement the study presented in Refs. [9,10]. Specifically, we compute the equilibrium configuration of a financial network before and after a perturbation with a D-Wave 2000Q quantum annealer and compare the results to alternative methods. Although the D-Wave machine has been successfully used to solve problems in engineering [16], cryptography [17], biology [18], and quantitative finance [19,20], among others, it is the first time that quantum annealing is applied to solve a macroeconomic problem. This should attract more attention from the finance and economic disciplines towards the potential of quantum computing [21,22,23,24,25,26,27].
The contents are organized as follows. In Section 2, we introduce the model of the financial network that will be considered. Section 3 reviews the quantum annealing algorithm to find financial equilibrium. Section 4 experimentally proves the validity of the scheme by finding the financial equilibrium of a random network of the largest implementable size using a D-Wave 2000Q quantum annealer; for this network, we also experimentally show how the scheme allows for the computation of the financial equilibrium. Section 5 analyzes the achieved results and discusses possible further improvements. The conclusions drawn from the work are presented in Section 6.

2. Formulation of the Model

A nonlinear network model for financial markets is proposed in Ref. [9]. It is made up of n institutions and m assets and aims to represent the market values of institutions by mapping them onto a graph, as shown in Figure 1. We codify the prices of the m assets by an m dimensional vector p R m , where the element p k represents the price of asset k. Moreover, an n × m ownership matrix D can be defined such that the element D i k 0 corresponds to the percentage of asset k owned by institution i. There is also an n × n ownership matrix C that describes the cross-holdings and self-ownerships among institutions. The coefficients C i j denote the percentage of institution j owned by institution i. By considering all self-ownerships (i.e., the diagonal elements) from C , one forms a new diagonal matrix C ˜ , which represents the self-ownership only such that the matrix C = C C ˜ codifies all cross-holdings. The equity value V i of institution i is defined by summing its ownership of all assets and cross-holdings, V i = Σ k D i k p k + Σ j C i j V j . One thus obtains a matrix equation V = D p + C V , where the equity value vector V R n is an n dimensional vector. Accordingly, the market value is the equity value rescaled with its self-ownership, resulting in the n dimensional market value vector v = C ˜ V . The solution to the linear matrix equation thus reads
v = C ˜ ( I C ) 1 D p .
We introduce the nonlinear effect of panic in the model via a Heaviside-theta function Θ ; if the market value v i drops below the critical value v c i , failure of institution i occurs and its equity value drops by β i ( p ) , which is governed by the price vector of assets. Once we define the failure vector b ( v , p ) = β ( p ) ( 1 Θ ( v v c ) ) , where ∘ denotes the Hadamard product, the market value vector with nonlinearity can be written as
v = C ˜ ( I C ) 1 ( D p b ( v , p ) ) .
Mathematically, it is the nonlinearity of b ( v , p ) that makes financial networks so hard to predict. This drop may cause an institution’s value to crash, a behavior that can infect other nodes in the network. Under our definition, a financial crash happens when the market value of an institution, considering the nonlinear term, is lower than the pre-perturbation prices calculated using the linear model as a result of a perturbation in the asset prices.

3. Quantum Annealing Algorithm

As proposed in Ref. [9], finding financial equilibrium can be presented as the minimization of an objective function, which is equivalent to finding the ground state of a classical spin Hamiltonian.
By squaring Equation (2), we obtain an objective function that meets its minimum value when the market value state is set to be the equilibrium state
Obj ( v ) = ( v C ˜ ( I C ) 1 ( D p b ( v , p ) ) ) 2 .
Thus, our task is now to find the v that minimizes Obj ( v ) for a given financial network, which is an NP-hard problem [28].
Next, we need to deal with the nonlinear terms (modeling failure) of the objective function so that once the objective function is transformed to a spin- 1 / 2 Hamiltonian, it should ideally be made of polynomial terms only due to the limitations of quantum annealers. Thus, one expands the failure terms with Heaviside-theta functions in terms of polynomials. This expansion is not unique and here, we choose the Legendre expansion [9],
Θ ( x ) = 1 2 + l = 1 ( P l 1 ( 0 ) + P l + 1 ( 0 ) ) P l ( x ) ,
in the domain [ 1 , 1 ] , where P l ( x ) is the l-th Legendre polynomial. By setting x = ( v i v i c ) / v m a x i , Equation (4) enables us to expand Θ ( v i v i c ) in the range of v i [ 0 , v m a x i ] . Using this expansion as an example, we take the approximation
b i ( v i , p ) β i ( p ) 1 2 l = 0 r Γ l 2 l k = 0 l l k l + k 1 2 l v ¯ i k
where Γ l = π 2 Γ 2 l 2 Γ 3 + l 2 and v ¯ i = v i v i c v max i . The polynomial expansion removes the discontinuity while maintaining the strong nonlinearity of the network.
We now encode the continuous variables v i with classical bits. This will allow us to rewrite the resulting objective function in digital form. The expansion is straightforward and reads v i = α = x i , α 2 α . However, due to the limited resources in real-world devices, one must truncate this expansion, i.e., v i α = q q x i , α 2 α , where x i , α are classical bits with binary values of 0 or 1. In this way, the market value of institution i is encoded with 2 q + 1 classical bits. The maximal market value v i m a x is given by α = q q 2 α .
Considering ( v i v i c ) k = h = 0 k ( 1 ) h k h v i k h ( v i c ) h and v i n = m 0 + . . . + m p = n n m 0 , . . . , m p 0 α p m α 0 2 α m α x i , α , the resulting objective function is a polynomial of the binary variables x i , α of degree 2 r .
H ^ = i α = q q x i , α 2 α γ i + j C ¯ i j b j ( x j , α , p ) 2
with γ i = j C ¯ i j k D j k p k and C ¯ i j = C i i ˜ ( I C ) i j 1 . To express this as a spin-1/2 Hamiltonian, we replace the binary variables x i , α with qubit operators x ^ i , α with eigenvalues of 0 and 1, i.e., x ^ i , α | 0 = 0 , x ^ i , α | 1 = | 1 . The Pauli-z operator satisfies x ^ i , α = ( 1 + σ ^ i , α z ) / 2 and, therefore, the Hamiltonian encodes the objective function but is written with Pauli matrices, including all types of multi-spin interactions up to 2 r -body terms.
The Hamiltonian obtained is appropriate for a quantum annealer that allows many-qubit interactions. However, state-of-the-art quantum annealers only accept inputs with, at most, two-qubit interactions. Finding the ground state of a spin-1/2 Hamiltonian is equivalent to solving a quadratic unconstrained binary optimization (QUBO) problem, which is the input of the quantum annealer. Thus, we should recast our quantum Hamiltonian into a modified, effective Hamiltonian with, at most, two-qubit interactions. Some protocols achieving exactly this are proposed in Refs. [29,30,31,32,33,34,35]. In particular, we base our protocol on Ref. [35], where k ancilla qubits are introduced to implement an effective k-qubit interaction. Suppose that there is a k-qubit interaction term H ^ k = J k Π i = 1 k σ i z with the same low-energy spectrum of another Hamiltonian term H ˜ k with, at most, two-qubit interactions. We can express H ˜ k with k logical qubits and k extra ancilla qubits as
H ˜ k = J i = 2 k j = 1 i 1 σ ^ i z σ ^ j z + h i = 1 k σ ^ i z + J a i = 1 k j = 1 k σ ^ i z σ ^ j , a z + i = 1 k h i a σ ^ i , a z ,
as represented in Figure 2. This two-qubit Hamiltonian has the same low-energy spectrum as H ^ k when J, J a , h, and h i a are set to appropriate values. As Ref. [35] suggested, this can be achieved once q i = ( 1 ) k i + 1 J k + q 0 , h = J a + q 0 , h i a = J a ( 2 i k ) + q i and J = J a , with any q 0 that satisfies | J k | q 0 < J a and | J k | J a q 0 < J a . These conditions can be relaxed to | J k | < q 0 < J a and | J k | < J a q 0 < J a if one aims to have only the same ground state rather than the whole low-energy sector. We depict the low-energy spectrum of this two-qubit Hamiltonian for k = 3 logical qubits in Table 1.

4. Implementation in a D-Wave 2000Q Quantum Annealer

Once shown that it is possible to recast the problem of finding financial equilibrium into a language amenable to QUBO solvers and, in particular, quantum annealers, this section deals with its implementation using a state-of-the-art quantum annealer, namely the D-Wave 2000Q. This quantum annealer consists of up to 2048 qubits connected according to the Chimera graph topology (see Figure 3). It is designed to solve embedded Ising problems or QUBO problems.
Two simulations were produced:
  • A financial network without a failure term, which is simple to solve on a classical computer in order to benchmark the performance of the quantum processor.
  • A financial network with an inherently nonlinear risk of failure. We perturb the asset price vector in this network to compute the new equilibrium configuration using the quantum annealing algorithm.
We initially generate a financial network with 10 institutions and 15 assets. To demonstrate the algorithm, we randomize the ownership matrix D with a Dirichlet distribution that satisfies i = 1 n D i j = 1 , where D i j are random variables. The cross-holding matrix C is generated in a similar way but with the constraint that all diagonal elements should be larger than 0.5 , ensuring that all institutions can make decisions according to their own wills. Thus, we randomize C ˜ i i between 0.5 and 1 and randomize i = 1 n C i j = 1 C ˜ j j with a rescaled Dirichlet distribution. The price vector p is also random, with p i [ 10 , 40 ] . The network configuration is shown in Figure 4a,b.
We can calculate the equilibrium state v q and the equity value vector V on a classical computer using
v q = C ˜ ( I C ) 1 D p ,
V = ( I C ) 1 D p .
which are linear equations that, in fact, can be implemented in a quantum annealer using only 2-local terms, as a result of squaring the expression in a similar way to Equation (3).
The objective function shown in Equation (3) was implemented, for benchmarking reasons, both in a quantum annealer and a classical simulator. The variables v i were encoded as v i = α = 0 6 2 α x i , α on seven qubits. As such, this constrains the v i to be integers smaller than 127. A quantum implementation of this algorithm does not require ancilla qubits, as there are no many-qubit interactions.
The QUBO for this linear problem is a 70 × 70 matrix, with 210 couplers, which cannot be solved directly due to the topology structure of the quantum annealer. D-Wave provides software named qbsolv, which allows its quantum annealer to be used with a classical computer by splitting the QUBO matrix into partition matrices that can be embedded in the quantum annealer. As a decomposing solver, it finds a minimum value of a large QUBO problem by splitting it into pieces and solving it either via a D-Wave system or a classical tabu solver (both approaches were considered here for comparison purposes). Since the D-Wave 2000Q processor is a quantum annealer, 20 results would be obtained from a qbsolv process with a default setting; these results should be handled by a correction process, e.g., majority voting, to help us identify the most plausible answer. The result of this QUBO problem is shown in Figure 5, where the exact solution of a linear matrix equation, qbsolv solution using a classical tabu solver and qbsolv solution with the D-Wave quantum annealer are compared. By comparing the individual equilibrium values, it can be observed that the quantum annealer provides a solution that presents more accurate individual values of the assets than the prediction using the classical solver.
Although the failure-free model only has linear and quadratic terms in v i , the nonlinear model has powers of v i up to order 2 r . For large r, this can be extremely resource-consuming in terms of ancillary qubits due to the requested connectivity. An estimation of the number of qubits can be made by counting the number of interaction terms. Our Hamiltonian H ^ can have up to α = 0 2 r n ( 2 q + 1 ) α terms, where n ( 2 q + 1 ) denotes the logical qubits that are required. In each term, 3-to- 2 r new ancilla qubits are needed depending on the number of logical qubits in this term. Therefore, the number of necessary qubits grows rapidly with the degree of the polynomial expansion r. Note that the aforementioned QUBO problem is NP-hard for any n 2 . In practice, this is an upper bound of the required resources, calculated assuming that H ^ has all possible terms up to order O ( 2 r ) .
Here, we implement an enhanced model with failure terms on the basis of the linear model previously simulated. We perturb the vector of asset prices, leaving the ownership matrix D and cross-holding matrix C invariant, and recompute the equilibrium state. Specifically, we set the price of some random assets to zero (to simulate, e.g., the assets’ destruction). In this study, we use an expansion of H ^ to third order, which still characterizes the phenomenon of a sudden drop near the critical value. Moreover, this approach provides strong nonlinearity while saving plenty of qubit resources. As a result, 70 logical qubits and 872,690 ancilla qubits are required, which leads to a QUBO matrix of 872,760 × 872,760 entries, although only a minority of them, 4,446,575 couplers, are non-zero. Storing this sparse matrix results in the requirement of about 6TB RAM since each element has an accuracy of double float in qbsolv. Due to the limitations of state-of-the-art techniques, the network is reduced to three institutions, and each market value v i is encoded by five qubits, bounding the maximum market value to be 31. A new 3 × 7 ownership matrix D and a 3 × 3 cross-holding matrix C are generated and the price vector p before perturbation is p = { 8.43 , 14.47 , 6.75 , 8.09 , 19.11 , 11.32 , 7.19 } T . The network configuration is shown in Figure 6a,b. The equilibrium state before perturbation without nonlinearity is given as v q = { 21.18 , 23.33 , 30.83 } T and the critical value vector is set at 80 % of the original equilibrium state, whereas the failure strength β is considered to be 30 % of the original equity value. The corresponding perturbed price vector is given as p = { 8.43 , 14.47 , 0 , 8.09 , 0 , 11.32 , 7.19 } T . Before calculating the new equilibrium state with the nonlinearity and perturbation, some parameters such as J a and q 0 must be set. The minor embedding of a submatrix in the D-Wave quantum annealer is performed by introducing a penalty function between qubits in the Chimera graph requiring J m J a , which means that the J a for mapping multi-qubit interactions to two-qubit interactions should be on the proper scale. Meanwhile, as we mentioned earlier, we need to sample out the thermal fluctuation by assuming that | H ^ k | is much smaller than J a or the protocol will break down because those ancilla qubits will no longer be in the corresponding ground state. Thus, in the implementation, we took J a = 20 J k and q 0 = 10 J k to ensure that either q 0 or J a q 0 was at least 10 times larger than J k .
For this problem, the QUBO matrix had a size of 8280 × 8280 , with 15 logical qubits, 8265 ancilla qubits, and 38,790 couplers. Note that the available quantum annealer structure is not optimized for this problem and the translation is not efficient because of the sparse connectivity of the quantum processor. Finally, we compare our results from the quantum annealer with the integer equilibrium solution calculated using the straightforward method by trying 32 3 times, as shown in Figure 7, which shows the good agreement and accuracy of the proposed method. Comparing the results after the perturbation with the pre-perturbation values, we can conclude that we have detected the financial crash.

5. Results and Discussion

D-Wave is a quantum annealer designed to deal with an Ising model and QUBO problems. However, the problem faced in this paper, namely financial crisis prediction with nonlinearity associated with panic, is not QUBO but rather HUBO, thus requiring multi-qubit interactions. In order to approximate this HUBO problem with two-qubit interactions, with the current state of hardware and software, we were limited to simulating a small financial network made up of three institutions and cross-holdings.
An effective two-qubit quantum Hamiltonian could still not be read directly by the D-Wave system, which requires a QUBO- or Ising-type input. Although this can be generated by some open-source software such as pyqubo, the input size must be very small in order to avoid a stack overflow associated with recursion errors. A possible solution is to produce a Mathematica script that reads each term and writes it as a string of coefficients and qubits in an input file for the D-Wave system. Once we generate the input for this problem, it is still too large to be embedded in the D-Wave 2000Q quantum annealer because of the graph structure. Thus, qbsolv is an inevitable option for us, which works by separating the large matrix into submatrices and solving them using a classical tabu solver or D-Wave solver. This kind of hybrid computation provides the possibility to solve the complicated problem but brings some new constraints, namely (i) Local hardware. Once the QUBO matrix is provided, qbsolv allocates dynamic memory before separating it into submatrices with elements of double-precision floats by requiring a size of 8 n × n bytes of memory. However, the bottleneck is not the memory size but the performance of the CPU since a large QUBO matrix will consume exhaustive CPU time if one needs high accuracy of the optimized results; (ii) Algorithm. Instead of a real quantum annealing process for the whole matrix, qbsolv provides a tabu algorithm or the D-Wave 2000Q quantum annealer for submatrices. The partition strategy for generating submatrices may get stuck in a local minimum instead of the global minimum that quantum annealing guarantees with high probability under ideal conditions, i.e., in the absence of decoherence and the adiabatic limit. Considering that the logical qubits only encode less than 1 % in the QUBO matrix, the risk of getting stuck is still high, even if we sample over the thermal distribution or give a huge repeat limitation in the main loop to improve its accuracy. We would have to customize a random seed for the separation and check the final results manually to see whether they are near the equilibrium. Another option is to send the QUBO matrix to the solver many times and average the results to obtain the best solution; and (iii) Quantum annealer. The submatrices will be sent to the D-Wave 2000Q quantum annealing device for optimization after they are generated by Glover’s algorithm [36]. In the quantum annealing process, magnetic fields are applied to the processors and the strength should be accurate because J k , J a in the QUBO matrix and J m for the embedding belong to different magnitudes. Any imprecision in the system preparation will cause significant deviations from the correct results.
In this implementation, the accuracy is not especially high since we are not optimizing the objective function rigorously because the market values are the integers v i [ 0 , v m a x ] , which are constrained for the qubits we take to encode them. The computation time is also long, considering that there is a straightforward but equivalent classical algorithm by testing the value of the objective function 32 3 times by brute force, corresponding to all possible combinations. Although mapping it to a QUBO problem and optimizing it with a general quantum annealer is not efficient enough for current technology, we believe it is a valuable example of how one can solve an NP-hard problem via quantum computation. With quantum annealers designed for solving HUBO problems that allow the implementation of multi-qubit interactions, we would avoid the overhead of resources and may obtain a speed-up factor in forecasting the behavior of complex financial networks over the use of general-purpose annealers. We expect this kind of quantum solver may be available in the near future. Meanwhile, D-Wave has recently announced its next generation of quantum annealers called the Advantage system [37], which consists of more than 5000 qubits connected with each other according to the Pegasus topology. In this manner, one could improve the number of qubits and the connectivity by a factor of 2.5 .
Considering that a specialized quantum annealer for HUBO problems will not be available to the public anytime soon, we now analyze the possible ways to enhance the performance of the D-Wave 2000Q quantum annealer on this problem. After compromising on the maximum two-qubit interactions in the hardware, the subsequent strategy will be to reduce the number of ancilla qubits. With fewer ancilla qubits, the size and accuracy of a solvable network can be improved. As proposed in Ref. [35], the multi-to-two mapping is a general method, but for three-to-two mapping, for example, a more efficient mapping can be constructed with only one ancilla qubit. Suppose there is a sub-Hamiltonian of three-qubit interactions
H ^ 3 = J 3 σ ^ 1 z σ ^ 2 z σ ^ 3 z .
A subgraph with full connectivity of three logical qubits and one ancilla qubit is shown in Figure 8, where the equivalent Hamiltonian is given as
H ˜ 3 = J i = 2 3 j = 1 i 1 σ ^ i z σ ^ j z + h i = 1 3 σ ^ i z + J a i = 1 3 σ ^ i z σ ^ a z + h a σ ^ a z .
In contrast to the previous protocol, J a = 2 J > h and h a = 2 h = 2 J 3 . In addition, for sampling out the thermal fluctuation, we take J a J 3 to prevent the protocol from failing for the same reason. The ancilla qubits can be reduced to about 7000 with this method. Meanwhile, the partition method in qbsolv may cause the system to get stuck in local minima that require a better algorithm in the main loop.

6. Conclusions

We have implemented the algorithm proposed in Ref. [9] in a D-Wave quantum annealer to solve the equilibrium state of a complex financial network that predicts financial crashes. Although the size of the studied financial network is limited, this proof of principle is in agreement with the results of an exhaustive search. This may be improved with the design of a customized “financial quantum annealer”, a quantum processor with suitable connectivity for the efficient embedding of this kind of problem. Such coherent quantum annealers can be built with current technology [38,39,40], providing convenient multi-qubit couplings.

Author Contributions

Y.D. performed the initial simulations of the protocol on the D-Wave quantum annealer; J.G.-C. detailed and improved the implementation of the algorithm; M.S. and E.S. provided the original idea based on a theoretical proposal by R.O., and the rest of the authors contributed to the different phases of the development of the research. All authors have read and agreed to the published version of the manuscript.

Funding

The authors acknowledge financial support from the project grant PID2021-125823NA-I00 funded by MCIN/AEI/10.13039/501100011033 and by “ERDF A way of making Europe” and “ERDF Invest in your Future”, Basque Government through Grant No. IT1470-22, the QUANTEK project from ELKARTEK program (KK-2021/00070), as well as from QMiCS (820505) and OpenSuperQ (820363) of the EU Flagship on Quantum Technologies, Spanish Ramón y Cajal Grants RYC-2017-22482 and RYC-2020-030503-I, UPV/EHU PhD Grant 20/276, as well as from the EU FET-Open projects Quromorphic (828826) and EPIQUS (899368), Junta de Andalucía (P20-00617 and US-1380840), Valencian Government with reference number CIAICO/2021/184, Spanish Ministry of Economic Affairs and Digital Transformation through the QUANTUM ENIA project call—Quantum Spain project, and the European Union through the Recovery, Transformation and Resilience Plan—NextGenerationEU within the framework of the Digital Spain 2025 Agenda.

Data Availability Statement

The available data that support the findings of this study are available at https://github.com/yongchengding/DWaveFinancialCrashPrediction (accessed on 31 October 2022).

Acknowledgments

The authors thank A. Martin and M. Garcia de Andoin for the useful discussions regarding the model and its implementation.

Conflicts of Interest

On behalf of all authors, the corresponding author states that there are no conflict of interest.

References

  1. Sornette, D.; Johansen, A.; Bouchaud, J.-P. Stock Market Crashes, Precursors and Replicas. J. Phys. I 1996, 6, 167–175. [Google Scholar] [CrossRef]
  2. Estrella, A.; Mishkin, F.S. Predicting U.S. Recessions: Financial Variables As Leading Indicators. Rev. Econ. Stat. 1998, 80, 45–61. [Google Scholar] [CrossRef]
  3. Johansen, A.; Sornette, D.; Ledoit, O. Predicting financial crashes using discrete scale invariance. Risk 1999, 12, 91. [Google Scholar] [CrossRef]
  4. Sornette, D. Why Stock Markets Crash: Critical Events in Complex Financial Systems; Princeton University Press: Princeton, NJ, USA, 2003. [Google Scholar]
  5. Bussiere, M.; Fratzscher, M. Towards a new early warning system of financial crises. J. Int. Money Financ. 2006, 25, 953–973. [Google Scholar] [CrossRef]
  6. Frankel, J.; Saravelos, G. Can leading indicators assess country vulnerability? Evidence from the 2008–2009 global financial crisis. J. Int. Econ. 2012, 87, 216–231. [Google Scholar] [CrossRef]
  7. Lin, W.Y.; Hu, Y.H.; Tsai, C.F. Machine Learning in Financial Crisis Prediction: A Survey. IEEE Trans. Syst. Man Cybern. Part C 2012, 42, 421–436. [Google Scholar]
  8. Hemenway, B.; Khanna, S. Sensitivity and computational complexity in financial networks. Algorithmic Financ. 2016, 5, 95–110. [Google Scholar] [CrossRef]
  9. Orús, R.; Mugel, S.; Lizaso, E. Forecasting financial crashes with quantum computing. Phys. Rev. A 2019, 99, 60301. [Google Scholar] [CrossRef]
  10. Mugel, S.; Lizaso, E.; Orús, R. Use Cases of Quantum Optimization for Finance. arXiv 2020, arXiv:2010.01312. [Google Scholar]
  11. Finnila, A.B.; Gomez, M.A.; Sebenik, C.; Stenson, C.; Doll, J.D. Quantum annealing: A new method for minimizing multidimensional functions. Chem. Phys. Lett. 1994, 219, 343–348. [Google Scholar] [CrossRef]
  12. Das, A.; Chakrabarti, B.K. Quantum Annealing and Analog Quantum Computation. Rev. Mod. Phys. 2008, 80, 1061. [Google Scholar] [CrossRef]
  13. Kim, Y.; Kim, H.; Yook, S. Agent-based spin model for financial markets on complex networks: Emergence of two-phase phenomena. Phys. Rev. E 2008, 78, 36115. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  14. Murota, M.; Inoue, J. Characterizing Financial Crisis by Means of the Three States Random Field Ising Model. In Econophysics of Agent-Based Models, New Economic Windows; Springer: Milan, Italy, 2013; pp. 83–98. [Google Scholar]
  15. Boixo, S.; Rønnow, T.F.; Isakov, S.V.; Wang, Z.; Wecker, D.; Lidar, D.A.; Martinis, J.M.; Troyer, M. Evidence for quantum annealing with more than one hundred qubits. Nat. Phys. 2014, 10, 218–224. [Google Scholar] [CrossRef]
  16. Neukart, F.; Compostella, G.; Seidel, C.; Dollen, D.; Yarkoni, S.; Parney, B. Traffic Flow Optimization Using a Quantum Annealer. Front. ICT 2017, 4, 29. [Google Scholar] [CrossRef]
  17. Hu, F.; Lamata, L.; Sanz, M.; Chen, X.; Chen, X.-Y.; Wang, C.; Solano, E. Quantum computing cryptography: Finding cryptographic Boolean functions with quantum annealing by a 2000 qubit D-wave quantum computer. Phys. Lett. A 2020, 384, 126214. [Google Scholar] [CrossRef]
  18. Perdomo-Ortiz, A.; Dickson, N.; Drew-Brook, M.; Rose, G.; Aspuru-Guzik, A. Finding low-energy conformations of lattice protein models by quantum annealing. Sci. Rep. 2012, 2, 571. [Google Scholar] [CrossRef]
  19. Rosenberg, G.; Haghnegahdar, P.; Goddard, P.; Carr, P.; Wu, K.; de Prado, M.L. Solving the Optimal Trading Trajectory Problem Using a Quantum Annealer. IEEE J. Sel. Top. Signal Process. 2016, 10, 1053–1060. [Google Scholar] [CrossRef]
  20. Orús, R.; Mugel, S.; Lizaso, E. Quantum computing for finance: Overview and prospects. Rev. Phys. 2019, 4, 100028. [Google Scholar] [CrossRef]
  21. Nielsen, M.A.; Chuang, I.L. Quantum Computation and Quantum Information; Cambridge University Press: Cambridge, UK, 2000. [Google Scholar]
  22. Baaquie, B.E. Quantum Finance: Path Integrals and Hamiltonians for Options and Interest Rates; Cambridge University Press: Cambridge, UK, 2007. [Google Scholar]
  23. Venturelli, D.; Kondratyev, A. Reverse Quantum Annealing Approach to Portfolio Optimization Problems. Quantum Mach. Intell. 2019, 1, 17–30. [Google Scholar] [CrossRef]
  24. Cohen, J.; Khan, A.; Alexander, C. Portfolio Optimization of 40 Stocks Using the DWave Quantum Annealer. arXiv 2020, arXiv:2007.01430. [Google Scholar]
  25. Mugel, S.; Kuchkovsky, C.; Sanchez, E.; Fernandez-Lorenzo, S.; Luis-Hita, J.; Lizaso, E.; Orús, R. Dynamic Portfolio Optimization with Real Datasets Using Quantum Processors and Quantum-Inspired Tensor Networks. arXiv 2020, arXiv:2007.00017. [Google Scholar] [CrossRef]
  26. Pusey-Nazzaro, L.; Date, P. Adiabatic Quantum Optimization Fails to Solve the Knapsack Problem. arXiv 2020, arXiv:2008.07456. [Google Scholar]
  27. Phillipson, F.; Bhatia, H.S. Portfolio Optimisation Using the D-Wave Quantum Annealer. arXiv 2020, arXiv:2012.01121. [Google Scholar]
  28. Nocedal, J.; Wright, S.J. Numerical Optimization; Springer: Berlin/Heidelberg, Germany, 2006. [Google Scholar]
  29. Rocchetto, A.; Benjamin, S.C.; Li, Y. Stabilisers as a design tool for new forms of Lechner-Hauke-Zoller Annealer. arXiv 2016, arXiv:1603.08554. [Google Scholar]
  30. Bravyi, S.; Divincenzo, D.P.; Oliveira, R.I.; Terhal, B.M. The complexity of Stoquastic Local Hamiltonian problems. Quant. Inf. Comp. 2008, 8, 361–385. [Google Scholar] [CrossRef]
  31. Leib, M.; Zoller, P.; Lechner, W. A Transmon quantum annealer: Decomposing many-body Ising constraints into pair interactions. arXiv 2016, arXiv:1604.02359. [Google Scholar] [CrossRef]
  32. Thomas, C.K.; Katzgraber, H.G. Optimizing glassy p-spin models. Phys. Rev. E 2011, 83, 046709. [Google Scholar] [CrossRef]
  33. Auffinger, A.; Arous, G.B.; Cerny, J. Random matrices and complexity of spin glasses. arXiv 2010, arXiv:1003.1129. [Google Scholar]
  34. Chancellor, N.; Zohren, S.; Warburton, P.; Benjamin, S.; Roberts, S. A direct mapping of Max k-SAT and high order parity checks to a Chimera graph. Sci. Rep. 2016, 6, 37107. [Google Scholar] [CrossRef] [PubMed]
  35. Chancellor, N.; Zohren, S.; Warburton, P.A. Circuit design for multi-body interactions in superconducting quantum annealing systems with applications to a scalable architecture. NPJ Quantum Inf. 2017, 3, 21. [Google Scholar] [CrossRef]
  36. Available online: https://github.com/dwavesystems/qbsolv (accessed on 27 February 2019).
  37. Available online: https://www.dwavesys.com/press-releases/d-wave-previews-next-generation-quantum-computing-platform (accessed on 10 February 2019).
  38. Ozfidan, I.; Deng, C.; Smirnov, A.Y.; Lanting, T.; Harris, R.; Swenson, L.; Whittaker, J.; Altomare, F.; Babcock, M.; Baron, C.; et al. Demonstration of a Nonstoquastic Hamiltonian in Coupled Superconducting Flux Qubits. Phys. Rev. Appl. 2020, 13, 034037. [Google Scholar] [CrossRef]
  39. Lechner, W.; Hauke, P.; Zoller, P. A quantum annealing architecture with all-to-all connectivity from local interactions. Sci. Adv. 2015, 1, e1500838. [Google Scholar] [CrossRef] [PubMed]
  40. Hauke, P.; Katzgraber, H.G.; Lechner, W.; Nishimori, H.; Oliver, W.D. Perspectives of quantum annealing: Methods and implementations. arXiv 2020, arXiv:1903.06559. [Google Scholar] [CrossRef] [PubMed] [Green Version]
Figure 1. Example of a financial network: the yellow and green nodes denote institutions and assets, respectively. The links denote the ownerships and cross-holdings described by the ownership matrices D and C , respectively. The diagonal matrix C ˜ represents the self-ownership of institutions, which would be plotted as self-loops in the graph representation. The equity value V i of institution i is defined by summing its ownership of all assets and cross-holdings.
Figure 1. Example of a financial network: the yellow and green nodes denote institutions and assets, respectively. The links denote the ownerships and cross-holdings described by the ownership matrices D and C , respectively. The diagonal matrix C ˜ represents the self-ownership of institutions, which would be plotted as self-loops in the graph representation. The equity value V i of institution i is defined by summing its ownership of all assets and cross-holdings.
Entropy 25 00323 g001
Figure 2. Recast of quantum Hamiltonian with k-qubit interactions into a modified, effective Hamiltonian with the same low-energy spectrum with two-qubit interactions at most. We illustrate the particular case of a k = 4 -qubit interaction, which requires the introduction of 4 ancilla qubits to obtain the effective Hamiltonian.
Figure 2. Recast of quantum Hamiltonian with k-qubit interactions into a modified, effective Hamiltonian with the same low-energy spectrum with two-qubit interactions at most. We illustrate the particular case of a k = 4 -qubit interaction, which requires the introduction of 4 ancilla qubits to obtain the effective Hamiltonian.
Entropy 25 00323 g002
Figure 3. Chimera graph topology produced by the D-Wave 2000Q quantum annealer. The 2048 qubits are partitioned into subgraphs of 8 qubits. The connection between subgraphs is sparse; in each of these subgraphs there are two sets of four qubits and each qubit connects to all qubits in the other set but to none in its own, forming a K 4 , 4 bipartite graph.
Figure 3. Chimera graph topology produced by the D-Wave 2000Q quantum annealer. The 2048 qubits are partitioned into subgraphs of 8 qubits. The connection between subgraphs is sparse; in each of these subgraphs there are two sets of four qubits and each qubit connects to all qubits in the other set but to none in its own, forming a K 4 , 4 bipartite graph.
Entropy 25 00323 g003
Figure 4. (a) Ownership matrix D for the linear model. The element D i k 0 corresponds to the percentage of asset k owned by institution i. We randomize the ownership matrix D with a Dirichlet distribution that satisfies i = 1 n D i j = 1 . (b) Cross-holding matrix C for the linear model that describes the cross-holdings and self-ownerships among institutions. The cross-holding matrix is generated in a similar way to the ownership matrix but with a constraint that all diagonal elements should be larger than 0.5 , ensuring that all institutions can make decisions according to their own wills. These data, as well as the asset prices, have been synthetically produced but following all constraint conditions proposed in the theoretical model [9].
Figure 4. (a) Ownership matrix D for the linear model. The element D i k 0 corresponds to the percentage of asset k owned by institution i. We randomize the ownership matrix D with a Dirichlet distribution that satisfies i = 1 n D i j = 1 . (b) Cross-holding matrix C for the linear model that describes the cross-holdings and self-ownerships among institutions. The cross-holding matrix is generated in a similar way to the ownership matrix but with a constraint that all diagonal elements should be larger than 0.5 , ensuring that all institutions can make decisions according to their own wills. These data, as well as the asset prices, have been synthetically produced but following all constraint conditions proposed in the theoretical model [9].
Entropy 25 00323 g004
Figure 5. Linear model results. The first row shows the results when the matrix equation is solved exactly, the second row when qbsolv with the tabu classical solver is used, and the third row when qbsolv with the D-Wave 2000Q solver is employed. By comparing the individual equilibrium values, we can see that the quantum annealer provides a compatible solution to the exact solution.
Figure 5. Linear model results. The first row shows the results when the matrix equation is solved exactly, the second row when qbsolv with the tabu classical solver is used, and the third row when qbsolv with the D-Wave 2000Q solver is employed. By comparing the individual equilibrium values, we can see that the quantum annealer provides a compatible solution to the exact solution.
Entropy 25 00323 g005
Figure 6. (a) Ownership matrix D for the implemented network with failure terms. The element D i k 0 corresponds to the percentage of asset k owned by institution i. We randomize the ownership matrix D with a Dirichlet distribution that satisfies i = 1 n D i j = 1 . (b) Cross-holding matrix C for the implemented network with failure terms describing the cross-holdings and self-ownerships among institutions. The cross-holding matrix is generated in a similar way to the ownership matrix but with a constraint that all diagonal elements should be larger than 0.5 , ensuring that all institutions can make decisions according to their own wills.
Figure 6. (a) Ownership matrix D for the implemented network with failure terms. The element D i k 0 corresponds to the percentage of asset k owned by institution i. We randomize the ownership matrix D with a Dirichlet distribution that satisfies i = 1 n D i j = 1 . (b) Cross-holding matrix C for the implemented network with failure terms describing the cross-holdings and self-ownerships among institutions. The cross-holding matrix is generated in a similar way to the ownership matrix but with a constraint that all diagonal elements should be larger than 0.5 , ensuring that all institutions can make decisions according to their own wills.
Entropy 25 00323 g006
Figure 7. Market values v 1 , v 2 , and v 3 of institutions 1, 2, and 3, respectively, for different scenarios. The first group (left) is the equilibrium state without taking nonlinearity terms (perturbations) into consideration, where the asset price is calculated by inverting the matrix of Equation (1). The second group (center) is the equilibrium state after taking nonlinearity as the ‘failure term’, which is activated by a critical value vector of 80 % of the original equilibrium state calculated with a straightforward method by trying 32 3 times by brute force, corresponding to all possible combinations. The third group (right) shows the outcome of the qbsolv software in D-Wave 2000Q. The error bar characterizes a 95% confidence interval. The agreement between the integer and annealer solutions confirms the feasibility and accuracy of the method. Additionally, by comparing both solutions with the pre-perturbation values, we can conclude that we have detected the financial crash.
Figure 7. Market values v 1 , v 2 , and v 3 of institutions 1, 2, and 3, respectively, for different scenarios. The first group (left) is the equilibrium state without taking nonlinearity terms (perturbations) into consideration, where the asset price is calculated by inverting the matrix of Equation (1). The second group (center) is the equilibrium state after taking nonlinearity as the ‘failure term’, which is activated by a critical value vector of 80 % of the original equilibrium state calculated with a straightforward method by trying 32 3 times by brute force, corresponding to all possible combinations. The third group (right) shows the outcome of the qbsolv software in D-Wave 2000Q. The error bar characterizes a 95% confidence interval. The agreement between the integer and annealer solutions confirms the feasibility and accuracy of the method. Additionally, by comparing both solutions with the pre-perturbation values, we can conclude that we have detected the financial crash.
Entropy 25 00323 g007
Figure 8. An efficient encoding of three qubits, making use of only one ancilla qubit. The multi-to-two interaction Hamiltonian mapping is a general method, but for three-to-two mapping, a more efficient mapping can be constructed via a subgraph with full connectivity of three logical qubits and one ancilla.
Figure 8. An efficient encoding of three qubits, making use of only one ancilla qubit. The multi-to-two interaction Hamiltonian mapping is a general method, but for three-to-two mapping, a more efficient mapping can be constructed via a subgraph with full connectivity of three logical qubits and one ancilla.
Entropy 25 00323 g008
Table 1. Low-energy spectrum (first 8 eigenstates) of the two-qubit Hamiltonian, Equation (7) with k = 3 , as a result of mapping the term σ ^ 1 σ ^ 2 σ ^ 3 according to Ref. [35]. Values of the parameters J 3 = 1 u, J = J a = 20 u , q 0 = 10 u , h = 10 u , q 1 = q 3 = 9 u , q 2 = 11 u , h 1 = 29 u , h 2 = 9 u , h 3 = 51 u .
Table 1. Low-energy spectrum (first 8 eigenstates) of the two-qubit Hamiltonian, Equation (7) with k = 3 , as a result of mapping the term σ ^ 1 σ ^ 2 σ ^ 3 according to Ref. [35]. Values of the parameters J 3 = 1 u, J = J a = 20 u , q 0 = 10 u , h = 10 u , q 1 = q 3 = 9 u , q 2 = 11 u , h 1 = 29 u , h 2 = 9 u , h 3 = 51 u .
σ ^ 1 σ ^ 2 σ ^ 3 σ ^ 1 a σ ^ 2 a σ ^ 3 a Energy (u)
11−1−1−11−121
1−11−1−11−121
−111−1−11−121
−1−1−1111−121
111−1−1−1−119
1−1−1−111−119
−11−1−111−119
−1−11−111−119
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Ding, Y.; Gonzalez-Conde, J.; Lamata, L.; Martín-Guerrero, J.D.; Lizaso, E.; Mugel, S.; Chen, X.; Orús, R.; Solano, E.; Sanz, M. Toward Prediction of Financial Crashes with a D-Wave Quantum Annealer. Entropy 2023, 25, 323. https://doi.org/10.3390/e25020323

AMA Style

Ding Y, Gonzalez-Conde J, Lamata L, Martín-Guerrero JD, Lizaso E, Mugel S, Chen X, Orús R, Solano E, Sanz M. Toward Prediction of Financial Crashes with a D-Wave Quantum Annealer. Entropy. 2023; 25(2):323. https://doi.org/10.3390/e25020323

Chicago/Turabian Style

Ding, Yongcheng, Javier Gonzalez-Conde, Lucas Lamata, José D. Martín-Guerrero, Enrique Lizaso, Samuel Mugel, Xi Chen, Román Orús, Enrique Solano, and Mikel Sanz. 2023. "Toward Prediction of Financial Crashes with a D-Wave Quantum Annealer" Entropy 25, no. 2: 323. https://doi.org/10.3390/e25020323

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop