-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
projection onto tangent space to unitary matrices #522
Comments
The currently implemented – and documented version is project(M::OrthogonalMatrices{n}, p, X)
project(M::Rotations{n}, p, X)
project(M::UnitaryMatrices{n}, p, X)
Orthogonally project the tangent vector X ∈ 𝔽^{n × n}, \mathbb F ∈ \{\mathbb R, \mathbb C\} to the tangent space of M at p,
and change the representer to use the corresponding Lie algebra, i.e. we compute
\operatorname{proj}_p(X) = \frac{pX-(pX)^{\mathrm{T}}}{2}, So currently, for OrthogonalMatrices we do not do the isomorphism, but sure your variant would (as the easiest way= be
which keeps X as is, yes. I think we should switch to the isomorphism you mentioned – also because thats nicer for the SO(3) – though we then have to adapt exp. We seem to have changed the default when we unified Unitary/Orthogonal/SpecialOrthogonal/SpecialUnitary about a month ago, sorry for that. I would like to wait for a short feedback from @mateuszbaran ; but the fix is quite easy; for all 4 it is just the one line at
and we just have to remove the |
I checked our old discussion and the reason for this choice is the following: Since The PR I opened now proposes to use pX as a representation for the embedded situation for the manifolds and the Lie algebra (skew hermitian) idea (without the ( And while this is not a bug I can see that this asymmetric usage might be irritating. Your example works correct if you first produce the “embedded tangent vector” pX, that is
|
I see that projections bite again 🙂 . The current design is that embedding and then projecting is supposed to be identity on manifolds. So your example should be: julia> X_proj = project(M, p, embed(M, p, X))
2×2 Matrix{Float64}:
0.0 1.0
-1.0 0.0
julia> println(norm(M, p, X - X_proj))
0.0 Currently the entire differentiation code is written based on the assumption that |
Your explanation makes a lot of sense. Thanks. |
So @mateuszbaran we should keep it as is? I spent a momentanen a PR but it is a little work to change that. |
The one thing that might be irritating here is that both embed and project might change how tangents are represented. So that is why Mateusz explanations better than just claiming project does not change anything on tangent vectors. |
Yes, I think we should keep it as is for now, as changing it would be a lot of work and somewhat breaking. I'd suggest adding a new function that does what is currently handled by embed + project instead of #523 . |
I accidentally closed this one yesterday then I wanted to close the PR; @Nikdwal thanks for noticing this, do you think we should add some documentation to make this more clear? Maybe even to the generic I think the explanation from Mateusz would probably help to be documented somewhere central. |
I don't think that the current implementation of
project(::OrthogonalMatrices, p, X)
works as intended.For any X in the tangent space, the projection should act as the identity operator, but it doesn't do that in this example:
If the tangent space is
T_p M = { pA | A^T = - A }
and it is identified in code with the skew-symmetric matrices through the isomorphism A -> pA, then I think the correct projection should be A -> (A - A^T)/2.The text was updated successfully, but these errors were encountered: