                                Geometric Contact Flows: Contactomorphisms for Dynamics and Control

and latent states by leveraging the analytical contact trans-                 C. Implementation Details
formation conditions established in (Bravetti et al., 2017),
                                                                              C.1. Importance of Contact Structure Preservation
                   dŝ          dq̂i      dŝ       dq̂i                      The transformation φr : (M, η) → (N , η ′ ) is designed to
              pi       − pi p̂i      =−       + p̂i      ,      (34a)
                   ds           ds        dqi       dqi                       preserve the contact structure, ensuring that the physical
                    dŝ         dq̂i                                          relationships between conjugate variables in the latent base-
                        − p̂i        = 0.                       (34b)         line dynamics are conserved. The theoretical justification
                    dpi         dpi
                                                                              for this is provided in Section 3 and Appendix A B.4. Here,
Here, the coordinates (qi , pi , s) and (q̂i , p̂i , ŝ) represent the
                                                                              we empirically evaluate its importance by examining the
variables before and after the contact transformation, re-
                                                                              consequences of replacing contactomorphisms by standard
spectively. The partial derivatives correspond to entries in
                                                                              diffeomorphisms. This substitution disrupts the underly-
the Jacobian of the contactomorphism. By computing the
                                                                              ing physical coherence, leading to degraded reconstruction
difference between the left-hand and right-hand sides of the
                                                                              and generalization performance. Figure 11 qualitatively
conditions above, we consistently observe a numerical error
                                                                              illustrates the impact of replacing contactomorphisms by
lower than 1e − 5, confirming that the implemented transfor-
                                                                              diffeomorphisms, highlighting distortions in both the recon-
mation closely satisfies the contactomorphism conditions.
                                                                              struction and generalization of the L EAF 2 character from
                                                                              the LASA dataset. Figure 12 shows a more elaborated com-
B.4. Physical Interpretability                                                parison of generalization performance, by considering pre-
Equipping the latent dynamics with a contactomorphism                         dicted trajectories initialized from a grid of points in the state
allows us to model a dynamical system directly in ambient                     space. The use of contactomorphisms shows significantly
coordinates. To predict the ambient trajectory from an initial                faster convergence toward the data manifold, measured as
point x0 , we first map it to the latent space via the learned                the percentage of time steps spent near the demonstrations
contactomorphism, z0 = φr (T )(x0 ). We then integrate the                    over the trajectory’s duration. Tables 7 and 8 quantitatively
latent dynamics to obtain z(t) = φg (t)(z0 ), and finally map                 confirm the degradation in reconstruction and generaliza-
the result back to the ambient space using the inverse contac-                tion accuracy when contact structure preservation is not
tomorphism, x(t) = φ−1                                                        enforced.
                         r (T )(z(t)). Formally, this process
is expressed as a composition of contact Hamiltonian flows,
   x(t) = φ−1                                                                 Table 7. Reconstruction error via DTWD for the ablation study on
           r (T ) ◦ φg (t) ◦ φr (T )(x0 ), t ∈ [0, t1 ].         (35)
                                                                              the structure of the ambient space–latent space mapping
Note that the composition of Hamiltonian paths is itself a                     Character       Contactomorphism           Diffeomorphism
Hamiltonian path. The corresponding Hamiltonian function,
associated with the Riemannian metric m̂, can be derived                                            0.44±0.12                 1.15±0.64
using (Polterovich, 2012, Proposition 1.4.D),                                                       0.43±0.07                 0.96±0.49
             Hm = Hr + Hg (φ−1         −1
                            r ) − Hr (φg ),                      (36)
where the Hamiltonian of the contactomorphism Hr is,
                                                                              Table 8. Generalization measured as average ratio of convergence
                            K
                            X                                                 for the ablation study on the structure of the mapping between the
          Hr = Hr1 +              Hrk (φrk−1 ◦ · · · ◦ φr1 ).    (37)         ambient space and the latent space
                            k=1
                                                                               Character       Contactomorphism           Diffeomorphism
Preserving the contact structure ensures that the predicted
ambient dynamics follow a contact Hamiltonian form,                                                 0.61±0.21                 0.08±0.25
making them physically interpretable. Specifically, using                                           0.62±0.13                 0.12±0.23
a contactomorphism instead of a generic diffeomorphism
allows for the derivation of an analytical expression for the
Hamiltonian function in the ambient space. The damping
                                                                              C.2. Training Details and Weights Ablation
coefficient, ∂Hm /∂s, embedded in the contact form,
quantifies energy dissipation or absorption as described by                   The weights employed in the loss function (12) are wx = 1
Equation (8), and governs the interplay between conjugate                     and wz = 0.01. Training is conducted for 5000 epochs,
variables. While GCF morphs the latent contact form η ′ and                   taking approximately 4 hours on average. Details of the
modulates the damping coefficient, it also preserves their                    machine used for training are provided in Appendix D.1.
relationship, ensuring physical consistency. Figure 1 shows                   The initial learning rate is 1 × 10−3 and is reduced by a
that GCF yields a damping coefficient consistent with                         factor of 0.9 on plateaus observed for 200 epochs. The loss
the real system demonstrating its robustness in modeling                      is clipped at 1 × 103 , and the gradient is clipped at 0.1.
conjugate variable interactions.                                              Optimization is performed using the Adam optimizer with

                                                                         17
