Skip to content

Add group action param to Product Lie Group#2494

Open
rohan-bansal wants to merge 21 commits intoborglab:developfrom
rohan-bansal:feat/sdpgroup
Open

Add group action param to Product Lie Group#2494
rohan-bansal wants to merge 21 commits intoborglab:developfrom
rohan-bansal:feat/sdpgroup

Conversation

@rohan-bansal
Copy link
Copy Markdown
Contributor

@rohan-bansal rohan-bansal commented Apr 8, 2026

I tried adding the group action parameter by way of a sibling class to ProductLieGroup, but the extra re-implementation felt unnecessary.

The version I ran with is implemented directly into the ProductLieGroup, keeping all the branches/if-checking in the internals, and exposing a lean public template/API.

@rohan-bansal rohan-bansal changed the title Add group action input to Product Lie Group (DRAFT) Add group action param to Product Lie Group Apr 8, 2026
@dellaert
Copy link
Copy Markdown
Member

dellaert commented Apr 8, 2026

Awesome start! Some quick comments:

  1. I remember making some changes to this class template in the other PR. I think they were only formatting changes, but please make sure. Note, we format with clang-format, Google style.
  2. I don't think we need DirectProductAction. The code does not actually use it now in the "direct" branches. Please check.
  3. So, we can do this: if no action is given, i.e. it's a dummy argument, it's assumed to be a direct group.

@rohan-bansal rohan-bansal marked this pull request as ready for review April 8, 2026 16:54
@rohan-bansal rohan-bansal requested a review from dellaert April 8, 2026 16:54
@jenniferoum
Copy link
Copy Markdown
Contributor

Looks good to me. I was able to pull the code and run a unit test with the SD group.

Copy link
Copy Markdown
Member

@dellaert dellaert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments. And also love to see a little bit more comment in the code on how semi product is different. And it suspicious that in many cases the semi branch seems simpler.

Comment thread gtsam/base/ProductLieGroup.h Outdated
Comment thread tests/testActionProductLieGroup.cpp Outdated
Comment thread tests/testActionProductLieGroup.cpp Outdated
Comment thread tests/testActionProductLieGroup.cpp Outdated
Comment thread tests/testActionProductLieGroup.cpp Outdated
Comment thread gtsam/base/ProductLieGroup-inl.h
Comment thread gtsam/base/ProductLieGroup-inl.h Outdated
Comment thread gtsam/base/ProductLieGroup-inl.h Outdated
Comment thread gtsam/base/ProductLieGroup-inl.h Outdated
Comment thread gtsam/base/ProductLieGroup-inl.h Outdated
@dellaert
Copy link
Copy Markdown
Member

@rohan-bansal ping

@rohan-bansal
Copy link
Copy Markdown
Contributor Author

Sorry for the delay @dellaert , have been feeling a bit under the weather.

Changes:

  • Used the simpler generic function implementations where possible instead of having if-else branches
  • Commented the direct/semi-direct paths to explain better
  • Addressed misc. comments

The one thing I was not able to do that I would appreciate some guidance on is making the Expmap/Logmap generic for the semi-direct product.

For a semidirect product G ⋉ H, the exponential map is Expmap(ξ, v) = (Expmap_G(ξ), J_left(ξ) · v) where J_left(ξ) = ∫₀¹ D_h φ(Expmap_G(tξ), e_H) dt. From what I understand after talking a bit with Claude, there is no closed form solution for this integral that can be derived generically, it would need a group-specific formula or a very computationally-expensive numerical quadrature based method. I think the simplest thing to do is have the action supply Expmap/Logmap, but let me know if you think I should do it differently.

@dellaert
Copy link
Copy Markdown
Member

I’ll email - I might have just the thing.

rohan-bansal added a commit to rohan-bansal/gtsam that referenced this pull request Apr 15, 2026
Copy link
Copy Markdown
Member

@dellaert dellaert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good progress!!! 2 comments

Comment thread gtsam/base/ProductLieGroup-inl.h Outdated
Comment thread gtsam/base/ProductLieGroup-inl.h Outdated
template <typename G, typename H>
ProductLieGroup<G, H> ProductLieGroup<G, H>::operator*(
// ---------------------------------------------------------------------------
// phi01Kernel: compute φ₀(A)=exp(A) and φ₁(A)=Σ Aᵏ/(k+1)! in one shot.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty cool. But is this cheaper?
Also - maybe in a next PR - we need to think about a mechanism to special-case Rot3 and other G groups we have closed forms for.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, this is not intended to be cheaper than closed forms like the Rot3 kernels, and updated the comment to make that explicit. I agree that we should special-case these groups in a separate PR.

@dellaert
Copy link
Copy Markdown
Member

Status?

@rohan-bansal
Copy link
Copy Markdown
Contributor Author

From my end it looks ready for re-review. I did my best to be faithful to the PDFs, hopefully there are no mistakes; I would hope that the tests catch all of them. Just added another generality test with Rot2 x R2.

@dellaert
Copy link
Copy Markdown
Member

My comment on phi01Kernel was that it does an expm on a larger matrix. We also don't always need both. So I'd prefer two separate phi0 and phi1 kernels.

@rohan-bansal
Copy link
Copy Markdown
Contributor Author

Oh I see, I misinterpreted. Will make this change

@rohan-bansal
Copy link
Copy Markdown
Contributor Author

Updated.

@rohan-bansal
Copy link
Copy Markdown
Contributor Author

Replaced numerical code with analytical.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants