Skip to content
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

Inconsistency in invariant metrics #471

Open
mateuszbaran opened this issue May 7, 2022 · 2 comments
Open

Inconsistency in invariant metrics #471

mateuszbaran opened this issue May 7, 2022 · 2 comments
Labels
LieGroups(.jl) issues related to Lie groups (probably transitioning to LieGroups.jl at some point) restructure small issue ... hopefully

Comments

@mateuszbaran
Copy link
Member

Currently invariant metrics on groups are somewhat inconsistent: inner continues dispatch with traits without unwrapping the manifold while exp and log unwrap and run trait dispatch from scratch. This should be consistent.

@mateuszbaran mateuszbaran mentioned this issue May 7, 2022
12 tasks
@mateuszbaran
Copy link
Member Author

Related: bases for invariant metrics:

for (invtrait, invdir) in
    [(HasLeftInvariantMetric, LeftAction), (HasRightInvariantMetric, RightAction)],
    basis_type in [DefaultOrthonormalBasis, DefaultOrthogonalBasis]

    eval(
        quote
            function get_coordinates(
                ::TraitList{$invtrait},
                M::AbstractDecoratorManifold,
                p,
                X,
                B::$basis_type,
            )
                Xₑ = inverse_translate_diff(M, p, p, X, $invdir())
                return get_coordinates(M.manifold, p, Xₑ, B)
            end
            function get_coordinates!(
                ::TraitList{$invtrait},
                M::AbstractDecoratorManifold,
                c,
                p,
                X,
                B::$basis_type,
            )
                Xₑ = inverse_translate_diff(M, p, p, X, $invdir())
                return get_coordinates!(M.manifold, c, p, Xₑ, B)
            end

            function get_vector(
                ::TraitList{$invtrait},
                M::AbstractDecoratorManifold,
                p,
                c,
                B::$basis_type,
            )
                Xₑ = get_vector(M.manifold, p, c, B)
                return translate_diff(M, p, p, Xₑ, $invdir())
            end
            function get_vector!(
                ::TraitList{$invtrait},
                M::AbstractDecoratorManifold,
                X,
                p,
                c,
                B::$basis_type,
            )
                Xₑ = get_vector(M.manifold, p, c, B)
                return translate_diff!(M, X, p, p, Xₑ, $invdir())
            end
        end,
    )
end

@mateuszbaran
Copy link
Member Author

I think in general we just shouldn't dispatch on specific traits, and just use them for forwarding of specific functions. This part works reasonably well. Dispatching on traits allows for some nice fallback definitions but it is just too convoluted.

@kellertuer kellertuer added the LieGroups(.jl) issues related to Lie groups (probably transitioning to LieGroups.jl at some point) label Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LieGroups(.jl) issues related to Lie groups (probably transitioning to LieGroups.jl at some point) restructure small issue ... hopefully
Projects
None yet
Development

No branches or pull requests

2 participants