geomstats
geomstats copied to clipboard
`group.exp` different from `group.metric.exp`
Hello,
I was wondering why--with group
some instance of a MatrixLieGroup
--we have thatgroup.metric.exp
isn not calling group.exp
(from LieGroup
).
Currently, group.metric.exp
is relying the (generic) matrix exponential via gs.expm
even though closed form expression may be implemented in group.exp
. Wouldn't it be better to call gs.expm
in the abstract LieGroup.exp_from_identity
class which can then be optionally overridden by classes inheriting from LieGroup
?
This is related to the fact that MatrixLieGroup
is not inheriting from LieGroup
.
Kind regards, Emile
Hello, Welcome to Geomstats! we are glad that you are contributing to it by opening this issue. Please make sure to include all the relevant context, and one of the maintainers will be here shortly. If you are interested in contributing to our project, let us know! Also, be sure to check out our contributing guide on Contributing Guidelines.
Hi Emile, thank you for your comment! Could tell me more about which group your are looking at and which metric?
There are different aspects to your question:
- In theory,
group.metric.exp
is not necessarily the matrix exponential, take for example the one of the right-invariant metric on SE(2) and see this example. This is whygroup.metric.exp
does not callgroup.exp
. -
MatrixLieGroup
does callgs.linalg.exp
after left or right translation. -
LieGroup.exp_from_identity
is also used for vector lie groups (SO3 and SE3), in which case there are formulas that don't involveexpm
and are implemented in the corresponding subclasses. - I do agree that
LieGroup
andMatrixLieGroup
should interact, orLieGroup
changed intoVectorLieGroup
.
Let me know if that does not answer your questions.
Hi @nguigs, thanks for your answer.
I'm particularity interested in SO(3) and the associated bi-invariant metric. I use _SpecialOrthogonalMatrices
but couldn't (by default) leverage Rodrigues formula when computing the exponential map.
I guess I was wrongly assuming that group.exp
would perform a right or left translation and then call group.exp_from_identity
(for instance via the Rodrigues formula) but which would default to gs.linalg.exp
otherwise (if inheriting from MatrixLieGroup
).