# Quantum Computing In Finance: A quick review

Just about every person is associated with the financial industry in their lifetime. Finance originated during the start of our civilization and since then it has been a substantial part of our lives. Finance deals with uncertainty and risks as the actual behaviour of the asset or security may differ from the expected return. To lower the risk we must analyze all the factors associated with it. This involves a calculation of infinite possibilities of different combinations of factors which gives minimum risk and maximum profit. These problems in finance can be expressed as optimization problems. These are the tasks that are particularly hard for classical computers as they may take millions of years.

Quantum computing harnesses the power of superposition, entanglement, and interference to speed up its computational power. In layman’s terms superposition is a phenomenon where a quantum bit ( qubit ) can be both ‘0’ and ‘1’ at the same time. It is more probabilistic than deterministic. Entanglement is a phenomenon where if two qubits are entangled, they will remain entangled no matter how far apart they are. So if we measure the spin of one qubit, we will instantly know the spin of another qubit irrespective of the physical remoteness between them. Interference can involve both constructive and destructive interference.

In the quantum world, the outcomes are given different probabilities of taking place and they have an amplitude. If some outcomes have a positive amplitude and others are negative, then outcomes can interfere destructively and cancel each other out so that the amplitude is zero and the corresponding outcome is never observed; likewise, they can interfere constructively and increase the likelihood of a given outcome.

One cannot talk about the great breakthroughs that started the ﬁeld of quantum computing without Grover’s algorithm, which ﬁnds a particular register in an unordered database in O(√N) steps. By contrast, the best classical algorithm requires $O(N/2)$ steps. This algorithm can be adapted to solve optimization problems, such as finding a Minimum Spanning Tree, maximizing ﬂow-like variables, and implementing Monte Carlo methods. Alternatively, the Quantum Approximate Optimization Algorithm (QAOA) ﬁnds a “good solution” (i.e: one with a minimum quality) to an optimization problem in a polynomial time. This requires exponential time on a classical computer. Optimization problems involve machine learning which in turn uses Fourier transformations. Here also it can result in substantial speedup as Quantum Fourier transform has complexity $O(log(N)^2)$ while classical fast Fourier transform has complexity $O(Nlog(N))$.

### Quantum Optimisation in Finance

Portfolio Optimization is the art of selecting the best portfolios of stocks from all the given portfolios that maximizes the expected returns and minimizes the financial risk. Assets in a portfolio should be selected based on several factors like how they perform relative to each other, they should have low correlation, should be well-diversified to avoid a crash if one asset underperforms.

There also exists a myriad of financial optimization problems of great monetary value such as investment optimization, liquidity management, and macro-economics problems such as financial crash prediction. These problems are complex because financial institutions or assets can be correlated in extremely complex ways. It is extremely hard for classical computers to determine the best choice of the portfolio due to its limited computational power. Quantum computers in turn can consider various factors and give the best solution in minimum time.

One of the quantum optimization algorithms is Quantum annealing. It starts with a set of qubits in a superposition state of 0 and 1. When they undergo quantum annealing, the couplers and biases are introduced and qubits are entangled. At this point, the system is in an entangled state of many possible answers. By the end, each qubit is in a classical state that represents the minimum energy state of the problem. In the case of a portfolio optimization problem, the problem can be constructed so that the lowest energy state corresponds to the highest return portfolio at the lowest volatility.

D-Wave is extensively using quantum annealing to solve optimization and sampling problems. Recently they launched an open-source plugin that allows developers to easily map quadratic optimization inputs in IBM’s Qiskit format onto D-Wave’s quadratic unconstrained binary optimization (QUBO) format and solve the same input on any quantum system supported in Qiskit. This allows users to have a realistic assessment of the benefits of quantum annealing on their applications.

The Variational quantum eigensolver (VQE) is another hybrid optimization algorithm that has been implemented to solve NP-hard problems, such as the travelling salesman problem, in polynomial time. The variational quantum eigensolver (VQE) strives to recover the lowest-energy eigenvalue of a given Hamiltonian by preparing quantum states guided by the variational principle. Quantum optimization has been successfully used in practical financial problems like optimal trading trajectory, optimal arbitrage opportunities and optimal feature selection in credit scoring.

