CTQWformer: Quantum Walk Transformer
- The paper introduces CTQWformer, a novel graph classification framework that integrates trainable continuous-time quantum walks with Transformer and recurrent modules.
- It employs a learnable Hamiltonian that generates CTQW propagation signals used both as static biases in self-attention and dynamic inputs in a BiGRU for temporal modeling.
- Ablation studies demonstrate that the temporal evolution component is crucial for improving classification accuracy, despite the high computational cost of CTQW simulation.
Searching arXiv for the CTQWformer paper and closely related references to ground the article. Search query: CTQWformer continuous-time quantum walks transformer graph classification arXiv (Li et al., 10 May 2026) CTQWformer is a graph classification architecture that combines continuous-time quantum walks (CTQW) with Transformer and recurrent neural components in an end-to-end trainable framework. It is defined for a dataset of graphs , where each has node features and graph label , and the learning objective is to map each graph to its label . The model is motivated by the observation that message-passing GNNs are inherently local and that Graph Transformers, while global, often rely on simple structural encodings and usually treat graph structure statically. CTQWformer addresses both issues by making CTQW trainable and feature-aware, then using CTQW-derived signals both as a static structural bias for self-attention and as a dynamic temporal signal for recurrent modeling (Li et al., 10 May 2026).
1. Problem setting and conceptual motivation
CTQWformer is situated in graph representation learning, specifically in supervised graph classification. The stated motivation is that existing methods have complementary but incomplete strengths. Message-passing GNNs can aggregate local neighborhood information, but increasing depth to capture long-range dependencies causes over-smoothing and optimization issues. Graph Transformers provide global attention, but they often encode structure only via simple positional or structural encodings, tend to emphasize feature similarity in attention while underusing richer structural priors, and usually lack a principled mechanism for modeling dynamic propagation on graphs (Li et al., 10 May 2026).
Continuous-time quantum walks supply the missing inductive bias. In the formulation used by CTQWformer, CTQW is a physically grounded dynamic process governed by the Schrödinger equation, with constructive and destructive interference patterns that encode both local and global structure. This gives a natural mechanism for nonlocal propagation beyond small neighborhoods. The framework therefore aims to make CTQW trainable and feature-aware through a learnable Hamiltonian, then to deploy the resulting quantum-walk statistics in two complementary ways: final-time propagation probabilities become structural biases in a Graph Transformer, while time-evolving probabilities become sequential inputs for a recurrent module (Li et al., 10 May 2026).
The paper explicitly frames these design choices as a hybridization of quantum dynamics with deep graph learning. It also states that CTQWformer is, to the authors’ knowledge, the first hybrid CTQW-based Transformer integrating CTQW-derived structural bias with temporal evolution modeling for graph learning (Li et al., 10 May 2026).
2. Continuous-time quantum walk foundations and the trainable Hamiltonian
For a graph with , the Hilbert space is
where corresponds to node 0. A quantum state at time 1 is written as
2
with normalization
3
Its evolution is governed by
4
with solution
5
The probability of finding the walker at node 6 at time 7 is
8
CTQWformer departs from classical CTQW choices such as the adjacency matrix 9 or Laplacian 0 by learning a feature-aware Laplacian Hamiltonian 1 (Li et al., 10 May 2026).
The construction begins at the edge level. For each edge 2, node features are concatenated:
3
An edge-weight MLP then defines
4
where 5 is ReLU and 6 is sigmoid, ensuring 7. These weights form a weighted adjacency matrix 8. To guarantee Hermiticity, CTQWformer symmetrizes the matrix as
9
and defines the Hamiltonian as the Laplacian
0
where 1 is the degree matrix of 2 with 3 (Li et al., 10 May 2026).
This construction has three explicit properties. First, 4 is Hermitian, which guarantees unitary evolution 5. Second, it is trainable, because the parameters in the edge MLPs and the initial node embedding MLP are learned jointly with the rest of the architecture. Third, it is feature-aware, because node attributes directly modulate the effective graph operator. A plausible implication is that the induced CTQW dynamics need not coincide with purely topological propagation, but can instead encode task-relevant structural variation conditioned on attributes.
3. Architecture and data flow
CTQWformer consists of three core components: a Quantum Walk Encoder (QWE), a Quantum Walk–Graph Transformer (QWGT), and a Quantum Walk–Graph Recurrent module (QWGR). The QWE builds the trainable Hamiltonian and simulates CTQW over multiple time steps; the QWGT injects final-time CTQW propagation probabilities into self-attention as structural bias; the QWGR models temporal evolution patterns from CTQW-derived sequences with a BiGRU (Li et al., 10 May 2026).
| Component | Input | Function |
|---|---|---|
| QWE | Graph 6, node features 7 | Builds 8 and produces 9 |
| QWGT | Node embeddings, 0 | Adds CTQW structural bias to Transformer attention |
| QWGR | Time series derived from 1 | Encodes temporal evolution with a BiGRU |
The forward pipeline is specified step by step. The input graph and node features are first passed to the QWE, which constructs 2. For time steps 3, it computes the unitary
4
derives the corresponding probability matrices 5, and stacks them into an evolution tensor
6
The QWGT uses the final-time matrix 7 to build a bias matrix 8 for attention. The QWGR extracts node-specific sequences from the diagonal of 9 over time and processes them with a bidirectional GRU. The outputs of QWGT and QWGR are concatenated in a fusion layer, passed through a fusion MLP, and the resulting graph-level representation is broadcast back to nodes. Several CTQWformer layers are stacked. Final node embeddings are then globally mean pooled and sent to a classifier to predict the graph label (Li et al., 10 May 2026).
The layerwise design is notable because it couples node-level refinement with graph-level fusion. This suggests that the model does not merely append an auxiliary CTQW statistic to a standard architecture, but instead uses CTQW information to mediate iterative interaction between structural bias, dynamic evolution, and learned node embeddings.
4. CTQW-derived representations: static bias and temporal evolution
The QWE simulates CTQW for multiple initial states and multiple times. Initial states are all basis states, encoded as the columns of the identity matrix 0, so the 1-th column is the delta state 2 concentrated at node 3. For each time 4, the evolved state from initial state 5 is
6
and the node-wise propagation probabilities are
7
For a fixed 8, this yields a probability matrix 9. Across all 0 time steps, these form the evolution tensor 1, which encodes both static connectivity and dynamic patterns such as oscillations and interference (Li et al., 10 May 2026).
The QWGT uses only the final-time CTQW matrix. It first takes
2
normalizes each column to make it stochastic, and applies the element-wise transform
3
This matrix 4 is the structural bias. Standard self-attention is
5
where 6 are obtained from node representations. In QWGT, attention scores are modified by 7 before softmax. The paper notes a minor typesetting issue in the printed formula and states that the intended operation is to add 8 to the score matrix before softmax. Here, 9 reflects how strongly a walker starting at node 0 ends at node 1 at final time 2. The result is that attention is biased toward node pairs with strong CTQW connectivity, thereby fusing feature similarity through 3 with physically grounded structural relations through 4 (Li et al., 10 May 2026).
The QWGR captures the dynamic side. For each node 5, it extracts the diagonal sequence
6
which represents the probability that a walker starting at node 7 is again at node 8 at each time step. This self-return sequence is first linearly projected and then fed into a bidirectional GRU:
9
followed by
0
In the diagonal-signal interpretation, the BiGRU captures forward and backward temporal dependencies in oscillatory CTQW behavior, and mean pooling over nodes yields a graph-level dynamic representation (Li et al., 10 May 2026).
The distinction between static and dynamic CTQW features is central. QWGT uses a single final-time slice as a structural prior for attention, whereas QWGR uses the time series itself as a dynamical signature. The ablation results later reported in the paper indicate that temporal modeling is the more decisive component.
5. Training, computational profile, and benchmark results
At each CTQWformer layer 1, the model starts from node embeddings 2, computes a graph-level representation from QWGT, computes another graph-level representation from QWGR, concatenates them, and passes the result through a feed-forward fusion network to obtain a unified graph representation. This representation is then broadcast back to nodes to form 3. After 4 layers, global mean pooling produces a graph vector 5, which is passed through a classifier MLP to produce logits 6. Training uses standard cross-entropy loss,
7
and all parameters, including the Hamiltonian-generating MLPs, Transformer, BiGRU, and classifier, are learned jointly via backpropagation through differentiable matrix exponentials. The paper does not introduce explicit extra regularization terms on 8 beyond structural constraints such as symmetry and sigmoid-bounded weights (Li et al., 10 May 2026).
The dominant computational burden is CTQW simulation. Constructing the Hamiltonian costs 9 time and 0 memory. Computing 1 typically costs 2, so over 3 time steps the QWE requires 4 time and 5 space for the evolution tensor. The Transformer component contributes 6 time and 7 space, while QWGR contributes 8 time and 9 space. The overall complexity is summarized as
00
with memory
01
The paper states that for moderate or large graphs the CTQW term 02 dominates, and that no special approximation for 03 is assumed in the analysis (Li et al., 10 May 2026).
The experimental setup uses TU benchmark datasets: MUTAG, PTC(MR), PROTEINS, DD, IMDB-B, and IMDB-M. For IMDB-B and IMDB-M, which have no original node features, normalized log-degree is used as the feature; for the other datasets, normalized log-degree is appended to existing features. Training uses 10-fold cross-validation, typically 04 CTQWformer layers, 05 time steps, hidden dimension 06, dropout 07, Adam with learning rate 08, and 300 epochs with early stopping. Hyperparameters are slightly tuned per dataset, especially 09 and 10 (Li et al., 10 May 2026).
Against graph kernels, CTQWformer achieves the best performance on 5 of 6 datasets. The reported accuracies are 11 on MUTAG, 12 on PTC(MR), 13 on PROTEINS, 14 on DD, 15 on IMDB-B, and 16 on IMDB-M. The only dataset where a listed kernel is higher is IMDB-M, where HAQJSK reaches 17 (Li et al., 10 May 2026).
Against GNN and Graph Transformer baselines, the picture is mixed but favorable overall. CTQWformer is highest on MUTAG, DD, and IMDB-B; on PTC(MR) it is essentially tied with GRIT, which reports 18 versus CTQWformer’s 19; on PROTEINS it is slightly below Graphormer, which reports 20 versus 21; and on IMDB-M it is below GraphGPS and GCN. The paper characterizes the model as competitive or superior to strong GNN and graph Transformer baselines, especially on bioinformatics datasets and IMDB-B (Li et al., 10 May 2026).
Ablation studies on MUTAG, PTC(MR), and PROTEINS show that removing QWGR causes the largest drop: on MUTAG performance falls from 22 to 23, on PTC(MR) from 24 to 25, and on PROTEINS from 26 to 27. Removing QWGT also reduces performance, but less severely. The reported interpretation is that temporal modeling of CTQW evolution is crucial, while CTQW-based structural bias is beneficial but less dominant than temporal patterns. Hyperparameter sensitivity studies further indicate that moderate 28 and shallow depth work best: on MUTAG accuracy peaks at 29 and 30, while deeper settings tend to reduce performance, likely because of overfitting or over-smoothing (Li et al., 10 May 2026).
6. Interpretation, limitations, relation to prior work, and terminological ambiguity
The paper’s interpretive claim is that CTQW dynamics encode how probability amplitude propagates globally under interference, thereby revealing multi-path connectivity, spectral properties of the Laplacian-based Hamiltonian, and both local neighborhoods at early times and global structures at later times. Within CTQWformer, the static and dynamic pathways are separated analytically: QWGT uses a final-time bias matrix 31 that can be viewed as a physically meaningful connectivity prior, while QWGR models node-level temporal oscillations through self-return dynamics. The reported ablations indicate that the temporal component contributes more strongly to classification accuracy, which suggests that the dynamic signature of CTQW contains discriminative information not recoverable from a single structural snapshot (Li et al., 10 May 2026).
The architecture also has an interpretability argument. Since CTQW propagation probabilities 32 are explicit, high values of 33 indicate strong dynamic connectivity at time 34, and diagonal sequences 35 indicate how “central” or “trapped” a node is across time. The paper does not include visual case studies, but it presents these quantities as inherently interpretable physically meaningful diffusion patterns (Li et al., 10 May 2026).
The principal limitations are also explicit. Scalability is constrained by dense CTQW simulation, since the dominant term is 36. Performance is sensitive to the number of time steps 37 and layers 38, and too-large values can degrade accuracy. The trainable Hamiltonian also depends heavily on node features, and the paper suggests that this contributes to weaker performance on feature-poor datasets such as IMDB-M. Future directions proposed by the authors include more efficient approximations of 39, exploiting sparsity or low-rank structure of 40, richer integrations of quantum walk dynamics into GNNs and Transformers, and extending the framework to node classification, link prediction, and dynamic or temporal graphs (Li et al., 10 May 2026).
In relation to prior work, CTQWformer is positioned against two families. The first is quantum-inspired graph learning based on fixed CTQW kernels such as JTQK, QJSK, HAQJSK, and AERK, which use non-trainable similarity measures or separate quantum components. The second is graph Transformer work such as Graphormer, GraphGPS, and GRIT, which encode structure through shortest paths, centrality, random-walk distributions, or related priors. CTQWformer’s novelty claims are threefold: a trainable Hamiltonian 41 that combines topology and features, a hybrid CTQW-based Transformer in which final-time probabilities bias attention and temporal evolution is modeled by a BiGRU, and an end-to-end architecture that jointly learns CTQW dynamics and task-specific graph representations (Li et al., 10 May 2026).
A possible source of confusion is the term itself. Another paper, on the “convolutional transformer wave function (CTWF),” states that “CTQWformer” is not a term used in that work, but a natural label for a Convolutional Transformer Quantum Wavefunction. That usage refers to a neural quantum state architecture for lattice quantum many-body problems rather than to the CTQW-based graph-classification model described above (Chen et al., 13 Mar 2025). The overlap is therefore terminological rather than methodological. In current arXiv usage represented by these two papers, CTQWformer properly denotes the CTQW-based Transformer for graph classification, while CTWF denotes the convolutional transformer wave function model for variational quantum Monte Carlo and time-dependent variational simulations (Li et al., 10 May 2026).