Quantum Computing’s Role in Predicting the Stock Market

Trading algorithms don’t always have to be about speed, but in most cases, they are. As is widely documented, one surefire way to make profit in trading is by finding market inefficiencies before others do. This is what inspired Thomas Peterffy to write code which could quickly compute the true price of options before other mathematicians could do this by hand, and what inspired Spread Networks to spend $300 million constructing a dark-fibre cable which could send prices from Chicago to New York at near the speed of light. In an even more general sense, it’s how all trading works: You buy stock before others realize it’s valuable, and you sell before others realize it’s overpriced.

This race for speed has manifested itself in many fascinating ways, and is a big part of the reason why quantitative trading is so interesting to me. We now have high frequency traders who work to find micro-patterns in book pressure for stocks, hedge funds which use satellites to track the number of cars in retail store parking lots, shortwave traders who use cell towers in Chicago to send and receive prices from London and Frankfurt, and even traders who are making transactions through a blockchain-derived distributed ledger system. My research on quant finance this year has given me insight into the many strategies used for attaining max efficiency (lowest latency possible) in trading. For instance, the company which is most invested in shortwave trading is actually Jump Trading, and I interviewed an engineer at Jump Trading earlier this year. I think this research is well reasoned too, considering how crucial speed is in this field.

The race for speed, much like many other walks of life, tends to follow a recurring cyclical pattern: First there’s a new breakthrough, often technological, which opens a floodgate of new opportunities (There was the carrier pigeon, then there were cars, then planes, and now the internet). This new breakthrough becomes the nexus of profit until the market becomes too saturated with competition. The new technology starts to lose its edge as competitors catch up (speed is only relative, and if others are travelling the same speed as you, you’re no longer going fast). This can be called a ceiling, and this ceiling will continue to impede progress until a new breakthrough is made. The amazing part of this cyclical phenomenon is that it is entirely logical: More competition leads to more research in hopes to beat the competition, which leads to more breakthroughs.

Cyclicality appears everywhere in life, and is the reason why clocks go in circles.

People love to speculate about what the next breakthrough will be, and over the past couple years, quantum physics (or quantum computing or quantum mechanics, just slightly different variations of the same concepts) has received a lot of this spotlight for good reason. Quantum physics has been studied and recognized for while, with Max Planck, Erwin Schrodinger and Werner Heisenberg laying the groundwork at the start of the 20th century. Recently though people have speculated that the laws of quantum physics, which I have been trying to understand through Terry Rudolph’s Q is for Quantum, can be applied to produce much more efficient computing systems. The general idea behind all of this is that normal computers use binary digits (bits) which are always either 0 or 1, whereas quantum computers would use quantum digits (qubits) which can exist in two states at the same time, allowing for four basic units of computation as opposed to two (00, 01, 10, 11). With more basic units, quantum computers would be able to do certain massive calculations which are unattainable with normal computers (for instance, breaking RSA encryption).

Are you starting to see where this is going? Of course, the people on Wall Street immediately associated these technological advancements with money. If quantum computers can really offer such a massive speed advantage over traditional computers, it is worth looking at their potential applications in finance. I did not plan to fully grasp the intricacies of quantum mechanics through Terry Rudolph’s book, but I did want to get informed. After all, if this really is the future of computing (and I’m sold), then it’s worth getting on board now.

The race for speed on Wall Street continues with quantum mechanics.

So, what did I learn from Q is for Quantum by Terry Rudolph?

The book is purposefully simplified, and the specific scientific terms are never explicitly mentioned. Instead, the book is written as a series of thought puzzles which are explained and solved through quantum physics. The first thought puzzle goes as follows:

Visualization of a Pete Box, taken from Terry Rudolph’s book.

A Pete Box is a box which can take either a black ball or a white ball as an input. The Pete Box then outputs a ball of random color, either white or black, but there is no discernible pattern to predict which color will come out. In other words, it’s truly random and unpredictable. So how would such a box work?

This problem sounds simple, but it is actually impossible to solve when thinking about it in normal computing terms. Terry Rudolph then goes on to explain that using quantum mechanics, we can actually create a machine which can do this (I won’t explain how to avoid spoilers, and also he explains it better than I can).

After reading and reflecting upon the whole book, I identified three main overarching lessons which I learned. Here’s a list of them, and I’ll go into each one in detail:

