How Quantum Computing will Change the World of Finance

Suraj R
Alpha Beta Blog
Published in
11 min readOct 23, 2020

--

Finance is a field of massive complexity. It is a system whose dynamics influence itself. For instance, the stock market is one of the most complex things humans have created. It is influenced by so many known and unknown factors. What’s more, it is influenced by its own movements. That adds another layer of complexity that makes it impossible to accurately simulate.

But we did not give up and say we are slaves to the gods of chaos and randomness. In fact, predictions and forecasts are fundamental to make sense of the uncertainty that is so intrinsic to finance. Things like credit ratings, loan approvals and behaviours of assets are a function of these predictions. We try to forecast and optimise by using a mixture of statistics, probability, and some beautiful algorithms.

There are many important problems in the world of finance that computing helps solve. These include dynamic portfolio optimisation given a risk factor to maximise returns, future prediction of performance of assets using past data and even statistical simulation by sampling to predict the future behaviour of assets.

While there are algorithms that help solve these problems, they are limited by bottlenecks in computational power. Moreover, some of these algorithms are simply not efficient enough in classical systems. Moore’s law is losing relevance quickly with quantum effects coming into play as transistors get smaller. There is a need for a revolution in the way we do computation and right now, we are already amidst one.

Enter quantum computers. Richard Feynman once said, “Nature isn’t classical, dammit, and if you want to make a simulation of nature, you’d better make it quantum mechanical, and by golly it’s a wonderful problem, because it doesn’t look so easy.”

As the great man said, it isn’t easy but we are getting there.

Quantum Mechanics refers to the mind-bending, weird phenomena that occur when we start trying to observe things at an extremely minute scale. When we observe very tiny particles like photons and electrons, we notice that they collapse into a definite state only when we observe them. At other times, particles are essentially a mixture of probability of all their possible states. The Schrodinger’s Cat experiment illustrates this beautifully.

Schrodinger’s Cat Experiment

Over the years, we have observed that small particles tunnel through barriers in a phenomenon called quantum tunnelling. Quantum entanglement occurs when multiple particles become inextricably linked, and whatever happens to one immediately affects the other, regardless of how far apart they are. Quantum superposition allows a particle to be in multiple places or states at the same time. If you are hearing about these things for the first time and cannot wrap your head around them, don’t worry, you’re in good company. Einstein could not come to terms with it either. He called quantum entanglement ‘Spooky action at a distance’ and proclaimed that ‘god does not play dice’. However repeated experiments over the years agree with the quantum theory and in spite of various other contenders, continue to be most revered and accepted in academic circles right now.

Quantum computers leverage the quantum mechanical phenomena of superposition and entanglement to create states that scale exponentially with number of quantum bits or qubits. Theoretically, they allow us to solve specific problems in a manner that is significantly more efficient than classical computers.

Analogous to a classical bit, a qubit is the minimum amount of processable information in quantum computing which encodes the classical bits of information 0 and 1 in its basis states: |0⟩ and |1⟩. This system can also be in a superposition of states |0⟩ and |1⟩. The function that describes the system is a linear combination of |0⟩ and |1⟩ where their respective coefficients squared indicates the probability of the system collapsing into that state when observed. This allows them to be simultaneously in all the system’s states at once. It is this property which allows quantum computers to perform parallel computations on a massive scale.

Contrasting between how quantum computers and classical computers solve problems

Quantum Computers use quantum gates, which are analogous to classical logic gates, to make quantum circuits for computation. Alongside a reversible quantum version of classical gates, there are a few exclusively quantum gates like the Hadamard gate and the Pauli-X gate. Using these gates intelligently allows us to build remarkably effective quantum algorithms that perform significantly better than their classical counterparts.

As a result, quantum computing is poised to help us overcome the computational bottlenecks that crop up when we try to implement algorithms that solve important problems in finance.

However, the idea of applying quantum mechanics to finance is not a new one: some well-known financial problems can be directly expressed in a quantum-mechanical form. As an example, the Black–Scholes–Merton formula, which is a mathematical model that estimates the price variations of a financial instrument over time, can be mapped to the Schrodinger Wave Equation. Even the entire financial market can be modelled as a quantum process, where quantities that are important to finance, such as the covariance matrix, which is used to calculate the standard deviation of a portfolio of stocks, emerge naturally.

