Hamiltonian-ization of a dynamic system 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$.)
 A: This construction is somewhat similar to the Martin-Siggia-Rose formalism for writing expectation values over solutions of a stochastic differential equation
$$
\dot{p}(t)=f(p,t)+\xi(p,t)
$$
with $\xi$ a Gaussian noise with correlation function
$$
\mathbb{E}[\xi(p,t)\xi(p',t')]=G(p,t,p',t')
$$
as a path integral
$$
\mathbb{E}[O[p]]=\int\mathcal{D}p\mathcal{D}q\,O[p]\,e^{-S[p,q]}
$$
with action
$$
S[p,q]=\int \mathrm{d}t\, q\left(\dot{p}-f(p)\right)+\frac{1}{2}\int \mathrm{d}t\mathrm{d}t'\,G(q(t),t,q(t'),t')q(t)q(t').
$$
In your situation $G\equiv 0$, so there is no stochastic aspect, and the Lagrangian is just $L=q\dot{p}-qf(p)$, where $p$ is really a generalized position coordinate, whence the Hamiltonian is
$$
H=P\dot{p}-L=(P-q)\dot{p}+qf(p)
$$
where now $P$ is the conjugate momentum to $p$, and identifying $P=q$ yields your ansatz.
As to a physical interpretation of $q$, I don't think there is an obvious one (particularly since $g(q)$ is arbitrary and influences the evolution of $q$).
