How to calculate the (symbolic) gradient of a multidimensional function in sympy?
Obviously, I could calculate separately the derivative for each variable, but is there a vectorized operation that does this?
for example
m=sympy.Matrix(sympy.symbols('abc d'))
Now for i = 0..3 I can do:
sympy.diff(np.sum(m*mT),m[i])
which will work, but I would rather do something like:
sympy.diff(np.sum(m*mT),m)
What does not work ("AttributeError: ImmutableMatrix does not have the _diff_wrt attribute").
python sympy symbolic-math derivative
Bitwise
source share