> Is there a way to compute the gradient and hessian matrices of a vector 
> field like u = (x) i + (2yz) j + (3xy) k.
>

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

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/6f06c7ac-46d7-499f-af4d-392e9399be24o%40googlegroups.com.

Reply via email to