Closed mateuszbaran closed 6 months ago
This looks very nice! Thanks for adapting that.
If the test coverage is fine, I am ok with this.
Question: should sectional_curvature
return 0 for non-linearly independent vectors X
, Y
or be undefined? Making it 0 makes it much easier to define sectional_curvature
on power and product manifolds but makes it harder to properly define the generic fallback that uses riemann_tensor
.
Why is that harder for the Riemannian tensor? I would have thought it is either undefined or zero.
The formula inner(M, p, R, X) / ((norm(M, p, X)^2 * norm(M, p, Y)^2) - (inner(M, p, X, Y)^2))
is 0 / 0
when X
and Y
are linearly dependent. We can either detect this situation and return 0 (which requires adding a cut-off due to numerical inaccuracy) or say "don't use linearly dependent vectors".
I think the clearer way would be “we do not use linearly dependent vectors”?
That's how it currently works.
Ah, yes. I see. And it is also well-documented that way. I think it is ok to keep it that way.
OK, then we need a test for linear independence in sectional_curvature
of ProductManifold
. I don't really have a nice idea for that, maybe something like norm(M, p, X) < eps(...) || norm(M, p, Y) < eps(...) || isapprox(inner(M, p, X, Y), norm(M, p, X)*norm(M, p, Y)) || isapprox(inner(M, p, X, Y), -norm(M, p, X)*norm(M, p, Y))
?
Or we can just leave that not implemented for now.
I would thoroughly document that we assume they are linearly independent – and for now not implement a check.
It doesn't work for product manifolds though. You may have two vectors that are linearly independent, but their projections on one or more of the component manifolds are not linearly independent, so that needs to be handled somewhere since sectional curvature for them is well-defined.
But then one could check that on every “manifold factor” and only add that to the min if they are linearly independent and ignore them otherwise?
Yes, that's what would be needed.
This looks good so far. I am just missing the good old code coverage – did we miss to update the GitHub action? I remember something like this in a recent PR either on Manopt or Manifolds as well that I had to specifically add the secret (again) to the action.
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 99.96%. Comparing base (
b7665ae
) to head (08abaef
). Report is 1 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Right, I somehow didn't notice the lack of coverage report. It works now. I think we can merge this now?
Adapted from Manopt.jl, with added functions for lower and upper bounds.