Quantum topological crash detection
Abstract
Persistent homology can read structural change in a financial time series that a price chart alone does not show. We embed market data into point clouds, estimate Betti numbers with classical solvers and with quantum phase estimation, and show that spikes in β₀ line up with crash regimes — then train a simple LSTM on those topological features.
A crash is easy to see after the fact: prices fall, volatility jumps, headlines follow. The harder question is whether the shape of the market — how the recent past sits relative to itself — changes before or during that collapse in a way a single price series does not make obvious.
This note is a walkthrough of a pipeline from collaborative work with Saleh Naghdi, Lukas Rapp, Steven Su, and Helena Brittain (2024). The idea is classical topological data analysis (TDA) on time-delay embeddings of the S&P 500 around 2008, with a quantum phase-estimation (QPE) route for estimating Betti numbers, and a small LSTM that classifies crash severity from topological features.[1][2]
Markets are paths. Topology asks what those paths look like as clouds — and when the cloud’s connectivity breaks.
From a price series to a point cloud
Start with a scalar series . Takens’ embedding theorem says that, under mild conditions, the dynamics can be reconstructed in an -dimensional space by stacking delayed samples:
A sliding window of length then turns the long trajectory into a sequence of local point clouds
with roughly windows. We used , , on crisis-era S&P data: small enough to run, large enough that each window still carries a short dynamical fingerprint.
Two nearby embedded points are connected when their Euclidean distance is below a resolution . That rule builds a Vietoris–Rips complex — the combinatorial object whose holes and components we will count.[3]
Betti numbers as market descriptors
On a simplicial complex , the -th Betti number counts independent -dimensional holes: is the number of connected components, the number of independent loops, and so on. Equivalently, if is the combinatorial Laplacian at dimension ,
As grows, components merge and falls; loops can appear and disappear. Plotting gives a Betti curve. Doing the same for every time window gives a Betti time series — a topological movie of the market.
Classically, persistence packages (for example Ripser / GUDHI) compute these numbers directly from the complex.[3] In our runs at fixed , rose sharply in windows that overlapped fragmented, crisis-like regimes, while and moved more modestly. That is the empirical hook: connected-component count tracks market fragmentation.
Where the quantum step enters
Betti estimation reduces to counting zero eigenvalues of . Quantum phase estimation can probe that spectrum when the Laplacian is packaged as a unitary.[4]
The practical pipeline is:
- Build the Rips complex at a chosen and extract boundary operators .
- Form .
- Pad and rescale to a Hermitian whose dimension is a power of two (needed for a clean qubit register).
- Implement (or a closely related phase convention) and run QPE on a maximally mixed state over the target register.
- The probability of measuring phase estimates the fraction of zero eigenvalues:
where is the number of qubits in the padded space.
On the problem sizes we could simulate, QPE tracked the classical Betti estimates within sampling error. That does not mean “quantum advantage for crash detection” today — the complexes are still tiny by market-data standards — but it does mean the topological observable is the same object on both sides of the classical/quantum cut.
Precision qubits in the embedding stage also matter: continuous distances must be discretized before state preparation, so quantum granularity and classical are coupled design choices, not independent knobs.
From Betti curves to crash spikes
A single Betti curve is a shape. Crash detection needs a change of shape. We compare successive curves with an distance — for a difference vector ,
and plot that scalar over time. Spikes mark windows where the topology jumped. Empirically, large jumps aligned with known stress periods in the 2008 sample; alone already carried most of the signal.
A complementary scalar is relative deviation from a moving average of price,
which we used both as a sanity check against the topological spikes and as a label source for supervised learning.
LSTMTopology: classifying severity
Topology gives features; we still wanted a classifier. LSTMTopology is a small PyTorch Lightning module: a multi-layer LSTM over topological (and deviation) features, a linear head, dropout, and weighted multiclass precision. Labels come from deviation thresholds at three horizons (, , ), producing small / medium / large crash tags when successive thresholds are crossed.
This is deliberately boring ML on purpose. The claim is not that LSTMs invent crashes; it is that Betti-derived features are informative enough for a standard sequence model to separate regimes that price-only baselines treat as generic volatility.
What we actually saw
On October 2008 S&P windows, price chopped between roughly the high 800s and high 900s with the usual crisis whiplash. Against that backdrop:
- falls as grows — components merge — with the steepest drops marking the scales where the cloud’s connectivity reorganizes.
- Error bars on across samples are largest in the transitional band (around – in our units), exactly where merges happen.
- In time, shows isolated spikes (one clear example near in a short exploratory run) that coincide with structural breaks rather than every noisy tick.
- Classical persistence and QPE estimates agree closely enough that disagreements look like finite-shot noise, not a different topological theory.
None of this replaces econometrics. It adds a geometric vocabulary: crashes as changes in connectivity of the reconstructed state space.
Limits, honestly
The present pipeline is a research sketch, not a trading system. Window parameters are hand-chosen; QPE is simulated on padded Laplacians that fit in classical linear algebra; transaction costs, microstructure, and look-ahead in label design are out of scope. Higher Betti numbers (, ) were weaker signals here — useful context, not the main alarm.
Still, the through-line is clean enough to state in one sentence: embed the market, read its holes, watch when the hole-count jumps — and optionally estimate that count with the same linear-algebra story quantum phase estimation already knows how to tell.
Takeaway
Topological crash detection is not mysticism about “quantum finance.” It is persistent homology on Takens embeddings, with as an early structural indicator, QPE as an alternate estimator of , and a lightweight LSTM as a sanity check that the features carry label information. If the price series is the score, the Betti curve is a reading of the harmony changes — and crashes are among the loudest key changes the market plays.
References
- [1]F. Takens. Detecting strange attractors in turbulence. Lecture Notes in Mathematics 898, Springer, 1981.
- [2]H. Edelsbrunner, D. Letscher, and A. Zomorodian. Topological persistence and simplification. Discrete Comput. Geom. 28, 511, 2002.
- [3]The GUDHI Project. GUDHI User and Reference Manual. https://gudhi.inria.fr/doc/latest/, 2024.
- [4]M. A. Nielsen and I. L. Chuang. Quantum Computation and Quantum Information. Cambridge University Press, 10th anniversary ed., 2010.


