JuliaManifolds / LieGroups.jl

LieGroups.jl – Lie groups and Lie algebras
Other
16 stars 2 forks source link

New linear representation type #6

Open olivierverdier opened 1 month ago

olivierverdier commented 1 month ago

Many group actions are actually linear representations, which allows to define apply_diff automatically. I would suggest the following:

  1. Create a new abstract type AbstractLinearRepresentation:
    abstract type AbstractLinearRepresentation{AD <: ActionDirection} <: AbstractGroupAction{AD} end
  2. Define apply_diff for this class of group actions:
    Manifolds.apply_diff(A::AbstractLinearRepresentation, g, ::Any, X) = apply(A, g, X)
  3. Make the existing linear group actions derive from AbstractLinearRepresentation For instance:
    struct TranslationAction{TAD<:ActionDirection,TM<:AbstractManifold,TRn<:TranslationGroup} <:
       AbstractLinearRepresentation{TAD}
    manifold::TM
    Rn::TRn
    end
  4. Clean up existing code Most of the existing implementations of apply_diff follow this pattern (because they are linear representation), for instance:
    • apply_diff(::TranslationAction,...)
    • apply_diff(::RotationActionOnVector,...)
    • apply_diff(::RotationTranslationOnVector,...)`
kellertuer commented 1 month ago

Can we maybe do discussions about groups only in LIeGroups.jl? I am slowly getting some overview about the groups in here, but if we add more and more features here, I will never catch up, as it seems, I will for now be the only one working on LieGroups.jl.

Also not my most recent question, whether the GroupAction we currently have should stay abstract – this indicates it maybe should? But again, since I am just starting redesigning that on the other repository, maybe changing the code here is a bit counterproductive – Let's do it over on LieGroups – otherwise I will just completely loose track.

kellertuer commented 1 month ago

I can even finish the Interface PR without actions and you do a PR on actions over on Lie groups?

olivierverdier commented 1 month ago

The LieGroups.jl repo is totally empty. I am suggesting a simple, incremental improvement of the current codebase (which is still hosted here). That code base can be carried over later to LieGroups.jl.

It is not adding a new feature. It is more a simplification, since all the apply_diff current implementations (except for group actions on themselves) are of the same type.

As to your question: should group action be abstract: yes (even without this proposal).

kellertuer commented 1 month ago

All work on the repo is in the first PR (https://github.com/JuliaManifolds/LieGroups.jl/pull/2).

Later today I will remove my first steps towards GroupActions because they seem to be total bogus again probably, and merge that first PR.

kellertuer commented 1 month ago

It's merged, I will probably do a PR on exp or a first group next – so you could start a PR on Actions? Again, Ia ma not sure whether we need one or two directions (one in the action one as argument in apply).

translate is now combined with compose already. So we just need apply

mateuszbaran commented 1 month ago

Sure, we can do that. Maybe AbstractAffineAction would be a better name though?

kellertuer commented 1 month ago

We can easily keep track of it here in LieGroups.jl then :)