Tangent/Cotangent bundles in Manifolds.jl

What would be the canonical way to represent a cotangent vector with Manifolds.jl? As far as I can see, there is no space for T \mathcal{M} or T^* \mathcal{M}, hence the canonical representation would be a tuple (pt, vec)? Is there a way to give the vec the information if it is tangent or cotangent? I only found Atlases and charts · Manifolds.jl.

Part of my question is because I have functions \varphi: T^* \mathcal{M} \to T^* \mathcal{M} which I want to differentiate (but I mostly care about \mathbb{R}^n so the question is more curiosity driven).

(I’m totally fine with the answer: keep track of it yourself which is practical enough, just want to make sure I don’t overlook anything :slight_smile: )

Hm, not sure I know of any way of tracking that object, I guess you could always create a new manifold type for it specifically as the union of the two spaces.

For the actual differentiation part, have you checked out ManifoldDiff.jl?

Well, we do have the tangent bundle, and yes on there you would use tuples (p, X) to represent points, and in principle X could of course be typed as Atlases and charts · Manifolds.jl for cotangent vectors.

Beyond that I think we simply did not yet have the need nor any one formalising these aspects on manifolds much more. For my applications in optimization I for now always only needed tangent vectors; for the one case of the vector bundle newton we rephrased it (via sharp/flat) as a tangent bundle problem before implementing.

If you need more, it is probably best to either discuss that here or in a new issue in Manifolds.jl so we can help you implement / draft what you need.