We present a framework for learning Hamiltonian systems using data. This work is based on a lifting
hypothesis, which posits that nonlinear Hamiltonian systems can be written as nonlinear systems
with cubic Hamiltonians. By leveraging this, we obtain quadratic dynamics that are Hamiltonian in
a transformed coordinate system. To that end, for given generalized position and momentum data, we
propose a methodology to learn quadratic dynamical systems, enforcing the Hamiltonian structure
in combination with a weakly-enforced symplectic autoencoder. The obtained Hamiltonian structure
exhibits long-term stability of the system, while the cubic Hamiltonian function provides relatively
low model complexity. For low-dimensional data, we determine a higher-dimensional transformed
coordinate system, whereas for high-dimensional data, we find a lower-dimensional coordinate system
with the desired properties. We demonstrate the proposed methodology by means of both lowdimensional
and high-dimensional nonlinear Hamiltonian systems.