27
$\begingroup$

Is it possible to get widely available math software (Maple/Matlab/Mathematica, etc) to symbolically differentiate vector and scalar functions of matrices, returning the result in terms of the original matrices and vectors involved? I have in mind the simple sort of rules collected here for example.

On a few separate occasions I've scoured around the internet for such a thing and only turned up a bunch of incomplete threads of various vintage (like this or this or this).

So my main question is if I am missing the right keywords to find what is obvious to people who use this sort of functionality all the time, and what platform it is available on if so.

If in fact this sort of functionality is not available in any of the commonly used software my question is if this is because of some sort of practical obstruction I am not seeing or simply because the problems for which it would be useful are simple enough to be done by hand (which is what I've ended up doing after I spend 4 hours searching for the "easy" way).

$\endgroup$
3
  • 1
    $\begingroup$ You might find the following software useful: inp.demokritos.gr/~sbonano/EDC $\endgroup$
    – Suvrit
    Commented Mar 2, 2012 at 5:33
  • 3
    $\begingroup$ I would also be interested in a package implementing basic matrix algebra only --- you know, dealing with non-commuting symbols and applying automatically simple stuff like $(AB)^*=B^*A^*$. Is there a good one around? $\endgroup$ Commented Mar 2, 2012 at 8:19
  • $\begingroup$ It seems as though Mathematica has some functionality for this: forums.wolfram.com/mathgroup/archive/2000/Feb/msg00451.html I don't know about general functions though, but it seems like it can handle it. $\endgroup$ Commented Mar 26, 2012 at 3:50

2 Answers 2

24
$\begingroup$

Indeed, I was having the same problem. Hence, I implemented a matrix calculus toolbox myself. You can find it at www.matrixcalculus.org. It can compute vector and matrix derivatives and will return the result in terms of the original vectors and matrices involved.

$\endgroup$
4
  • 2
    $\begingroup$ Very cool. I haven't tried it out very thoroughly or anything, but I'll gladly accept this answer to a five year old question! I'm sure I'm not the only one who appreciates your industriousness. $\endgroup$
    – R Hahn
    Commented Jan 15, 2017 at 3:56
  • $\begingroup$ Is there something for general Matrix manipulation? For instance I have long expression of matrices and wonder if it can be simplified? $\endgroup$
    – Royi
    Commented Nov 28, 2019 at 9:41
  • $\begingroup$ @Soeren I have been using this tool the last couple of days and I found it great! Really great job! Is there a way to denote an arbitrary function that acts on vector/matrices in this tool. For example I want to compute the derivative wrt to vector x of this expression $Tr[ \nabla( C f(x))]$, where $f(x)$ is vector valued function. Is there a way to perform this calculation with the toolbox? $\endgroup$ Commented Aug 13, 2022 at 7:36
  • 1
    $\begingroup$ Asked ten years ago, very useful 5-years-ago answer. I have been looking for this free tool for a long time. Thanks a lot. $\endgroup$
    – Nacho
    Commented Feb 1, 2023 at 0:46
8
$\begingroup$

I have not used it, but the NCAlgebra (NC for noncommutative) extension for Mathematica does do directional derivatives at least. It is aimed mostly at algebra involving noncommutative variables and their adjoints, however, so that may or may not be sufficient for your needs.

$\endgroup$
1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .