今日已更新 331 条资讯 | 累计 41105 条内容
关于我们

I replaced a GNN's message function with a 4-qubit quantum circuit

Lluis Estape 2026年09月09日 14:37 2 次阅读 来源:Dev.to

A build log on QTGNN v2, what happens when the message function in a graph attention network is a variational quantum circuit instead of a matrix multiply. Not investment advice. This is a machine learning experiment. Nothing here is a trading system, I make no performance claims, and the limitations section at the end is the most important part of the post. The idea in one sentence A graph neural network passes messages along edges. Normally that message function is a learned linear map. I made it a 4-qubit variational quantum circuit and pointed the whole thing at a graph whose nodes are stocks and whose edges are rolling price correlations. Why a graph at all Most price prediction models treat each ticker in isolation: feed in AAPL's history, predict AAPL's next move. That throws away the thing every trader knows: assets move together. NVDA and META are not independent draws, and neither are JPM and GS. That relational structure is exactly what GNNs are for. So the 10 tickers become nodes in a fully-connected directed graph, and the edge weight w_ij is the Pearson correlation over a rolling 30-day window of normalised closing prices. The rolling window is what makes this interesting rather than decorative: the graph is dynamic . Connectivity changes at every timestep, so the model sees the market's structure shift between regimes rather than assuming one fixed correlation matrix for two years of history. The universe is 10 S&P 500 names across 5 sectors: AAPL, MSFT, GOOGL, NVDA and META in tech, JPM and GS in finance, JNJ in health, XOM in energy, AMZN in consumer. Roughly 500 trading days of OHLCV from yfinance . Price and volume are Min-Max normalised separately per ticker , because volume's raw magnitude would otherwise dominate price entirely. What each node knows Every node carries a 31-dimensional feature vector at every timestep, assembled from four sources: Temporal (GRU). A Gated Recurrent Unit reads the last SEQ_LEN = 10 trading days of price and volume

本文内容来源于互联网,版权归原作者所有
查看原文