The misty state of a white ball.
  1. Superposition: I’ve already begun to explain this, but the idea is that particles can exist in multiple states at the same time. It is said that these states are superimposed on one another, and the particle lives in all these states simultaneously until it comes into contact with another entity (like a human trying to see the particle, at which point it collapses into a single state while ignoring all the other states it was in). Superposition is probably the most crucial concept to understand if you want to understand quantum computers. So a single electron can be both spin-up and spin-down at exactly the same time, until it is interfered with. Terry Rudolph refers to a superposition of states as a “misty state”, and this is visualized through the figure above.
  2. Entanglement: This one is actually super crazy and I still don’t fully grasp how it works. From how I see it, superposition and quantum states are more essential to the idea of building a useful quantum computer. Quantum entanglement is the idea that two entities can be linked together no matter what the physical distance in between them. If an electron is spin-up in one end of the room, a different electron entangled with this electron will guaranteed be spin-down when you measure its spin, even if it is on the opposite end of the room. This, more fundamentally, goes back to the idea of misty states: These two electrons are the product of the same misty state, and their misty state cannot be reduced or simplified to a more basic misty state. So, the real states of the two electrons are co-dependent on one another, going back to their single misty state from where they originate.
  3. Quantum Computers: The whole reason we’re learning about quantum mechanics! Using the concept of superposition and multiple coexisting states, we can theoretically build computers which use quantum digits as basic units of calculation. A quantum digit, or a qubit, contains twice as much information in two digits than two binary digits (00, 01, 10, 11 vs. 0, 1), so every n qubits can represent 2^n pieces of information. This superposition would allow a quantum computer to vastly outperform normal computers for brute force tasks, like factoring massive integers.

Finally, I think the concept behind the book is fascinating; Terry Rudolph believes that quantum mechanics can (and should be) taught to all middle/high school students. Traditionally, quantum physics are a subdivision of physics which are only taught to high-achieving college students, usually at a graduate level. But in reality, these concepts of entanglement and multiple states are nothing spectacularly complex. It’s easy to think about how an electron can either spin up or spin down. For me, the hard part is wrapping my head around the fact that on a tiny scale, single entities can exist in multiple states at the same time.

This is crazy to think about, because it challenges so many preconceived notions we have about the world and our reality. MIT Technology Review recently published a study which proved that a photon with superimposed polarizations can be perceived two different ways, depending on who is looking and at what time. Essentially, the photon can either be polarized vertically or horizontally, emitting either a vertical or horizontal ray of light. The concept of quantum superposition claims that the photon exists in both these polarized states at the same time, and this was proved when two viewers observed the photon’s light and recorded different observations.

If you’re interested in my philosophical and speculative take on the implications of these ‘multiple realities’, you should check out my new website for abstract thought (it’s a work in progress A.T.M but it should be public soon, and it should also be a refreshing shift away from STEM and finance).

The whole field of quantum mechanics is vast and there’s so many other interesting things to talk about, but for now I’ll leave that to the physicists. To avoid going off an infinite tangent, we should consider our initial question, which is how quantum computing can play a role in improving trading strategies.

The main idea behind this is speed: Quantum computers, if feasible, would be able to do ‘brute-force’ problems much, much faster than normal computers because qubits allow for twice as many units of computation than normal binary computers.

Chemists and drug manufacturers have reported that quantum computers could be used to calculate all the different possible chemical reactions set off by a new drug, a facet of quantum chemistry. This goes back to the idea of how a single qubit can represent two different states, therefore n qubits can represent 2^n different states. With a decently large amount of qubits working together, you could encapsulate all the different states that a molecule can be in before, during, after a chemical interaction. This would allow chemists to observe which drugs yield the most desired results by comparing their potential outcomes (and the outcomes of those outcomes, and so on), as represented through the superimposed (misty) qubit states.

Using this same logic, quantum computers could be used to analyze and compare all the possible outcomes after an event in the stock market. In chess, AI has already been trained to compare every possible move in a match and to choose the best one. This is impossible to do with stocks using normal computers because there’s too many factors and outcomes to consider and cross analyze. However, with the power of qubits and superposition, we could analyze all of these possible scenarios in a matter of minutes, even seconds. The misty states which Terry Rudolph talks about are really just possible states for a stock to exist in (+1.2%, -0.3%, -2.5%, 5.2%), and large misty states encompass many possible states.

Another more far-fetched application would be to use the power of entanglement for high frequency trading. Entanglement says that the state of an entity will directly affect the state of its entangled entity near instantaneously, no matter how far apart these entities are. This has allowed physicists to successfully experiment with teleportation (on a tiny scale though, don’t get too hyped!). The concept of entanglement could then also be used to immediately transfer data like stock prices, through entangled quantum computers at different locations.

Finally, there are quantum neural networks being designed, which could be used to enhance the self-learning mechanisms in trading algorithms. This is one of the newer developments, and I will write more about this once I have the time to do adequate research.

In the end, you must remember that quantum computers are not better for every computational task than traditional computers! Quantum computers are no faster than normal computers for simple operations, and even some complex ones. The true power of quantum computers lies in large calculations with many factors (brute force problems like factoring, cross-analysis, matrix multiplication, etc…). As I have learned through my research on quant finance, the stock market is a place full of ever-growing data and plethora of signals/indicators. With that in mind, it is starting to make a lot more sense why Wall Street is so keen about getting their hands on a universal quantum computer.

Leave a Reply

Your email address will not be published. Required fields are marked *