Companies like IBM, Zapata, Rigetti, Microsoft are developing and using this method. Quantum software start-ups Multiverse and Chicago Quantum, both specialize in financial applications, have published encouraging portfolio optimization results of such algorithms run on D-Wave’s quantum computer. Chicago Quantum is actively researching quantum algorithms to optimize financial portfolios and recently published an efficient portfolio of 128 stocks from 3,514 stocks.

## Quantum Monte Carlo

Monte Carlo Method is a mathematical technique used to estimate possible outcomes of an uncertain event. It is used to simulate uncertainties in the stock market, portfolio evaluation, derivatives pricing, and many more in finance. Option pricing, for instance, is usually solved through Monte Carlo due to the inherently stochastic nature of the variables involved. But if we want to obtain the most efficient result with a small associated error the required number of simulations is gigantic. It is common for these computations to take up to 24 hours.

Thus obtaining a quantum speedup in the Monte Carlo Method can be very advantageous. This can be achieved using a quantum amplitude estimation algorithm which can sample a probabilistic distribution quadratically faster than classical methods. The Quantum amplitude estimation algorithm utilizes the maximum likelihood estimation based on measurement data produced from quantum circuits with a different number of amplitude amplification operations. Risk analysis and pricing of financial derivatives are some of the problems which can be tackled using this method. Determining the risk of the complete portfolio of a desk often requires overnight calculations of the prices. Through quantum computing, overnight calculations could be reduced to much shorter time scales (such as minutes). This allows the institution to react faster to changing market conditions and to profit from trading opportunities. IBM has already published a paper that showcases a quadratic accelerated version of Monte Carlo simulations.

Cambridge Quantum Computing (CQC) recently made a breakthrough in quantum monte Carlo integration using quantum amplitude estimation. JPMorgan Chase and Barclays have been using IBM’s quantum-computing software to test Monte Carlo simulations for portfolio optimization since 2017. Goldman Sachs was able to speed up derivatives pricing by a thousand times for a million potential paths compared to the Monte Carlo method.  BMO Financial Group and Scotiabank collaborated with Xanadu to benchmark a quantum Monte Carlo algorithm for a variety of trading products.

## Quantum Machine Learning (QML)

Machine learning focuses on finding relations in data and building assumptions around them. Such approaches are important in many financial problems that deal with uncertainty in the future evolution of asset prices and risk. Problems like credit scoring, financial threat detection, and customer identification usually employ complex machine learning models. Banks can estimate the regression problem based on the features of customers, such as age, salary, historical payment, micro, and macroeconomic indicators, and so on. Financial institutions can also detect frauds by finding patterns that deviate greatly from normal behavior by anomaly detection.

While machine learning algorithms are used to compute immense quantities of data, quantum machine learning utilizes qubits and quantum operations or specialized quantum systems to improve computational speed and data storage. This is implemented using hybrid methods that involve both classical and quantum processing like quantum approximate optimization algorithms (QAOA), variational quantum eigensolver (VQE), quantum neural networks (QNN), and many more, where computationally difficult subroutines are outsourced to a quantum computer. Most recent advances in Quantum Machine learning include quantum-powered generative adversarial networks (GANs) which can fill gaps in data used to train machine learning models by creating synthetic data that falls within the probability range of existing data. Augmenting training data in this way could one day improve the ability of machine learning models to detect rare cancers or model rare events such as pandemics. Recent research from IBM demonstrated significant quantum speedup in supervised machine learning using quantum kernel estimation(QKE) algorithm which only uses quantum computers to estimate kernel entries.

Xanadu, Google, IBM, Zapata are some of the companies that are extensively implementing quantum machine learning algorithms. Xanadu has launched its open-source software Pennylane for providing differentiable quantum computing capabilities. It is specifically designed for the development of variational quantum algorithms and quantum machine learning applications.  Nomura Asset Management (NAM) is working with Tohoku University on stock return prediction using quantum machine learning algorithms. JP Morgan is actively developing quantum algorithms that can be applied in artificial intelligence and optimization.

### Putting Quantum Tech in Finance

There are several computationally challenging problems in financial services that are demanding in terms of required precision or run-time. The finance industry is beginning to salivate over the transformational possibilities that quantum computing could usher in. Many finance companies and banks are investing in quantum solutions to improve their financial operations. Companies that have invested to integrate quantum computing are gaining an advantage in building expertise on how to model financial problems for quantum solutions, and by hiring already-scarce quantum talent. Even though full-scale quantum computers are still years away, it would be wise for financial companies to start gaining experience in the use of this nascent, but fast-moving technology.