                           Geometric Contact Flows: Contactomorphisms for Dynamics and Control

incorporated into the optimization (18) as a penalty term to           Quantum Dynamics Reconstruction. A single-mode
enforce obstacle avoidance,                                            bosonic system is a quantum mechanical oscillator whose
        Z t1                                                           deterministic dynamics are governed by a contact Hamil-
               EΥ (z(t)) + σz2 (z(t)) + ∥u(t)∥2 dt
                                                
    min                                                                tonian operator. The evolution of its wave function is de-
    u(·) t0                                             (19)           scribed by the quantum operators q̂ and p̂, representing the
                    s.t. ż(t) = ZHg (z(t)) + u(t),                    system’s stochastic position and momentum, along with the
                                                                       quantum phase s, which governs interference between wave
where EΥ (z(t)) denotes the energy term associated with                components. We conducted experiments on 20 synthetic sys-
the unsafe region, i.e., the latent space obstacle distribution.       tems with varying parameters, reconstructing the dynamics
This ensures that unsafe latent space regions are associated           of the state variables’ expected values using the GCF model
with high energy values, which penalize trajectories that              and baseline methods, over an 8 seconds horizon. HNN
cross these regions, resulting in e.g., obstacle avoidance.            and DHNN are inapplicable here due to their limitation to
                                                                       even-dimensional phase spaces, which prevents modeling
6. Results                                                             the additional odd variable s. Results are summarized in
                                                                       Table 2, showing that GCF achieves a 60% reduction in re-
We test our approach on established baselines that incor-              construction error. Further details are provided in App. E.2.
porate inductive biases in learning dynamical systems. Eu-
clideanizing Flows (EF) (Rana et al., 2020) use diffeomor-             Table 2. Reconstruction error via DTWD on the quantum system
phisms to encode desirable properties like periodicity or                 GCF DHNN HNN       EF      NCDS       MLP
target convergence. Neural Contractive Dynamical Systems                0.29±0.04 N/A N/A 0.72±0.12 0.70±0.11 0.41±0.06
(NCDS) (Mohammadi et al., 2024) improve upon EF by
enforcing global contraction. Hamiltonian Neural Networks              Handwriting Datasets. The LASA (Lemme et al., 2015)
(HNN) (Greydanus et al., 2019) embed physical structure by             and DigiLeTs (Fabi et al., 2022) datasets are widely used
modeling systems with Hamiltonian dynamics. Dissipative                benchmarks for motion generation, featuring 2D handwrit-
Hamiltonian Neural Networks (DHNN) (Sosanya & Grey-                    ten trajectories. LASA involves simpler, first-order dynam-
danus, 2022) extend HNNs to non-conservative systems by                ics, while DigiLeTs includes more complex, second-order
introducing dissipation. Details on the experimental setup             motions with self-crossing paths. The learned dynamics
are provided in App. D. Scalability across target dimen-               are treated as a skill that an actuated system must not only
sions and model sizes is evaluated in App. E.5. In classical           imitate but also generalize and adapt to new scenarios. In
mechanics, the state of physical systems is typically de-              these tasks, the dynamics converge to a target, so we exclude
scribed by positions and velocities {q, q̇}, which we convert          HNN, which models only periodic behaviors. Figure 5 com-
to canonical coordinates {q, p, s}, required in the contact            pares the remanent approaches on two characters. EF and
Hamiltonian formulation (App. D.3). The Lagrangian action              NCDS model a position-dependent vector field, enabling
s is not directly observable but it is estimated by comparing          flow lines to be plotted in the background. In contrast,
the system’s behavior as described by Maupertuis’ prin-                DHNN includes position and momentum, and GCF incor-
ciple with that derived from Noether’s theorem, ensuring               porates the Lagrangian action, making global flow lines
consistency between the two representations.                           infeasible. Instead, circular patches depict local dynamics
Spring Mesh Dynamics Reconstruction. We consider                       around trajectory points with fixed extra-variable values.
a 60-dimensional dataset (Otness et al., 2021) describing              GCF’s patches represent the model uncertainty.
the dynamics of a 2D square grid of nodes connected by                 Table 3. Reconstruction error via DTWD on handwriting datasets
springs. The interaction among multiple springs results in             Character       EF      NCDS DHNN            GCF
complex, large-scale deformations and oscillations. Pre-
                                                                                    0.43±0.10 0.44±0.14 0.65±0.15 0.44±0.12
dicting the motion of mesh nodes closely resembles finite
element modeling of material deformation. Table 1 summa-                             2.22±0.03 2.79±0.09 0.82±0.22 0.70±0.36
rizes the dynamics reconstruction results, reporting the Dy-
namic Time Warping Distance (DTWD) (Berndt & Clifford,                 EF and NCDS are limited to first-order dynamics and cannot
1994) across 20 trials on systems simulated for 8 seconds              capture self-crossing trajectories. DHNN lacks convergence
from varying initial conditions. Our GCF model achieves                guarantees, often failing to reach the target and to generalize
a 57% reduction in reconstruction error. Experimental set-             beyond the training data. In contrast, GCF accurately recon-
tings and predicted dynamics plots are in given in App. E.1.           structs the dynamics, converges to the data manifold, and
                                                                       reduces uncertainty, as shown by streamlines avoiding high-
Table 1. Reconstruction error via DTWD on the spring mesh              uncertainty areas. Table 3 reports the reconstruction error
  GCF DHNN HNN               EF      NCDS MLP                          of the position dynamics. GCF achieves performance com-
0.50±.19 1.24±.62 1.49±.74 30.9±3.3 24.9±2.6 1.71±.56                  parable to EF on LASA, while significantly outperforming

                                                                   7
