rtoy / maxima

A Clone of Maxima's repo
Other
0 stars 0 forks source link

%e^^A returns element-by-element exponent #1676

Open rtoy opened 4 months ago

rtoy commented 4 months ago

Imported from SourceForge on 2024-07-04 22:22:23 Created by robert_dodier on 2014-02-10 08:40:29 Original: https://sourceforge.net/p/maxima/bugs/2688


As expected, %e^A returns the element-by-element exponent (where A is a matrix). But %e^^A also returns the element-by-element exponent. I think that's a bug; it seems like "^^" should return the matrix exponent, as calculated, for example, by mat_function(exp, A).

rtoy commented 4 months ago

Imported from SourceForge on 2024-07-04 22:22:24 Created by rswarbrick on 2014-02-19 20:04:23 Original: https://sourceforge.net/p/maxima/bugs/2688/#d27e


I guess there are two things here. Firstly, Maxima is giving a wrong answer. That turns out to be because of some bogus logic in SIMPNCEXPT. I'm pushing a patch that fixes that problem now.

The second is that Maxima isn't automatically calculating e^^A when it could. Speaking as the author of most of the revamped diag.mac, it's not all that brilliant. Basically, it does linear algebra like a 1st year undergrad, calculating Jordan normal forms and passing them around all over the place.

(1) We'd have to think quite hard about run time costs before enabling that sort of simplification by default.

(2) We would probably also want to move diag.mac from share/contrib to share and/or reimplement the functionality with a less horrible API.