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

norm for MetricManifold calls inner of base manifold #539

Closed
sethaxen opened this issue Oct 4, 2022 · 3 comments · Fixed by #540
Closed

norm for MetricManifold calls inner of base manifold #539

sethaxen opened this issue Oct 4, 2022 · 3 comments · Fixed by #540
Labels
bug Something isn't working

Comments

@sethaxen
Copy link
Member

sethaxen commented Oct 4, 2022

norm for MetricManifold should call inner for that same manifold, but it instead seems to call inner from the base manifold. e.g.

julia> using Manifolds

julia> struct SomeMetric <: RiemannianMetric end

julia> Manifolds.inner(::MetricManifold{ℝ,<:AbstractManifold{ℝ},SomeMetric}, p, X, Y) = 3

julia> M = Sphere(2);

julia> p = project(M, randn(3));

julia> X = project(M, p, randn(3));

julia> inner(MetricManifold(M, SomeMetric()), p, X, X) # expected: 3
3

julia> norm(MetricManifold(M, SomeMetric()), p, X)^2  # expected: 3
3.6649191335512095

julia> norm(X)^2
3.6649191335512095
@sethaxen sethaxen added the bug Something isn't working label Oct 4, 2022
mateuszbaran added a commit that referenced this issue Oct 4, 2022
@mateuszbaran mateuszbaran mentioned this issue Oct 4, 2022
@mateuszbaran
Copy link
Member

Weird that it wasn't discovered earlier, @kellertuer I think #540 should be the best way to fix it (embedding type should not be forwarded when the metric is not default).

@kellertuer
Copy link
Member

That's really strange, especially since MetricManifold is meant to (among others) have these alternatives for inner, but how much is inner than different from exp/log where this definitely already worked?

@mateuszbaran
Copy link
Member

I've replied regarding differences in #540 (comment) .

mateuszbaran added a commit that referenced this issue Oct 5, 2022
* Fix #539

* address review, bump version

* small improvement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants