---
title: 'BDG-RNN: Graph RNN for Quantum Chemistry'
url: https://www.emergentmind.com/topics/bounded-degree-graph-recurrent-neural-network-bdg-rnn
type: topic
---

# BDG-RNN: Graph RNN for Quantum Chemistry

Searching arXiv for the cited BDG-RNN and related graph-recurrent work to ground the article in the referenced papers.
Bounded-degree graph recurrent neural network (BDG-RNN) is a graph-structured recurrent neural network wavefunction ansatz introduced for neural network quantum states in quantum chemistry, in which hidden-state propagation is performed on a bounded-degree directed acyclic graph over orbitals rather than on a purely one-dimensional recurrence [2507.19276]. It generalizes the MPS-RNN family by allowing each orbital or site to receive recurrent information from multiple graph neighbors, and it was introduced to address initialization sensitivity, the need for stronger inductive bias and expressivity for graph-like orbital correlations, and the cost of local-energy evaluation in variational Monte Carlo (VMC). In a broader graph-learning sense, the distance-ordered recurrent encoding used in Graph Recurrent Encoding by Distance (GRED) is a closely related BDG-RNN-style construction: the graph is reduced to a bounded recurrent input indexed by hop distance, and recurrence becomes the main long-range aggregation mechanism [2312.01538].

## 1. Problem setting and design rationale

The motivation for BDG-RNN is tied to the limitations of standard neural network quantum states (NQS) in molecular electronic structure. The relevant difficulties are stated in three parts: initialization sensitivity, the need for stronger inductive bias and expressivity, and the high cost of local-energy evaluation. NQS are described as very flexible and, without physical constraints, highly sensitive to parameter initialization; this is especially problematic for large strongly correlated molecules, where random initialization can make optimization unstable or inefficient. Molecular systems can also exhibit complicated entanglement patterns beyond simple linear or 2D locality, so a generic NQS may not encode the physical structure of molecular orbitals well. In addition, local-energy evaluation dominates runtime in VMC, and for *ab initio* Hamiltonians the number of nonzero Hamiltonian couplings scales badly, making repeated computation of $\Psi(m)/\Psi(n)$ expensive [2507.19276].

Tensor network states provide the immediate background. MPS is physically motivated and easier to initialize, but it is naturally 1D; molecular orbitals are not inherently 1D, and a 1D chain can be a poor representation of the true orbital entanglement graph. Even with orbital reordering, MPS may need very large bond dimensions $\chi$ to represent strongly correlated molecules, and 2D generalizations still may not match molecular connectivity. BDG-RNN is therefore introduced to address three issues simultaneously: initialization, because it can be initialized from MPS parameters like MPS-RNN; expressivity, because it adds graph-based recurrent updates and optional tensor terms; and graph-based molecular structure handling, because it uses a bounded-degree directed acyclic graph built from orbital interactions.

A plausible implication is that BDG-RNN should be understood less as a generic sequence model applied to chemistry and more as a structured hybrid between tensor-network reasoning and graph-based recurrence. The bounded-degree constraint is central here: it keeps the architecture controlled and computationally manageable while still allowing nonlocal graph connectivity beyond a simple chain.

## 2. Graph construction and recurrent update rule

BDG-RNN is defined as a graph-generalized extension of MPS-RNN. The 1D MPS-RNN memory update is recalled as
$$
h_t^{n_t} = M_{t-1}^{n_t} h_{t-1}^{n_{t-1}^\circ} + v_t^{n_t},
$$
where $h_t^{n_t}\in \mathbb{R}^\chi$ or $\mathbb{C}^\chi$, $M_{t-1}^{n_t}$ is a $\chi\times\chi$ matrix, and $v_t^{n_t}$ is a vector. The phase is computed by
$$
\phi_t = \arg\!\left((w_t)^T h_t^{n_t^\circ} + c_t\right), \qquad \phi(n)=\sum_t \phi_t.
$$
For 2D MPS-RNN, the update includes horizontal and vertical incoming memory contributions. BDG-RNN then generalizes this idea from chain or grid neighborhoods to a molecular orbital graph [2507.19276].

