-
Notifications
You must be signed in to change notification settings - Fork 55
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
Atlases and charts #325
Atlases and charts #325
Conversation
Concerning |
Well, I'm currently leaning towards making functions/functors the default cotangent vector representation (see #261 ), and arrays of coefficients as an alternative. Then flat and sharp have many possible variants, depending on received and target representation of tangent and cotangent vectors. Some problems would be solved by storing the basis in |
That sounds reasonable, too. Looking forward to seeing that sketch :) |
|
Looks nice to me; just a question that came to my mind: Is there or could we introduce a way to automatically convert array<->Vector? In all other parts of the package we do not constrain tangent vectors, but here we do. Maybe that's necessary, I am not yet 100% sure, but it would be nice if those could work easily, i.e. with auto conversion. |
There are a few separate issues.
What do you mean by array <-> vector conversion? Conversion between the default representation of a tangent vector and a vector of its coefficients in a basis? Any such conversion requires manifold and a point which are always stored separately.
I'd say that all other parts of the package don't really support |
Currently we often have But due to the duality pairing I sometimes think the same array representation (i.e. not yet a coordinate vector in a basis) as for tangents should be possible for cotangents. And it would be nice to have an array typed function for them as well? It maps to some default of course, as does the flat with an array Again this is just to help users enter our regime of the sharp/flat world, which I really like to have, since I think there is no package yet doing that rigorously. |
Yes, you can just put an array in
Could you give an example of what for example |
Thanks, that's already great. For sharp I was thinking of the following: If you have X in some TpM on S2, then you can take (in the embedding, R3), So if that such a default is not too dangerous, I think using that (similar to the flat case) would be nice for users stating here. |
For now I've removed |
Furthermore for
and the corresponding inverse local metric you should add a test. |
Finally edit: |
I hopefully finished this nearly – see the two remarks at the code. Can we call
So similar to |
Yes, this makes sense 👍 .
I haven't exported
For power and product we should have many more metric-related tests and functionality anyway. I could delete them for now.
Thanks for your help! I'll take a look at your remarks.
I'm afraid of method ambiguities this may introduce so I'd prefer to keep |
Oh I think I broke something else. I think concerning test coverage just the power/product issues are left, I hope I got the rest. Concerning the function names – uff – that‘s a difficult decision, because currently it is really asymmetric with get_coordinates and get_point_coordinates, I really dislike that, but I see your point, too, for sure. |
Which would affect base and also is not a nice name, hm? I am really unsure what to do there. |
Well now, since it has a test, it is. |
Ah, that's OK 🙂 . |
Oh no, it looks like metric functions have wrong propagation: julia> local_metric(M1, [1.0, 0.0, 0.0], B)
ERROR: MethodError: no method matching local_metric(::Euclidean{Tuple{3}, ℝ}, ::Vector{Float64}, ::DefaultOrthonormalBasis{ℝ, ManifoldsBase.TangentSpaceType})
Closest candidates are:
local_metric(::Euclidean, ::Any, ::InducedBasis{𝔽, ManifoldsBase.TangentSpaceType, var"#s116", TI} where {var"#s116"<:RetractionAtlas, TI}) where 𝔽 at /home/mateusz/.julia/dev/Manifolds/src/manifolds/Euclidean.jl:298
local_metric(::AbstractDecoratorManifold, ::Any, ::AbstractBasis; kwargs...) at /home/mateusz/.julia/dev/ManifoldsBase/src/DecoratorManifold.jl:358
local_metric(::MetricManifold{𝔽, var"#s116", EuclideanMetric} where var"#s116"<:AbstractManifold, ::Any, ::InducedBasis{𝔽, ManifoldsBase.TangentSpaceType, var"#s115", TI} where {var"#s115"<:RetractionAtlas, TI}) where 𝔽 at /home/mateusz/.julia/dev/Manifolds/src/manifolds/Euclidean.jl:291
...
Stacktrace:
[1] local_metric__transparent(M::Sphere{2, ℝ}, p::Vector{Float64}, B::DefaultOrthonormalBasis{ℝ, ManifoldsBase.TangentSpaceType}; kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Manifolds ~/.julia/dev/ManifoldsBase/src/DecoratorManifold.jl:377
[2] local_metric__transparent(M::Sphere{2, ℝ}, p::Vector{Float64}, B::DefaultOrthonormalBasis{ℝ, ManifoldsBase.TangentSpaceType})
@ Manifolds ~/.julia/dev/ManifoldsBase/src/DecoratorManifold.jl:377
[3] local_metric(M::Sphere{2, ℝ}, p::Vector{Float64}, B::DefaultOrthonormalBasis{ℝ, ManifoldsBase.TangentSpaceType}; kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Manifolds ~/.julia/dev/ManifoldsBase/src/DecoratorManifold.jl:363
[4] local_metric(M::Sphere{2, ℝ}, p::Vector{Float64}, B::DefaultOrthonormalBasis{ℝ, ManifoldsBase.TangentSpaceType})
@ Manifolds ~/.julia/dev/ManifoldsBase/src/DecoratorManifold.jl:359
[5] top-level scope
@ REPL[33]:1 |
Anyway, maybe we should just return |
I've removed these two methods for now, they are not that easy to fix and we can always add them back later. |
Ok, that‘s also fine with me. |
Ok, fine. Since I am still unsure about the coordinate naming, let‘s for now just keep it as it is. So then, as far as I see we could merge this? |
Yes, I think we can merge this 🎉 . |
This is supposed to provide minimal support for atlases and charts, mainly aimed at solving out current problems with metric manifold being inconsistent about it. This should solve #6 .
One point where I'm not sure what to do is
flat
andsharp
. We don't have any specific representation of cotangent vectors. They can be represented by either functions, functors or coordinates in a basis of the cotangent space, andManifolds.jl/src/manifolds/MetricManifold.jl
Lines 336 to 345 in 77aecb4
FVector
but I'd like to hear your opinion.