A structure-preserving kernel method for learning Hamiltonian systems

Jianyu Hu, Juan‐Pablo Ortega, Daiying Yin

TL;DR

This paper introduces a structure-preserving kernel ridge regression (KRR) method to learn Hamiltonian functions from noisy vector field data. By proving a new "Differential Representer Theorem," the authors provide a closed-form, convex solution that guarantees the learned system remains Hamiltonian while significantly outperforming neural-network-based approaches in both training speed and accuracy.

What Problem Does This Paper Address?

Hamiltonian systems are the bedrock of classical mechanics, describing everything from planetary orbits to molecular dynamics. These systems are defined by a scalar energy function $H$ (the Hamiltonian), and their evolution is governed by specific differential equations that preserve the system's "symplectic" structure.

When scientists try to learn these systems from data, they face a major hurdle: structure preservation. If you use a standard machine learning model to predict the motion, the model might "cheat" by learning a vector field that isn't actually the gradient of any energy function. This leads to non-physical results, like energy being created or destroyed over time. While "Hamiltonian Neural Networks" (HNNs) were designed to fix this, they rely on non-convex optimization (gradient descent), which can be slow, prone to local minima, and difficult to analyze theoretically.

Methods

The authors move away from neural networks and toward Kernel Methods in Reproducing Kernel Hilbert Spaces (RKHS). Their approach involves several key innovations:

  • Differential Reproducing Property: They prove that if a kernel is sufficiently smooth, the derivatives of functions in its RKHS also satisfy a reproducing property. This allows them to mathematically "reach inside" the kernel to handle gradients.
  • Differential Representer Theorem: This is the "aha" moment of the paper. They prove that the optimal Hamiltonian function is not just a sum of kernels (as in standard KRR), but a linear combination of the gradients of the kernel evaluated at the data points.
  • Closed-Form Solution: Because the problem is formulated as a ridge regression, it has a unique, global minimum that can be found using linear algebra (matrix inversion) rather than iterative training.
  • GP Equivalence: They demonstrate that this method is equivalent to the posterior mean of a Gaussian Process (GP) regression under specific regularization settings, bridging the gap between functional analysis and Bayesian statistics.

Datasets

The method was evaluated using synthetic datasets generated from classic physical systems, where the ground truth is known:

  • Double Pendulum: A classic chaotic system.
  • Hénon-Heiles System: Used in galactic dynamics.
  • Frenkel-Kontorova Model: Describes chains of particles with periodic potentials.
  • Highly Non-Convex Potentials: Custom-designed "bumpy" energy landscapes to test the limits of optimization.
  • Two-Body Problem: A gravitational system used to test how the model handles singularities (where the potential goes to infinity).

Key Insights and Ideas

  • Convexity is a Superpower: By framing the learning task as a convex optimization problem, the authors eliminate the "black magic" of tuning neural network hyperparameters and the risk of getting stuck in poor local minima.
  • Gradients as Features: Instead of learning the vector field directly, they learn the scalar Hamiltonian $H$ and let the math (the $J\nabla H$ operator) ensure the resulting vector field is Hamiltonian by construction.
  • Rigorous Convergence: Unlike many deep learning papers, this work provides solid PAC (Probably Approximately Correct) bounds and convergence rates, showing exactly how the error drops as you add more data points ($N$).
  • Coercivity Flexibility: They show that while a "coercivity condition" can speed up convergence, their method remains robust even when this condition isn't met, allowing for a wider choice of kernels.

Key Results

  • Accuracy & Speed: In experiments like the double pendulum, the kernel method achieved higher accuracy than HNNs while requiring orders of magnitude less training time (often less than a second vs. minutes of gradient descent).
  • Handling Non-Convexity: The method successfully reconstructed highly non-convex potentials where HNNs often failed to find the global structure.
  • Convergence Rates: The authors numerically verified their theoretical convergence rates, showing linear convergence in log-scale for the RKHS-norm error.
  • Flow Prediction: They proved and demonstrated that a small error in the learned Hamiltonian translates to a small error in the predicted trajectory (flow) over time.

Limitations and Future Work

  • Euclidean Constraint: The current theory is developed for Euclidean phase spaces. Extending this to non-Euclidean manifolds (like the rotation group for rigid bodies) is a noted next step.
  • Vector Field vs. Trajectories: The model currently requires "velocity" data (vector fields). In the real world, we often only have "position" data (trajectories). The authors suggest that integrating this with symplectic integrators is a promising future direction.
  • Scalability: Like all kernel methods, the $O(N^3)$ cost of matrix inversion becomes a bottleneck for massive datasets. While they discuss an "online" recursive version in the appendix, large-scale benchmarks remain for future study.
  • Singularities: While the model qualitatively captured the shape of the two-body problem, the numerical approximation was less satisfactory near the singularity, as the theory assumes bounded derivatives.

Summary updated

BibTeX
@inproceedings{hu2025structure,
  author = {Jianyu Hu and Juan‐Pablo Ortega and Daiying Yin},
  title = {{A structure-preserving kernel method for learning Hamiltonian systems}},
  booktitle = {Mathematics},
  year = {2025},
  doi = {10.1090/mcom/4106},
}
Figure