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

^{1}

^{2}

^{3}

^{4}

^{5}

^{6}

^{7}

^{8}

^{9}

^{10}

^{11}

^{12}

^{13}

^{14}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Formulation of the Model

## 3. Quantum Annealing Algorithm

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

- 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.

## 5. Results and Discussion

## 6. Conclusions

## Author Contributions

## Funding

## Data Availability Statement

## Acknowledgments

## Conflicts of Interest

## References

- Sornette, D.; Johansen, A.; Bouchaud, J.-P. Stock Market Crashes, Precursors and Replicas. J. Phys. I
**1996**, 6, 167–175. [Google Scholar] [CrossRef] - Estrella, A.; Mishkin, F.S. Predicting U.S. Recessions: Financial Variables As Leading Indicators. Rev. Econ. Stat.
**1998**, 80, 45–61. [Google Scholar] [CrossRef] - Johansen, A.; Sornette, D.; Ledoit, O. Predicting financial crashes using discrete scale invariance. Risk
**1999**, 12, 91. [Google Scholar] [CrossRef] - Sornette, D. Why Stock Markets Crash: Critical Events in Complex Financial Systems; Princeton University Press: Princeton, NJ, USA, 2003. [Google Scholar]
- Bussiere, M.; Fratzscher, M. Towards a new early warning system of financial crises. J. Int. Money Financ.
**2006**, 25, 953–973. [Google Scholar] [CrossRef] - 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] - 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] - Hemenway, B.; Khanna, S. Sensitivity and computational complexity in financial networks. Algorithmic Financ.
**2016**, 5, 95–110. [Google Scholar] [CrossRef] - Orús, R.; Mugel, S.; Lizaso, E. Forecasting financial crashes with quantum computing. Phys. Rev. A
**2019**, 99, 60301. [Google Scholar] [CrossRef] - Mugel, S.; Lizaso, E.; Orús, R. Use Cases of Quantum Optimization for Finance. arXiv
**2020**, arXiv:2010.01312. [Google Scholar] - 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] - Das, A.; Chakrabarti, B.K. Quantum Annealing and Analog Quantum Computation. Rev. Mod. Phys.
**2008**, 80, 1061. [Google Scholar] [CrossRef] - 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] - 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]
- 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] - 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] - 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] - 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] - 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] - Orús, R.; Mugel, S.; Lizaso, E. Quantum computing for finance: Overview and prospects. Rev. Phys.
**2019**, 4, 100028. [Google Scholar] [CrossRef] - Nielsen, M.A.; Chuang, I.L. Quantum Computation and Quantum Information; Cambridge University Press: Cambridge, UK, 2000. [Google Scholar]
- Baaquie, B.E. Quantum Finance: Path Integrals and Hamiltonians for Options and Interest Rates; Cambridge University Press: Cambridge, UK, 2007. [Google Scholar]
- Venturelli, D.; Kondratyev, A. Reverse Quantum Annealing Approach to Portfolio Optimization Problems. Quantum Mach. Intell.
**2019**, 1, 17–30. [Google Scholar] [CrossRef] - Cohen, J.; Khan, A.; Alexander, C. Portfolio Optimization of 40 Stocks Using the DWave Quantum Annealer. arXiv
**2020**, arXiv:2007.01430. [Google Scholar] - 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] - Pusey-Nazzaro, L.; Date, P. Adiabatic Quantum Optimization Fails to Solve the Knapsack Problem. arXiv
**2020**, arXiv:2008.07456. [Google Scholar] - Phillipson, F.; Bhatia, H.S. Portfolio Optimisation Using the D-Wave Quantum Annealer. arXiv
**2020**, arXiv:2012.01121. [Google Scholar] - Nocedal, J.; Wright, S.J. Numerical Optimization; Springer: Berlin/Heidelberg, Germany, 2006. [Google Scholar]
- 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] - 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] - 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] - Thomas, C.K.; Katzgraber, H.G. Optimizing glassy p-spin models. Phys. Rev. E
**2011**, 83, 046709. [Google Scholar] [CrossRef] - Auffinger, A.; Arous, G.B.; Cerny, J. Random matrices and complexity of spin glasses. arXiv
**2010**, arXiv:1003.1129. [Google Scholar] - 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] - 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] - Available online: https://github.com/dwavesystems/qbsolv (accessed on 27 February 2019).
- Available online: https://www.dwavesys.com/press-releases/d-wave-previews-next-generation-quantum-computing-platform (accessed on 10 February 2019).
- 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] - 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] - 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 $\mathbf{D}$ and $\mathbf{C}$, respectively. The diagonal matrix $\tilde{\mathbf{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 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 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 ${\mathbf{K}}_{\mathbf{4},\mathbf{4}}$ bipartite graph.

**Figure 4.**(

**a**) Ownership matrix $\mathbf{D}$ for the linear model. The element ${D}_{ik}\ge 0$ corresponds to the percentage of asset k owned by institution i. We randomize the ownership matrix $\mathbf{D}$ with a Dirichlet distribution that satisfies ${\sum}_{i=1}^{n}{D}_{ij}=1$. (

**b**) Cross-holding matrix $\mathcal{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 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 6.**(

**a**) Ownership matrix $\mathbf{D}$ for the implemented network with failure terms. The element ${D}_{ik}\ge 0$ corresponds to the percentage of asset k owned by institution i. We randomize the ownership matrix $\mathbf{D}$ with a Dirichlet distribution that satisfies ${\sum}_{i=1}^{n}{D}_{ij}=1$. (

**b**) Cross-holding matrix $\mathcal{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 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 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.

**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 ${\widehat{\sigma}}_{1}{\widehat{\sigma}}_{2}{\widehat{\sigma}}_{3}$ according to Ref. [35]. Values of the parameters ${J}_{3}$ = 1 u, $J={J}_{a}=20\phantom{\rule{4pt}{0ex}}\mathrm{u}$, ${q}_{0}=10\phantom{\rule{4pt}{0ex}}\mathrm{u}$, $h=-10\phantom{\rule{4pt}{0ex}}\mathrm{u}$, ${q}_{1}={q}_{3}=9\phantom{\rule{4pt}{0ex}}\mathrm{u}$, $q2=11\phantom{\rule{4pt}{0ex}}\mathrm{u}$, ${h}_{1}=29\phantom{\rule{4pt}{0ex}}\mathrm{u}$, ${h}_{2}=-9\phantom{\rule{4pt}{0ex}}\mathrm{u}$, ${h}_{3}=-51\phantom{\rule{4pt}{0ex}}\mathrm{u}$.

${\widehat{\mathit{\sigma}}}_{1}$ | ${\widehat{\mathit{\sigma}}}_{2}$ | ${\widehat{\mathit{\sigma}}}_{3}$ | ${\widehat{\mathit{\sigma}}}_{1}^{\mathit{a}}$ | ${\widehat{\mathit{\sigma}}}_{2}^{\mathit{a}}$ | ${\widehat{\mathit{\sigma}}}_{3}^{\mathit{a}}$ | Energy (u) |
---|---|---|---|---|---|---|

1 | 1 | −1 | −1 | −1 | 1 | −121 |

1 | −1 | 1 | −1 | −1 | 1 | −121 |

−1 | 1 | 1 | −1 | −1 | 1 | −121 |

−1 | −1 | −1 | 1 | 1 | 1 | −121 |

1 | 1 | 1 | −1 | −1 | −1 | −119 |

1 | −1 | −1 | −1 | 1 | 1 | −119 |

−1 | 1 | −1 | −1 | 1 | 1 | −119 |

−1 | −1 | 1 | −1 | 1 | 1 | −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. |

© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## 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