The graph is built in two stages. First, orbital ordering is obtained by Fiedler ordering based on the exchange integral
$$
K_{ij} = [ij|ji].
$$
Second, a directed acyclic graph with bounded out-degree is constructed. The initial graph is built with a maximum out-degree constraint $k=1$ excluding sources and sinks, and then edges are added greedily until the maximum out-degree $k$ is reached. The resulting modified graph $G'$ has the bounded-degree property that each node has at most $k$ outgoing edges.

For a vertex $v_i$, with neighborhood $\mathcal{N}(i)$, the BDG-RNN memory cell is defined by
$$
h_i^{n_i} = \operatorname{RNN}\!\left(\{h_\alpha^{n_\alpha^\circ}\}_{\alpha\in\mathcal{N}(i)}\right)
= \sum_{\alpha\in\mathcal{N}(i)} M_{i\alpha}^{n_i} h_\alpha^{n_\alpha^\circ}
+ T_{i\alpha\beta\cdots\gamma}^{n_i}
\underbrace{h_\alpha^{n_\alpha^\circ} h_\beta^{n_\beta^\circ}\cdots h_\gamma^{n_\gamma^\circ}}_{d\ \text{items}}
+ v_i^{n_i}.
$$
Here, $M_{i\alpha}^{n_i}$ is a matrix for each directed edge $v_\alpha \to v_i$, $T_{i\alpha\beta\cdots\gamma}^{n_i}$ is a higher-order tensor term, $d$ is the in-degree of vertex $i$, and $v_i^{n_i}$ is a local bias or vector term.

This recurrence is the defining mechanism of BDG-RNN. A site update uses incoming hidden states from graph neighbors, plus optional higher-order multiplicative interactions. Relative to standard sequential RNN-NQS, the change is structural rather than merely parametric: correlations are no longer encoded through a single recurrent path but through a bounded-degree graph over orbitals.

## 3. Wavefunction parametrization, VMC objective, and sampling

The underlying physical model is the standard second-quantized electronic Hamiltonian
$$
\hat{H} = \sum_{pq} h_{pq}\hat a_p^\dagger \hat a_q + \frac{1}{4}\sum_{pqrs} \langle pq\|rs\rangle \hat a_p^\dagger \hat a_q^\dagger \hat a_s \hat a_r.
$$
For a trial state $\Psi_\theta$,
$$
E_\theta = \frac{\langle \Psi_\theta|\hat H|\Psi_\theta\rangle}{\langle \Psi_\theta|\Psi_\theta\rangle}
= \langle E_{\rm loc}(n)\rangle_{n\sim P_\theta(n)},
$$
with
$$
P_\theta(n)=\frac{|\Psi_\theta(n)|^2}{\sum_n |\Psi_\theta(n)|^2},
\qquad
E_{\rm loc}(n)=\sum_m H_{nm}\frac{\Psi_\theta(m)}{\Psi_\theta(n)}.
$$
The energy gradient is
$$
\partial_\theta E_\theta =
2\Re\Big[
\big\langle (\partial_\theta \ln \Psi_\theta^*(n)) (E_{\rm loc}(n)-\langle E\rangle) \big\rangle_{n\sim P_\theta(n)}
\Big].
$$
These are the VMC relations within which BDG-RNN is optimized [2507.19276].

The generic RNN wavefunction is written as
$$
\Psi(n) = \left(\prod_t \sqrt{P(n_t\mid n_{<t}^\circ)}\right)e^{i\phi(n)},
$$
where $\phi(n)$ is the phase and the conditional probabilities are generated from the hidden state $h_t$. BDG-RNN uses the same general autoregressive amplitude and phase factorization as MPS-RNN, and the amplitude $\sqrt{P_t}$ and phase $\phi_t$ keep the same computational structure as vanilla MPS-RNN.

