Solution (source code)

= Solution

To match the source's order define $[a,b]=\sum_i(a_{p_i}b_{q_i}-a_{q_i}b_{p_i})$. The <chain rule> and <Hamilton's equations> then give
$$
\boxed{\frac{dg}{dt}=g_t+[H,g].}
$$
Antisymmetry implies $[H,H]=0$, hence $dH/dt=H_t$, which vanishes for a time-independent <Hamiltonian>. With the alternative common convention $\{a,b\}=\sum_i(a_{q_i}b_{p_i}-a_{p_i}b_{q_i})$, the same law is $dg/dt=g_t+\{g,H\}$; mixing the two orders would reverse the physical <time evolution>.