Hamilton-Jacobi Networks: Unifying Conserved-Quantity Discovery and Symplectic Trajectory Prediction

Thomas Nektarios Saltzis, Anastasios TefasarXiv 2026

TL;DR

Learning physical dynamics from data usually splits into two separate quests: forecasting future states while respecting phase-space geometry, or hunting for hidden conservation laws. Inspired by 19th-century classical mechanics, Hamilton–Jacobi Networks (HJNs) show that these two goals are actually the exact same representation-learning problem. By training a custom invertible neural network solely to predict trajectories, conserved quantities emerge automatically in the latent space—without numerical integrators or assumptions about what those quantities look like.

What Problem Does This Paper Address?

Physical systems—from swinging pendulums to orbiting planets—are governed by Hamiltonian mechanics. Unlike generic time-series data, their trajectories live in a phase space of positions ($q$) and momenta ($p$) with strict geometric rules: motion is symplectic (preserving phase-space volume, preventing artificial energy drift) and constrained by conserved quantities like total energy or momentum.

Historically, machine learning approaches have tackled this piecemeal. Some learn the scalar energy function and rely on slow numerical ODE solvers at inference time. Others learn fixed-step symplectic maps to jump forward in time. Meanwhile, methods that jointly predict motion and discover conservation laws either drop Hamiltonian guarantees altogether or force you to guess the mathematical form of the invariants in advance (e.g., assuming they are simple quadratic equations, or assuming the system isn't chaotic). The authors ask: can we unify exact symplectic prediction and unrestricted conserved-quantity discovery under a single objective, even for chaotic systems?

Methods

The secret lies in Hamilton–Jacobi theory. Instead of asking "how do I step forward by $\Delta t$?", Hamilton–Jacobi theory asks for a time-dependent coordinate change—a canonical transformation—where the new coordinates don't move at all. Every state $(q, p)$ along a trajectory maps to the exact same static constants $(Q, P)$, and inverting that map at any query time $t_{\text{pred}}$ hands you back the system's exact state at that moment.

Overview of the Hamilton–Jacobi Network architecture

The authors turn this directly into a tied-weight autoencoder called the Hamilton–Jacobi Network (HJN):

  • Exact Symplectic Encoder–Decoder: Building on continuous-time symplectic shear layers, the encoder $\mathcal{M}$ maps an observation $(q, p, t)$ into latent coordinates $(Q, P)$. Because each layer is triangular, the decoder $\mathcal{M}^{-1}$ is its exact algebraic inverse sharing the exact same weights—no ODE solvers required. Both directions are guaranteed to preserve phase-space geometry by construction.
  • Parallel Segment Prediction & Segmentation: Because long chaotic trajectories cause exploding gradients, trajectories are sliced into local windows of length $T_{\text{max}}$ (automatically estimated from the data's fastest local Lyapunov time). From a single anchor observation, the decoder predicts all query times inside a window in one parallel forward pass. Longer rollouts chain segments together.
  • Conditioning Safeguard: Because any time-independent canonical transformation of the latents (a "frame" shift) leaves predictions mathematically identical, the authors add a lightweight statistical independence penalty (HSIC) so latent pairs don't become nearly collinear and amplify floating-point rounding errors.

Datasets

Rather than introducing new datasets, the authors evaluate HJN on four classic physics benchmarks (following the standard setups of Hamiltonian Neural Networks and Schmidt & Lipson), testing both long-horizon rollouts (Test A) and unseen higher energies (Test B):

  1. Ideal Mass–Spring Oscillator: Simulated, linear, and analytically integrable.
  2. Ideal Nonlinear Pendulum: Simulated, anharmonic, and numerically integrable.
  3. Real Physical Pendulum: Experimental sensor data of a real pendulum experiencing air resistance—deliberately included as an out-of-scope stress test since dissipation violates Hamiltonian assumptions.
  4. Hénon–Heiles System: A simulated 2D nonlinear, non-integrable system famous in astrophysics for exhibiting chaotic trajectories.

Key Insights and Ideas

  • Prediction is Discovery: The authors prove mathematically that achieving zero prediction loss on a segment is equivalent to the encoder learning conserved quantities—and away from zero loss, prediction error and latent drift tightly bound one another. You don't need a special "conservation loss" to discover invariants.
  • No Integrability Required: Classical theorems (like Liouville–Arnold) forbid global, time-independent invariants in chaotic systems. Because HJN's encoder explicitly takes time $t$ as an input, a single smooth global transformation exists for any autonomous Hamiltonian system with complete flow—chaotic or not.
  • A Surprising Inductive Bias for Simplicity: Even though nothing in the loss function forces the latent space to look human-readable, training consistently settles into a clean coordinate frame where classical energy and phase can be read out using simple low-degree polynomials.

Key Results

  • Latent Constancy: On unseen trajectories within the training energy range, the learned latents stay nearly frozen along segments—deviating in RMS by just 2–14% of the system's phase-space motion, which is smaller than a single vector of the Gaussian noise added during training.
  • Recovering Classical Physics: Fitting polynomials of degree $\le 4$ to $t=0$ latents recovers true system energy with cross-validated $R^2 \ge 0.944$ across all conservative systems (including chaotic Hénon–Heiles), while degree-1 linear fits recover initial phase coordinates in the integrable systems ($R^2 > 0.99$). Shifting the encoding time accurately reproduces constant energy (median error $\le 5.2\%$) and true phase-advance rates (within $0.2\%$ for the oscillator and $1.3\%$ for the pendulum).
  • Rollout Accuracy: Across multi-segment rollouts, HJN matches or outperforms Noether's Razor (a Bayesian symmetry-learning HNN baseline) on 5 of 6 conservative test splits (e.g., achieving $L_2/\sqrt{E}$ error of 0.508 vs. 1.874 on Hénon–Heiles rollouts). On the dissipative real pendulum, where HJN's theoretical assumptions break down, HJN degrades via localized excursions and trails the baseline (MSE 0.098 vs. 0.017).

Limitations and Future Work

HJN's theoretical guarantees strictly bound its domain: it cannot model driven (time-dependent) or dissipative systems, nor systems where trajectories escape to infinity in finite time. Practically, it requires data already formatted as canonical $(q, p)$ pairs rather than raw sensor velocities or pixels, and its performance degrades when extrapolating to unseen energy bands or if segment lengths $T_{\text{max}}$ are set too wide in chaotic regimes. For future work, the authors propose learning an upstream mapping from raw observations to canonical coordinates, designing adaptive per-region segment lengths, and investigating why gradient descent naturally favors polynomially interpretable latent frames.

Summary updated

BibTeX
@misc{saltzis2026hamilton,
  author = {Thomas Nektarios Saltzis and Anastasios Tefas},
  title = {{Hamilton-Jacobi Networks: Unifying Conserved-Quantity Discovery and Symplectic Trajectory Prediction}},
  year = {2026},
  eprint = {2611.40029},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.40029},
}
Figure