Training proceeds by standard VMC: sample occupation-number vectors according to $|\Psi_\theta(n)|^2$, estimate the local energy, compute gradients, and update parameters using AdamW with
$$
\beta_1 = 0.9,\qquad \beta_2 = 0.999.
$$
A key practical feature is initialization from MPS parameters generated from the Focus package, which is explicitly used to avoid the optimization difficulty associated with random initialization. For sampling, BDG-RNN autoregressive sampling is implemented with a hybrid DFS/BFS strategy to avoid out-of-memory issues. The model also supports particle-number conservation and spin-projection conservation; these are enforced during autoregressive sampling by modifying conditional probabilities so that forbidden occupations get probability $0$ and forced occupations get probability $1$.

The paper does not present these constraints as optional cosmetic additions. They are part of the reason BDG-RNN functions as a chemistry-oriented wavefunction ansatz rather than as a conventional graph predictor.

## 4. Variants, tensor hybridization, and correlator extensions

Two closely related architectures are defined. **BDG-RNN** retains only the matrix-based graph recurrence terms, whereas **BDG-TensorRNN** includes both the matrix terms and the tensor term $T$, increasing expressive power at higher computational cost [2507.19276].

The tensor term is potentially expensive, because a naive
$$
T_{i\alpha\beta\cdots\gamma}^{n_i}
$$
requires $\mathcal{O}(\chi^d)$ parameters. To reduce this cost, Tucker decomposition is used:
$$
T_{i\alpha\beta\cdots\gamma}^{n_i}
=
U_{i'\alpha'\beta'\cdots\gamma'}^{n_i}
K_{ii'} K_{\alpha\alpha'} K_{\beta\beta'} \cdots K_{\gamma\gamma'}.
$$
Here, $U$ is a rank-$(d+1)$ core tensor of shape $(\chi',\dots,\chi')$, and each $K$ is a factor matrix of shape $(\chi,\chi')$. The choice
$$
\chi'=\left\lceil \chi^{2/(d+1)} \right\rceil
$$
reduces the scaling from $\mathcal{O}(\chi^d)$ to
$$
\mathcal{O}(d\chi\chi' + \chi'^d).
$$

The same framework is further extended by RBM-inspired correlators. The normalized NQS $\Phi(n)$ is wrapped by an additional factor $f_n$:
$$
|\Psi_\theta\rangle = \sum_n f_n \Phi(n)|n\rangle, \qquad \sum_n |\Phi(n)|^2 = 1.
$$
Two correlators are defined. The **cos-RBM** is
$$
f_{\text{cos-RBM}}(n) = \prod_{k=1}^{N_h} \cos\!\left( b_k + \sum_{i=1}^{N_v} W_{ki} n_i \right),
$$
and the **Ising-RBM** is
$$
f_{\text{Ising-RBM}}(n) = \prod_{k=1}^{N_h} \cos\!\left( b_k + \sum_{i=1}^{N_v} W_{ki}^{(1)} n_i + \frac{1}{2}\sum_{i,j=1}^{N_v} W_{kij}^{(2)} n_i n_j \right).
$$
Their parameter scaling is $\mathcal{O}(\alpha K^2)$ for cos-RBM and $\mathcal{O}(\alpha K^3)$ for Ising-RBM, where $\alpha = N_h/N_v$.

In the paper’s formulation, RBM is not the primary ansatz. The main wavefunction remains BDG-RNN or BDG-TensorRNN, and the correlator acts as an augmenting multiplicative factor to further enhance expressivity and improve accuracy without dramatically modifying the underlying VMC optimization framework.

## 5. Semistochastic local energy and implementation framework

Local-energy evaluation is identified as the computational bottleneck. To reduce its cost, the paper introduces a semistochastic estimator. The exact local energy
$$
E_{\rm loc}(n)=\sum_m H_{nm}\frac{\Psi_\theta(m)}{\Psi_\theta(n)}
$$
is decomposed into a deterministic part for matrix elements with $|H_{nm}|\ge \epsilon$ and a stochastic part for the remaining smaller couplings [2507.19276].

The deterministic part is
$$
E_{\rm loc}^{\rm d}(n,\epsilon) =
\sum_{\{|H_{nm}|\ge \epsilon\}} H_{nm}\frac{\Psi_\theta(m)}{\Psi_\theta(n)}.
$$
For the stochastic part, $m'$ is sampled from
$$
P_n(m')\propto |H_{nm'}|, \qquad |H_{nm'}|<\epsilon,
$$
and estimated by
$$
E_{\rm loc}^{\rm s}(n,\epsilon,N_\epsilon) =
\Big\langle
\frac{H_{nm'}}{P_n(m')}
\frac{\Psi_\theta(m')}{\Psi_\theta(n)}
\Big\rangle_{m'\sim P_n}.
$$
The total estimator is then
$$
E_{\rm loc}(n,\epsilon,N_\epsilon) =
E_{\rm loc}^{\rm d}(n,\epsilon) + E_{\rm loc}^{\rm s}(n,\epsilon,N_\epsilon).
$$
This estimator is stated to be unbiased, and it becomes exact as $\epsilon\to 0$ or $N_\epsilon\to\infty$.

The implementation is in the open-source package PyNQS, based on PyTorch. PyNQS supports BDG-RNN, RBM, Transformers, and easy addition of new ansätze. The reported work uses double precision ($\text{float64}$), while single precision ($\text{float32}$) is also supported. Molecular integrals are obtained with PySCF, MPS initialization is generated with the Focus package, and Hamiltonian matrix elements are evaluated via Slater–Condon rules and GPU bitwise operations.

This computational stack is not incidental to the method’s presentation. The semistochastic estimator and the implementation framework are treated as necessary enablers for practical large-scale VMC with graph-structured recurrent ansätze.

## 6. Empirical behavior on benchmark molecular systems

The paper evaluates BDG-RNN on three systems and uses these experiments to characterize both accuracy and efficiency [2507.19276].

**One-dimensional hydrogen chain $\ce{H50}$** is studied at bond length $R=2.0\,a_0$ in the STO-6G basis with orthonormalized atomic orbitals and an exact benchmark. For $\bdgrnn{1}$ with $\chi=10$, the paper tests various $\epsilon$ and $N_\epsilon$, chooses $\epsilon=0.01$ and $N_\epsilon=100$, reports that computational cost drops to about **0.05%** of the original method, and describes an about **2000-fold speedup**. For chain lengths $\ce{H16}$, $\ce{H32}$, and $\ce{H48}$, exact local energy scales as $\mathcal{O}(K^5)$, whereas semistochastic evaluation reduces this to approximately $\mathcal{O}(K^2)$. In accuracy terms, $\bdgrnn{1}$ improves over MPS at the same $\chi$; $\bdgrnn{1}$ at $\chi=30$ yields an energy error of about **0.6 mHa**, while MPS needs $\chi>50$ to reach similar accuracy. Adding cos-RBM with $\alpha=2$ and partial initialization from optimized BDG-RNN reduces the error to **0.2 mHa**, and for $\bdgrnn{1}(\chi=20)$ with cos-RBM the result is near chemical accuracy.

**The iron–sulfur cluster $\ce{[Fe2S2(SCH3)4]^{2-}}$** is studied in CAS$(30e,20o)$ with entanglement-minimized orbitals and an exact reference energy from previous literature. For $\bdgrnn{1}$ with $\chi=50$, the paper chooses $\epsilon=0.01$ and $N_\epsilon=1000$ and reports about an **order-of-magnitude cost reduction**. In terms of ansatz quality, $\bdgrnn{1}$ beats standard MPS at the same $\chi$; at $\chi=200$, $\bdgrnn{1}$ reaches **chemical accuracy**, while MPS needs roughly $\chi=400$ for comparable accuracy. $\bdgrnn{2}$ slightly improves over $\bdgrnn{1}$. The correlators further improve results: cos-RBM with $\alpha=2$ gives about **1.7 mHa** error at $\chi=100$ and about **1.1 mHa** error at $\chi=200$, while Ising-RBM performs even better and reaches **chemical accuracy at $\chi=100$**.

**The three-dimensional hydrogen cluster $\ce{H18}$** in a $3\times 3\times 2$ geometry is studied at interatomic distance $4.0\,a_0$ in the STO-3G basis, with orbital ordering via Fiedler ordering and $\bdgrnn{k}$ for $k\le 3$. For $\bdgrnn{3}$ with $\chi=100$, the paper chooses $\epsilon=0.01$ and $N_\epsilon=100$, reports around **80-fold speedup**, and states that the error is below **0.1 mHa**. On top of $\bdgrnn{3}$ with $\chi=40$, cos-RBM, Ising-RBM, Jastrow, and MLP-like correlators all improve accuracy, with **Ising-RBM is best**. Increasing $\alpha$ reduces error slightly, and for $\alpha=16$, cos-RBM and Ising-RBM nearly coincide. The topology study is especially central: MPS converges slowly and needs $\chi>500$ for chemical accuracy; $\bdgrnn{1}$ is better than MPS but still converges slowly; $\bdgrnn{2}$ and $\bdgrnn{3}$ converge faster; and $\bdgrnn{3}$ reaches about **1.1 mHa** error at $\chi=250$, i.e. chemical accuracy. The paper also tests **BDG(2)-TensorRNN**, which achieves accuracy comparable to $\bdgrnn{3}$ at $\chi=250$, but with a much smaller bond dimension $\chi=100$ and fewer variational parameters.

Taken together, these results are used to support three claims internal to the paper: BDG-RNN is better than MPS at fixed bond dimension, graph topology matters for molecular structure, and tensor-term hybridization can compensate for lower graph degree.

## 7. Relation to adjacent methods, terminology, and limitations

Within neural quantum states, BDG-RNN differs from standard RNN-NQS by using a graph rather than only a chain, allowing multiple neighbors and non-adjacent orbital couplings, and optionally including higher-order tensor interactions. Relative to MPS and MPS-RNN, the stated narrative is that BDG-RNN keeps the MPS-like initialization and recurrent structure but improves over MPS by enabling graph-based nonlocal interactions. Relative to RBM-based ansatzes, the strategy is to use BDG-RNN as the main wavefunction and then multiply it by an RBM-inspired correlator to boost expressivity while keeping sampling and training compatible with VMC. The paper also explicitly notes that BDG-RNN is not framed as a standard graph neural network: it is a quantum wavefunction ansatz, its output must define a normalized amplitude and phase for a many-body state, it is integrated into autoregressive sampling and VMC, and it uses tensor-network-inspired memory updates with optional Tucker-compressed higher-order terms [2507.19276].

The term “BDG-RNN” also admits a broader architectural reading in graph representation learning. The GRED model in “Recurrent Distance Filtering for Graph Representation Learning” is described as a very natural example of a bounded-degree graph recurrent neural network, although the paper names the architecture Graph Recurrent Encoding by Distance and the key mechanism Recurrent Distance Filtering. There, the graph-to-sequence reduction constructs a bounded-length distance sequence for each target, and a recurrent model encodes that sequence; the boundedness comes from the maximum hop $K$, which is a fixed hyperparameter or the graph diameter. In that sense, the architecture is a recurrent neural network operating over graph-derived sequences of bounded length, with recurrence used as the main long-range aggregator. The paper adds an important terminological qualification: in that setting, the “degree” is not node degree in the usual adjacency sense but the number of hop groups processed per target node [2312.01538].

The limitations acknowledged for the chemistry BDG-RNN are also explicit. Large-scale strongly correlated systems still require further improvements; memory and cost remain significant; more symmetry exploitation and mixed-precision schemes would help; advanced optimizers such as minimum-step stochastic reconfiguration may accelerate training; and further development of the PyNQS framework is suggested. This suggests that BDG-RNN is presented not as a closed solution to molecular NQS design, but as a structured and extensible ansatz family that connects MPS initialization, graph-based recurrence, correlator augmentation, and semistochastic VMC into a single framework.

Source: https://www.emergentmind.com/topics/bounded-degree-graph-recurrent-neural-network-bdg-rnn