---
title: 'PDE-NHF: Neural Hamiltonian Flow'
url: https://www.emergentmind.com/topics/pde-nhf-model
type: topic
---

# PDE-NHF: Neural Hamiltonian Flow

The PDE-NHF (Partial Differential Equation–Neural Hamiltonian Flow) model is a machine learning framework that parameterizes and learns symplectic, invertible maps representing the time evolution of particle distributions governed by kinetic Hamiltonian PDEs. In particular, it has been introduced as an efficient, interpretable surrogate for the 1D Vlasov–Poisson system, enabling fast sampling, generalization to arbitrary initial conditions, and preservation of physical invariants through its construction [2505.04471].

## 1. Mathematical Foundation: The Vlasov–Poisson System

PDE-NHF targets the 1D Vlasov–Poisson system, which describes the evolution of a phase-space probability density \(f(x, v, t)\) for collisionless particles in either plasma physics or cosmology. This system is given by
\[
\partial_t f + v \,\partial_x f + F(x, t) \,\partial_v f = 0,
\]
where the self-consistent force \(F\) derives from a potential \(\Phi\) that solves the Poisson equation:
\[
\partial_{x}^2 \Phi(x, t) = 
  \begin{cases}
     -\rho(x, t)/\varepsilon_0 & \text{(plasma)} \\
     4\pi G\,\rho(x, t) & \text{(self-gravitating)}
  \end{cases}
\]
with mass density \(\rho(x,t) = \int_{\mathbb{R}} f(x,v,t) dv\). The system conserves total mass, total momentum, and total energy. It is subject to periodic boundary conditions in \(x\) and decay of \(f\) as \(|v|\to\infty\) [2505.04471].

## 2. Hamiltonian Structure and Symplecticity

In phase-space variables \((q, p)\equiv(x,v)\), the system can be derived from the Hamiltonian
\[
H(q, p) = K(p) + V(q) = \frac{1}{2}p^2 + \Phi(q, t),
\]
with canonical equations
\[
\dot q = \frac{\partial H}{\partial p} = p, \qquad
\dot p = -\frac{\partial H}{\partial q} = -\partial_x \Phi(q, t) = F(q, t).
\]
Liouville’s theorem guarantees preservation of phase-space volume, i.e., the transformation \(\mathcal{T}^t\colon(q(0),p(0))\mapsto(q(t),p(t))\) is symplectic and volume-preserving (\(\det\partial_{(q_0,p_0)}(q(t),p(t)) = 1\)) [2505.04471].

## 3. Neural Hamiltonian Flow Architecture

PDE-NHF replaces explicit particle-in-cell (PIC) time integration with a symplectic normalizing flow. The total evolution time \(T\) is split into \(L\) equal sub-steps of size \(\delta t = T/L\), each realized by an invertible, symplectic map \(T_\ell\) based on a learned Hamiltonian \(H_\theta(q, p) = K_\theta(p) + V_\theta(q)\):
- Kinetic term: \(K_\theta(p) = \frac{a^2}{2}\sum_{j=1}^N p_j^2\) with learnable scalar \(a\approx 1\).
- Potential: \(V_\theta(\mathbf{q}) = \psi\Bigl(\sum_{j=1}^N \phi(q_j - \bar q)\Bigr)\), a DeepSet network imposing permutation and translation invariance (\(\bar q = \frac{1}{N}\sum_j q_j\)).

Each Leapfrog step computes
\[
\begin{aligned}
p^{(\ell + 1/2)}   &= p^{(\ell)} - \frac{\delta t}{2} \nabla_q V_\theta(q^{(\ell)}) \\
q^{(\ell + 1)}     &= q^{(\ell)} + \delta t\, a^2\, p^{(\ell + 1/2)} \\
p^{(\ell + 1)}     &= p^{(\ell + 1/2)} - \frac{\delta t}{2} \nabla_q V_\theta(q^{(\ell + 1)})
\end{aligned}
\]
with manifest invertibility and symplecticity (\(\det J_{T_\ell} = 1\)). The full flow over \(T\) is \(T = T_L \circ \cdots \circ T_1\) [2505.04471].

## 4. Training Objective and Data Generation

The model is trained to map an initial phase-space Gaussian \(\Pi_0^{\mathbf{x}}\) (mean and covariance \(\mathbf{x}\)) to a final empirical distribution \(\Pi_T^{\mathbf{x}}\) (from PIC) at \(t = T\). The objective is forward Kullback–Leibler divergence,
\[
\mathcal{L}(\theta) = D_{\rm KL}(\Pi_T^{\mathbf{x}}\,\Vert\,\Pi_{\theta,T}^{\mathbf{x}}),
\]
with \(\Pi_{\theta,T}^{\mathbf{x}}\) the model's pushforward of \(\Pi_0^{\mathbf{x}}\) by the learned flow. Due to exact volume preservation, the model density at \((q_T, p_T)\) is given by the density of the corresponding inverse-mapped point under the initial Gaussian.

Training uses a dataset of \(M = 32,768\) PIC-generated trajectories, each with \(N = 256\) macroparticles, box length \(L = 128\), grid \(N_g = 128\), initial Gaussian parameters over \(\sigma_q, \sigma_p \in [0.5,1.5]\), evolved by Leapfrog with \(\delta t = 0.04\), \(L = 25\) steps (\(T = 1.0\)) [2505.04471].

## 5. Inference, Generalization, and Sampling

After training, inference for a new initial Gaussian \(\mathbf{x}\) at arbitrary time \(t \leq T\) proceeds by:
- Sampling \((q(0), p(0))\) from \(\Pi_0^{\mathbf{x}}\).
- Integrating the learned symplectic flow for \(L_t = t/\delta t\) steps using the trained \(V_\theta\) and scalar \(a\).
- Outputting the transformed \((q(t), p(t))\).

As the flow is continuous-time and equivariant, evaluating the model at any intermediate \(t = n\,\delta t\) yields the corresponding approximate density without retraining. Only \(2L_t\) network gradient evaluations (for \(\nabla_q V_\theta\)) and sum updates per sample are needed [2505.04471].

## 6. Empirical Performance and Physical Interpretation

On a held-out test set, measured 1D Wasserstein-1 distances (\(W_1\)) between true and generated samples at \(t = 1.0\) are:
- PDE-NHF (25 Leapfrog steps): \(W_1(q) \approx 0.057\), \(W_1(p) \approx 0.079\).
- Baseline direct MLP: \(W_1(q) \approx W_1(p) \approx 0.138\).

For intermediate \(t \in \{0.2, 0.4, 0.6, 0.8\}\), PDE-NHF achieves \(W_1\) errors below \(0.04\) (position) and \(0.06\) (velocity), signaling strong generalization to unseen temporal slices. The learned kinetic coefficient \(a\) converges to \(a \approx 0.99\), closely recovering the physical Hamiltonian.

The architecture is robust to coarse discretization: reducing \(L\) (e.g., to 5, \(\delta t = 0.2\)) yields errors within \(<10\%\) of the full-scheme, and per-sample runtime halves relative to standard PIC (\(\approx 0.01\) s per sample on A100 GPU vs. \(\approx 0.02\) s for PIC). Exact volume preservation (\(\det J = 1\)) rules out spurious diffusion or density collapse [2505.04471].

## 7. Significance and Scope

PDE-NHF constitutes a synthesis of kinetic PDE theory, Hamiltonian mechanics, and deep generative modeling. Its main features are:
- Preservation of symplectic invariants by construction.
- Fast, parallelizable sampling for arbitrary initial data and times.
- Accurate learning of self-consistent physical potentials.
- Orders-of-magnitude improvements in repeated-inference throughput versus simulation-based approaches.
- Seamless interpolation across unseen (time, initial condition) domains.

These attributes distinguish PDE-NHF from direct regression architectures and enable its use as a surrogate, interpretive, and generative tool for high-dimensional kinetic systems [2505.04471].

Source: https://www.emergentmind.com/topics/pde-nhf-model