Does SymPy have any builtin functionality for expressive derivatives w.r.t. vectors and matrices as vector and matrix operations?
By "derivative w.r.t. a vector" I mean a vector of derivatives w.r.t. each element. The reason for treating these derivatives differently that just a vector of derivatives is that derivatives w.r.t. a vector often can be more naturally and conveniently expressed as operations on vectors rather than operations on individual elements. The same applies for matrices.
As a simple example of what I'm after:
|v| indicates the common Cartesian norm of a vector v
x1 and x2 are points in Cartesian space
I want the derivative of |x1 - x2| w.r.t. x1 to evaluate to (x1 - x2)/|x1 - x2|.
If this functionality isn't builtin, is there a suggested way to approximate or implement it?
From searching the archives, it looks like this topic has been discussed and is an area being developed but I can't find any posts from within the last year.
I'm not a mathematician or physicist so I may be misusing terminology. Please go ahead and ask for clarification if my intent is unclear. In particular, I don't know if I should be using the word "gradient" here. In the cases I'm familiar with, "gradient" is used in regards to functions of a single vector. What I'm trying to describe here applies to functions of multiple vectors.
Thanks.