## #2684 wrong expontial of a diagonal matrix

None
closed
nobody
5
2014-02-10
2014-01-29
Jack Silver
No

When A is a diagonal matrix, exponentiation can be performed simply by exponentiating each of the diagonal elements.

With maxima 5.31.0, I get the following :

A: matrix ([a, 0, 0], [0, b, 0], [0, 0, c]);

```%e^A;
[   a           ]
[ %e    1    1  ]
[               ]
(%o2)                          [        b      ]
[  1   %e    1  ]
[               ]
[             c ]
[  1    1   %e  ]
```

which is clearly wrong (the "1" entries should be "0").

## Discussion

• Aleksas - 2014-02-02

(%i2) A:diag([a,b,c]);
(%o2) matrix([a,0,0],[0,b,0],[0,0,c])
(%i3) mat_function (exp, A);
(%o3) matrix([%e^a,0,0],[0,%e^b,0],[0,0,%e^c])

best

Aleksas D

• Robert Dodier - 2014-02-10
• status: open --> closed

• Robert Dodier - 2014-02-10

As shown by Aleksas, mat_function returns the correct result here. "^" is the scalar exponent so it's to be expected that it performs element-by-element exponentiation. However, I see now that "^^" also does it element-by-element -- that seems incorrect; I think %e^^A should perform the same operation as mat_function(exp, A). I'll make a separate report about that. Closing this report.