We’ve seen how the quantum model of supply and demand can be used to model transactions and here we’re going to look at how we can use it to simulate the stock market.

With the quantum model supply and demand we have propensity functions for the buyer and the seller and the joint propensity function is equal to the product of those. A market maker would maximize profit if the spread between the buyer and the seller price, i.e. the distance between the two peaks, is equal to the standard deviation of the joint propensity.

This system is described by a linear entropic force but it does not behave like a classical oscillator because we know that the price is indeterminate and of course prices don’t actually oscillate. We therefore go to the quantum harmonic oscillator which is the quantum version of a spring system. The ground state is a normal distribution where the mass scales with the inverse variance. We’re going to define the frequency for the stock market in terms of turnover, so if the turnover is once per year then that will be the frequency.

One way that you can use the quantum harmonic oscillator to simulate the statistics of stock markets is to look at higher energy levels. This plot shows a tracing of the oscillations for the case where we have three energy levels. Most of the energy is in the ground state but there is also some energy in the next two energy levels.

We’re going to look at a slightly simpler version here but first of all we can compare with the actual sort of data that you get from a stock market. This plot is an order book for Apple stock over a single hour and so we’ve got the buyers putting up orders at lower prices and sellers at higher prices. These are not the same as for propensity functions because they don’t reveal all the preferences and of course orders in the middle region are going to clear so will disappear. However these orders do give an idea of the propensity functions which are shown by the shaded areas in the background.

Now, suppose that someone comes and makes a very large order and you want to know how much the price is going to change in response to that – it’s going to go up but by how much? According to the square-root law, which is an empirically derived relation from finance, the price change is given by the square-root of the size of the trade divided by the daily traded volume, all multiplied by the daily volatility, and then multiplied by a numerical constant Y of order unity.

In the oscillator model this makes sense because the restoring force is linear so the energy required to perturb the system is going to vary with the square of the displacement, or equivalently the displacement varies with the square-root of the energy. And of course the energy in a quantum harmonic oscillator is just a multiple of the frequency. When you have a large purchase that’s like boosting the frequency over that time period, which boosts the energy. Comparing these two formulas show that they’re in agreement if we have Y being of the order the square root of two. That sounds about right because in the oscillator model we’re assuming all the energy goes into lifting the price, so the actual price change might be a bit less than that.

This gives us a picture for how we could model prices in general. We can assume that we have an oscillator in its ground state, but then it’s displaced by perturbations which shift it from side to side. It is then going to oscillate in a coherent state, which means it stays in a normal distribution but it’s moving from side to side. The probability of being in a particular energy level varies with a Poisson distribution. We will assume that the spread between the bid and the ask price is equal to the standard deviation in order to maximize the profit.

So to summarise we have a normal distribution, which represents the joint propensity function, bouncing back and forth between the dashed lines in the figure. However there’s another participant in the market which is the market maker. They only transact at the particular ask/bid prices, shown by the vertical bars. We can therefore compute the probability of the ask or bid prices being selected.

If you look at the propensity for the ask price being obtained it follows a sinusoidal of plot. The dashed line is the actual result, the gray line in the background is the sinusoidal plot of the sort that you would obtain with a with a simple two-state quantum system for example. Similarly the propensity function for the bid would just be the opposite of that, so the propensity adds to one (we are assuming here that a transaction takes place at one of the prices).

Notice that for this particular setting the propensity varies from 0.25 to 0.75, so that’s plus or minus 25 percent which is consistent with the kind of shift that you might expect from the quarter law from quantum decision theory.

We can use this model to simulate stock prices. Here the squares are the ask price, circles are the bid price, and we are assuming that we have random perturbations, so unlike the previous plot the oscillations are not allowed to continue because random noise is being applied. We’re also going to have some noise added to the spread, i.e. the difference between the bid and the ask.

The noise in the spread turns out to be important because it’s a main contributor to the fat tails which you see when you look at the overall probability density for a long simulation shown here. This compares with the dash line which is the statistics for the Dow Jones Industrial Average.

To summarize, in neoclassical theory it is assumed that supply and demand cancel out in equilibrium, so there’s no concept of dynamics, force, mass, energy and so on. The quantum model in contrast is obtained by quantizing a linear entropic force. This linear restoring force is what explains the empirically derived square-root law of price impact, and the oscillator model can also be used to simulate the dynamics of stock markets such as price change distributions.

Further reading:

Orrell D (2022) Quantum oscillations in the stock market. *Wilmott* (forthcoming).

**Previous: QEF11 – The money bomb**

**Playlist: Quantum Economics and Finance**