About divergence of a vector field Let $f:\mathbb{R}^n\to \mathbb{R}^n$. Divergence of $f$ is defined as
$$\operatorname{div}(f)=\sum_{i=1}^n \frac{\partial f_i}{\partial x_i}$$

I am reading a paper where it says that the divergence of a vector field defined by the odes
$$\frac{dq_i}{dt}=\frac{\partial H}{\partial p_i},\frac{dp_i}{dt}=-\frac{\partial H}{\partial q_i}$$ for $i=1,\ldots, n$ where $H:\mathbb{R}^n\times \mathbb{R}^n\to \mathbb{R}$ is given by
$$\sum_{i=1}^n \frac{\partial}{\partial q_i}\frac{dq_i}{dt}+\frac{\partial}{\partial p_i}\frac{dp_i}{dt}$$

and I don't understand how that follows from definition of divergence of a function and the odes. Any suggestions?
 A: I think it's an instance of abuse of notation. If you take the Hamiltonian vector field which is given by:
$X_H =\Bigl( \dfrac{\partial H}{\partial p}, -\dfrac{\partial H}{\partial q}\Bigl), $
Then using Hamilton's equations of motion (your ODEs) I would take:
div$(X_H)$$=\dfrac{\partial}{\partial q}\dfrac{dq}{dt}-\dfrac{\partial}{\partial p}\dfrac{dp}{dt}$
to mean:
$\dfrac{\partial}{\partial q}\dfrac{\partial H}{\partial p}-\dfrac{\partial}{\partial p}\dfrac{\partial H}{\partial q}$
A quick glance at it would immediately tell us that div$(X_H)$$=\dfrac{\partial}{\partial q}\dfrac{\partial H}{\partial p}-\dfrac{\partial}{\partial p}\dfrac{\partial H}{\partial q}=0$
Since $H$ is usually assumed to be $C^{\infty}(M)$ where $M$ is your configuration manifold (the set of all possible positions, basically), hence partial derivatives commute.
This is a well known result in Hamiltonian mechanics and symplectic geometry: Hamiltonian vector fields are divergence-free.
The author's equation, as it stands, makes little sense since you're taking partial derivatives with respect to $q$ and $p$ of a function which depends solely on time ($q(t)$ is supposed to represent the coordinate position as a function of time). Perhaps this could be reconciled if we introduce the flow map (which is a function of time, coordinates, and momenta to the space of coordinates and momenta) but I'd reckon it wouldn't be particularly illuminating especially since verifying that the vector field is divergence free is so simple if you just apply the definition.
