Manifolds.jl
Manifolds.jl copied to clipboard
Provide default basis for `local_metric` functions and make the basis parameter hence optional
Currently local_metric(M, p, B) requires a basis (similarly det_local_metric, inverse_local_metric and jacobian_local_metric). It would be nice (and not too difficult) to provide a reasonable default for this last parameter, e.g. the DefaultOrthogonalBasis().
The only thing one has to take into account is that this has to respect the transparency (similar to retract or vector_transport_to).
I am not 100% sure why I proposed this, since the other functions, like get_vector and get_coordinates also do not have a default for the basis.
So maybe it is not reasonable to have a default?
Otherwise, we should maybe introduce a function similar to default_retraction_method(::AbstractManifold), maybe default_tangent_bases(::AbstractManifold)? I would do that in base and use it for other methods as well – but it might be a fight with transparency anyways.
Things like det_local_metric are not sensitive to change of basis so it would make sense to add a method that doesn't take a basis but overall this seems like a low priority issue. Anyway adding variants that don't take the basis seems like a lot of work for very little benefit.
Otherwise, we should maybe introduce a function similar to
default_retraction_method(::AbstractManifold), maybedefault_tangent_bases(::AbstractManifold)? I would do that in base and use it for other methods as well – but it might be a fight with transparency anyways.
DefaultBasis should usually be the default_tangent_basis for any manifold. We could prefer a different one sometimes but before touching bases I'd prefer to refactor them like here: https://github.com/JuliaManifolds/ManifoldsBase.jl/issues/88 . I've tried doing that for an hour or so and things like ProductManifold were quite troublesome to deal with. Some ambiguities still remain, mostly because ProductManifold actually introduces complex logic there but I'd expect there to be much less ambiguity fighting.
ok, so we can go for `DefaultBasis, sure. But should this issue wait for the base one to be finished?
I personally wouldn't do any restructuring around bases without solving that ManifoldsBase issue first, at least the part relevant to bases.
ok, then lets wait with this one until the other is finished.