Yes, you can do it component-wise. As you have three momenta, you have to write Hamilton's equations for all of them. \begin{align}\dot{x} &= \partial H/\partial p_x\\ \dot{y} &= \partial H/\partial p_y \\ \dot{z} &= \partial H/\partial p_z\end{align} Similarly for the momenta \begin{align}\dot{p_x} &= -~\partial H/\partial x\\ \dot{p_y} &= -~\partial H/\partial y\\ \dot{p_z} &= -~\partial H/\partial z\end{align}