I know you didn't ask for this, but just in case it is of any help, here's how you do it in Cadabra (
https://cadabra.science).
Cadabra uses Sympy under the hood, so it's at least a partial Sympy answer.
Set-up with:
{x,y,z}::Coordinate;
{i,j,k,l}::Indices(values={x,y,z});
\partial{#}::PartialDerivative;
rl:= { u_{x} = x, u_{y} = 2 y z, u_{z} = 3 x y };
The gradient can then be computed using:
grad:= g_{i j} = \partial_{i}{ u_{j} };
evaluate(grad, rl, rhsonly=True);
and the Hessian with:
H:= H_{i j k} = \partial_{i j}{ u_{k} };
evaluate(H, rl, rhsonly=True);
Hope this helps.
Kasper