Manifolds.jl icon indicating copy to clipboard operation
Manifolds.jl copied to clipboard

Different types of projection

Open mateuszbaran opened this issue 5 years ago • 5 comments
trafficstars

Currently our project function performs conversion of Euclidean gradients to Riemannian gradients. It is, however, also used for projection vector transport and for some manifolds (for example Rotations) these two types of projection actually different. How should we expose the possibility to implement these two projections differently? Currently the suggested approach would be to implement projection vector transport separately but it doesn't play well with the way projection transport is defined in ManifoldsBase: https://github.com/JuliaManifolds/ManifoldsBase.jl/blob/0f3c5933ab565fc0297c6e339e1bae5717f05e0c/src/ManifoldsBase.jl#L875 .

One way to fix it is to remove the default implementation and write appropriate projection transport methods. I just find it a little misleading that "projection transport" doesn't actually use project.

mateuszbaran avatar Apr 17 '20 20:04 mateuszbaran

I think the problem might lie slightly somewhere else.

In general I am not that much in favour of having this general projection-vector-transport, that just calls project on the tangent vector X at p to get it to q. This might work locally for embedded manifolds, but otherwise not. The projection vector transport – despite this problem, does exactly the same as the project: If X is not seen as a tangent at p but as a vector in the embedding, we can just project it to the tangent of q. In that sense, the project should be used for both.

For Rorations and Lie algebras in general the problem is, that tangent vectors in the Lie algebra are not suited for projection, here it would be better to say that the projected vector transport is the identity in the Lie algebra, I think. Yes that would not be a projection in the implementation, but that's due to representing elements in the Lie algebra.

kellertuer avatar Apr 18 '20 17:04 kellertuer

The projection vector transport – despite this problem, does exactly the same as the project: If X is not seen as a tangent at p but as a vector in the embedding, we can just project it to the tangent of q. In that sense, the project should be used for both.

If I understand correctly, if we had a circle group on a real plane with unit element [1, 0], and we had point p=[0, 1] with vector X=[0, 1], the vector transport projection should return [0, 1] while the egrad2rgrad projection should return [0, 0]. I'm assuming representing tangent vectors as transported to [1, 0].

Anyway, I agree that having a projection vector transport that just calls project like we have now is a bad idea.

mateuszbaran avatar Apr 18 '20 18:04 mateuszbaran

Yes, that is because we represent the tangents in the Lie algebra (tangent space at the unit element). In that representation, transport by projection (or parallel) is the identity.

kellertuer avatar Apr 18 '20 18:04 kellertuer

OK, so the solution seems to be removing the default projection transport and copying it to all manifolds where is works. Or do you have a better idea? Maybe a trait or a separate function?

mateuszbaran avatar Apr 18 '20 19:04 mateuszbaran

No, that would even be my favourite solution to this.

kellertuer avatar Apr 18 '20 19:04 kellertuer

I just revisited this discussion and noticed that by now our default is to embed X first? See

https://github.com/JuliaManifolds/ManifoldsBase.jl/blob/10d930f84c299926775ad4f4d2df63c164abbd41/src/vector_transport.jl#L1176-L1179

and one (just slightly breaking – considered bugfix) thing we could do instead is to just do this for Embedded Manifolds that specify en embedding? But I think the fear with the Lie group might be solved with the embed by now. So I think this issue is resolved?

kellertuer avatar Dec 14 '23 10:12 kellertuer

I think this issue may actually be already resolved by now.

and one (just slightly breaking – considered bugfix) thing we could do instead is to just do this for Embedded Manifolds that specify en embedding?

I don't understand what exactly you want to do here?

mateuszbaran avatar Dec 14 '23 11:12 mateuszbaran

Currently the embed->project retraction works on all manifolds, one could restrict that to all manifolds with the embedded trait? But maybe that also just overcomplicates everything, so I consider this issue resolved :)

kellertuer avatar Dec 14 '23 12:12 kellertuer

No, I don't want to use the traits more like that :fearful:

mateuszbaran avatar Dec 14 '23 13:12 mateuszbaran

That is totally fine. I had some of these nice generic defaults in mind when we designed the traits, but it might sometimes also bee too technical then.

kellertuer avatar Dec 14 '23 13:12 kellertuer