Optimization is generally at the core of many financial problems and it is an NP-Hard Problem. This means that it is extremely difficult, if not impossible, for classical computers to efficiently determine the most optimized state of a system. However, Alexandre M. Zagoskin, the co-founder of D-Wave, which built the word’s first commercial quantum annealer, proved theoretically that this problem could be solved in polynomial time using Quantum Annealers.

In an optimization problem, we search for the best of many possible combinations. Optimization problems include scheduling challenges, such as “Should I ship this package on this truck or the next one?” or “What is the most efficient route a traveling salesperson should take to visit different cities?”

Physics can help solve these sorts of problems because we can frame them as energy minimization problems. A fundamental rule of physics is that everything tends to seek a minimum energy state. Objects slide down hills; hot things cool down over time. This behaviour is also true in the world of quantum physics. Quantum annealing simply uses quantum physics to find low-energy states of a problem and therefore the optimal or near-optimal combination of elements.

Quantum Annealers can potentially help us solve problems like portfolio optimisation, optimal feature selections for credit ratings and loan approvals and arbitrage opportunities which is the idea of making profit from differing prices in the same asset in different markets. For instance, we could change euros for dollars, then to yens, and then back to euros, and make a small profit in the process. As a matter of fact, D-Wave’s current quantum annealer was able to solve smaller instances of such optimisation problems in a time comparable to that of classical systems. The prospect is that future versions of the D-Wave chip should soon be able to handle much bigger instances of the problem, eventually overtaking classical methods.

Now let us look at simulations. Unarguably, simulations are extremely important for us to understand our world better. Imagine having the power to accurately simulate the time when a bunch of chemicals came together in a perfect symphony to create the first living cell and consequently, life. The implications would be enormous. We could then use what we learn to predict where and how life could be brimming in different corners of our universe. It could help us make life interplanetary.

Stepping away from fanciful segues, statistical sampling is one of the most used tools to simulate chaotic systems like the financial world. A broad range of algorithms called the Monte Carlo algorithms are used to harness randomness to solve problems that might be deterministic in principle.

Okay, here’s a puzzle for you. Imagine you have a finite 2-D plane containing a circle of radius r and a square of side length r. These two figures do not intersect or overlap with one another. You also have a bag with 10000 marbles. Your job is to find the approximate value for π using only these tools.

Got it? Nice. Essentially what you would do is drop the balls in a uniformly random manner by closing your eyes on the finite 2D plane. Now to get an approximation of pi, you could divide the number balls that land in the circle by those that land in the square.

π = No. of balls in Circle/No. of balls in the square

Finding the value of π by randomly dropping marbles

It all works because π = πr²/r² = area of circle/area of square. The number of balls that land in these two figures is proportional to their cross-sectional area. As a result, a random statistical sampling helps us arrive at approximate deterministic results. As you can probably infer, the accuracy of the result increases with an increase in the number of samples.

Such methods of simulations are used throughout the world of finance. They are used for risk analysis, algorithmic trading, and the pricing of derivatives. Ashley Montanaro showed that by applying quantum algorithms like Shor’s factoring algorithm, that helps find integer factors of large numbers in polynomial time and Grover’s Search Algorithm, that helps search through data quickly, we could significantly reduce the number of random samples that are required for Monte Carlo simulations. This, along with the speedup when random sampling is done through a quantum process, concatenate and therefore greatly increase the efficiency of our algorithms.

Apart from these areas, there is an exciting field called Quantum Machine Learning. The idea is to use quantum algorithms to substantially speed up the way we analyse our data and learn from it. This field is brimming with research and the implications could potentially be massive even on a short time scale. In the financial world, banks use classification algorithms for to detect fraud. Neural Networks are used for market analysis. All these methods are in for a massive speed up with the advent of quantum computing.

Quantum Cryptography is another intriguing field that promises to make our transactions extremely secure. Cryptography is the process of encrypting data or converting plain text into scrambled text so that only someone who has the right “key” can read it. Quantum cryptography, by extension, simply uses the principles of quantum mechanics to encrypt data and transmit it in a way that cannot be hacked.

Imagine you have two people, Aditya and Bharath, who want to send a secret to each other that no one else can intercept. Using Quantum Cryptography, Aditya sends Bharath a series of polarized photons over a fiber optic cable. This cable doesn’t need to be secured because the photons have a randomized quantum state.

If an eavesdropper, named Esha, tries to listen in on the conversation, she has to read each photon to read the secret. Then she must pass that photon on to Bharath. By reading the photon, Esha alters the photon’s quantum state, which introduces errors into the quantum key. This alerts Aditya and Bharath that someone is listening, and the key has been compromised, so they discard the key. Aditya has to send Bharath a new key that isn’t compromised, and then Bharath can use that key to read the secret.

This way, Quantum Cryptography could be particularly useful to secure blockchains and decentralised blockchain based cryptocurrencies like bitcoin which are poised to replace traditional currencies in the near future.

IBM’s Quantum Computer: A work of genius

Big players in the FinTech industry have already begun to see the potential in quantum tech. JPMorgan Chase recently partnered with IBM Quantum so their engineers can start developing quantum algorithms and be quantum ready within the next 5–10 years when Quantum Computers are expected to be fully commercialised. Even Goldman Sachs, Wells Fargo and Barclays have been working with IBM Quantum to understand and mitigate the risks that might come with powerful quantum algorithms being able to crack existing classical encryption.

However, having said all this it is important that we understand that constructing a quantum computer which is capable of outperforming classical computers is a truly formidable task, and potentially one of the great challenges of the century. Before we reach this level, several critical issues will have to be dealt with.

One of the most important problems is decoherence, which refers to uncontrolled interactions between the system and its environment. This leads to a loss of quantum behaviour in the quantum processor, killing any advantage that a quantum algorithm could provide. It is possible to correct for decoherence using error-correction algorithms. This can be done by encoding the quantum state, with redundancy, over many qubits, and is only possible when the error rate of individual quantum gates is sufficiently small. With these, we can fully build quantum algorithms which run for a relatively longer time. A huge obstacle we are facing is that operating a single fault-tolerant qubit can require many thousands of physical qubits. In a recent study, it was estimated that quantum computing could achieve a significant speedup, but this advantage vanished when the classical processing required to implement error-correction schemes was considered. Another important challenge is therefore the development of new error-correction schemes with more reasonable requirements.

Quantum computing has been suggested as a solution to many computationally demanding problems, especially in machine learning, which require processing vast amounts of data. At present, we do not have a quantum RAM (qRAM) capable of efficiently encoding this information as a quantum state, and reliably storing it for extended periods of time. This is among the largest hardware challenges for quantum computing.

However, this field is developing at a striking rate, partly due to experimental developments in quantum hardware, which are surpassing all expectations, and partly due to conceptual leaps, which promise gigantic speedups for widely applicable algorithms. The hope is that before long quantum computers will play a key role in quantitative finance. However, several experimental breakthroughs will be necessary before we can construct a universal quantum processor capable of surpassing present-day supercomputers. We will need, for instance, to vastly increase the quality of qubits to implement some of the algorithms discussed here. It is possible, however, that faulty quantum computers will find interesting applications far before we achieve fault-tolerant quantum computing. It is in this area that the first real disruptions in finance will occur, and the possibilities are fascinating.

If you’ve read until this point, I hope you have had quite a few takeaways. I would love to discuss the topic further and I’ll be thrilled to hear your feedback too. Shoot me a mail at suraj.ranganath@gmail.com

Further Reading

  1. If You Don’t Understand Quantum Physics, Try This.
  2. Absolute Basics of how Quantum Computers Work.
  3. Black-Scholes: A Quantum Perspective
  4. Shor’s Algorithm and Grover’s Algorithm
  5. Quantum Cryptography Demystified
  6. Quantum Computing for Finance: Overview and Prospects
  7. How Adiabatic Quantum Computation is Equivalent to Standard Quantum Computation

--

--