On affine space, a sufficiently smooth continuous-time Hamiltonian dynamic system $\dot p = \nabla_q H, \dot q = -\nabla_p H$ conserves $H$, preserves the volume form (e.g. if we are looking for ergodicity), and lends itself to a limited physical intuition of position-momentum.
But on the other hand any flow $\dot p = f(p)$ can be seen as the projection of a Hamiltonian system with $H(p, q) = q^t f(p) + g(p)$, where the "gauge" $g$ is any differentiable scalar function. The resulting Hamiltonian flow is $$ \begin{align} \dot p &= f(p) \\ -\dot q &= \left[\nabla f(p)\right] q+ \nabla g(p) \end{align} $$
A quick example shows how the $p, q$ system conserves volume in phase space. Let $f$ be multiplication by a negative matrix $A$. Then $p \to 0$ at roughly the same rate at which $q \to \infty$.
Is there a name for this construction, and is there a physical meaning for the variable $q$ and the function $g$? Are there any interesting choices for $g$? (My first instinct is to set $\dot q = 0$, but I am doubt that the "directional derivative" $p \mapsto \left[\nabla f(p)\right] q$ is a conservative function that doesn't depend on $q$.)