Jan12
Jan12

Reputation: 111

Is there a SciPy function for computation of derivative of matrix exponential?

I work with Lie group SO(3). I know there exists an analytical expression for tangent application

eq1

from which the derivative of matrix exponential can be simply computed as

eq2

What I would like to do is to compute T(w).

The problem with simply implementing function T myself is that it is numerically imprecise for small norms of vector omega. I know there are exponential scipy.linalg.expm and logarithmic maps scipy.linalg.logm already in SciPy. Since this is similar I wonder if there is also the tangent map or the derivative. I noticed the scipy.linalg.expm_frechet, however, I didn't know how to connect it to T.

Upvotes: 2

Views: 510

Answers (2)

piterbarg
piterbarg

Reputation: 8219

This does not directly answer your question but for

it is numerically imprecise for small norms of vector omega

you can just use Taylor series expansion for small |\omega| ie use something like

(1-cos(x))/x^2 = 1/2 - x^2/24, if |x| < eps, normal expression otherwise

for suitably small eps (say 1e-4)

and the same idea for (x-sin(x))/x^3

Upvotes: 3

Bob
Bob

Reputation: 14654

For numeric evaluation of the derivatives you can translate your code to use pytorch, and then autograd will do the work for you a.

For symbolic differentiation you can use sympy b

Upvotes: 1

Related Questions