geomstats icon indicating copy to clipboard operation
geomstats copied to clipboard

`group.exp` different from `group.metric.exp`

Open emilemathieu opened this issue 3 years ago • 3 comments

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

emilemathieu avatar Feb 24 '22 11:02 emilemathieu

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.

github-actions[bot] avatar Feb 24 '22 11:02 github-actions[bot]

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 why group.metric.exp does not call group.exp.
  • MatrixLieGroup does call gs.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 involve expm and are implemented in the corresponding subclasses.
  • I do agree that LieGroup and MatrixLieGroup should interact, or LieGroup changed into VectorLieGroup.

Let me know if that does not answer your questions.

nguigs avatar Feb 28 '22 18:02 nguigs

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).

emilemathieu avatar Mar 21 '22 15:03 emilemathieu