Opened 3 years ago

Last modified 3 years ago

#28716 closed enhancement

Construction of a vector frame from a family of vector fields — at Version 9

Reported by: egourgoulhon Owned by:
Priority: major Milestone: sage-9.0
Component: geometry Keywords: manifolds, vector_frame
Cc: tscrim Merged in:
Authors: Eric Gourgoulhon Reviewers:
Report Upstream: N/A Work issues:
Branch: public/manifolds/vector_frame_from_family-28716 (Commits, GitHub, GitLab) Commit: d0ef4d77e44422e25fbdfbc90e9c852387a15033
Dependencies: Stopgaps:

Status badges

Description (last modified by egourgoulhon)

This ticket modifies DifferentiableManifold.vector_frame() to allow for constructing a vector frame from a spanning family of linearly independent vector fields:

sage: M = Manifold(2, 'M')
sage: X.<x,y> = M.chart()
sage: e0 = M.vector_field(1+x^2, 1+y^2)
sage: e1 = M.vector_field(2, -x*y)
sage: e = M.vector_frame('e', (e0, e1)); e
Vector frame (M, (e_0,e_1))
sage: e[0].display()
e_0 = (x^2 + 1) d/dx + (y^2 + 1) d/dy
sage: e[1].display()
e_1 = 2 d/dx - x*y d/dy
sage: (e[0], e[1]) == (e0, e1)
True

Previously, the only way to introduce the vector frame e was to first introduce the automorphism relating the frame (d/dx, d/dy) to (e0, e1) and to pass this automorphism to VectorFrame.new_frame():

sage: aut = M.automorphism_field()
sage: aut[:] = [[e0[0], e1[0]], [e0[1], e1[1]]]
sage: e = X.frame().new_frame(aut, 'e')

Implementation details: such functionality already existed for bases of finite rank free modules; the relevant code is extracted from the method FiniteRankFreeModule.basis() and put into the new method FreeModuleBasis._init_from_family(), in order to be used in DifferentiableManifold.vector_frame() as well.

Change History (9)

comment:1 Changed 3 years ago by egourgoulhon

  • Branch set to public/manifolds/vector_frame_from_family-28716
  • Commit set to 013fb8b665adaf1339372c457fca851246d30a3c

New commits:

013fb8bAdd construction of a vector frame from a family of vector fields

comment:2 Changed 3 years ago by egourgoulhon

  • Cc tscrim added
  • Status changed from new to needs_review

comment:3 Changed 3 years ago by egourgoulhon

  • Description modified (diff)

comment:4 follow-up: Changed 3 years ago by tscrim

Do we need the optional parameter? Basically, can we just use the fact that a tuple/list is being given and then assume it is suppose to be a family of vector fields? If it has to be a keyword, I would change from_family to the more descriptive from_vector_fields.

comment:5 follow-up: Changed 3 years ago by gh-DeRhamSource

This is a great idea and would be very useful for vector bundles, too. Sometimes I got really annoyed by this detour. Would you mind to adapt your code, if working, for vector bundles as-well?

By the way: We should combine vector bundles and the previous implementations really really soon (in this case inherit vector frames from local frames) otherwise things could get extremly messy.

Unfortunately, I am quite busy working at my master thesis right now. I can almost feel the deadline touching my skin. I promise to work on that as soon as I've gained some time back.

Even though I don't have the time now, I've opened the corresponding ticket #28718, just to keep this task in mind.

Last edited 3 years ago by gh-DeRhamSource (previous) (diff)

comment:6 in reply to: ↑ 4 Changed 3 years ago by egourgoulhon

Replying to tscrim:

Thanks for your prompt feedback.

Do we need the optional parameter? Basically, can we just use the fact that a tuple/list is being given and then assume it is suppose to be a family of vector fields?

Good idea, this is much more user-friendly! I am on it...

comment:7 in reply to: ↑ 5 Changed 3 years ago by egourgoulhon

Replying to gh-DeRhamSource:

This is a great idea and would be very useful for vector bundles, too. Sometimes I got really annoyed by this detour.

Yes, this should have been done sooner...

Would you mind to adapt your code, if working, for vector bundles as-well?

OK, I'll try to do this (see below).

By the way: We should combine vector bundles and the previous implementations really really soon (in this case inherit vector frames from local frames) otherwise things could get extremly messy.

Yes, I agree. Note however that this ticket does not touch the class VectorFrame, only the user interface DifferentiableManifold.vector_frame(). I'll perform a similar change to the interfaces TopologicalVectorBundle.local_frame() and TensorBundle.local_frame().

Unfortunately, I am quite busy working at my master thesis right now. I can almost feel the deadline touching my skin.

Good luck with your master thesis!

I promise to work on that as soon as I've gained some time back. Even though I don't have the time now, I've opened the corresponding ticket #28718, just to keep this task in mind.

Thanks.

comment:8 Changed 3 years ago by git

  • Commit changed from 013fb8b665adaf1339372c457fca851246d30a3c to d0ef4d77e44422e25fbdfbc90e9c852387a15033

Branch pushed to git repo; I updated commit sha1. New commits:

71b5f0fReplace keyword argument 'from_family' by positional argument in vector_frame()
d0ef4d7Add construction of a local frame from a set of vector fields in TensorBundle.local_frame()

comment:9 Changed 3 years ago by egourgoulhon

  • Description modified (diff)

In the latest version (cf. comment:8 commits)

  • vector_frame() accepts a tuple/list of vector fields as a positional argument, the keyword argument from_family being suppressed, following the suggestion made in comment:4.
  • The ZeroDivisionError that occurs if the vector fields are not linearly independent (the exception is raised when computing the inverse of the automorphism relating the new frame to a previous one) is cached with a proper error message.
  • The documentation of the module sage.manifolds.differentiable.vectorframe has been updated to take into account the new functionality.
  • TensorBundle.local_frame() has been updated to offer the same functionality, following comment:5.
  • A TODO section has been added to TopologicalVectorBundle.local_frame() for implementing a similar functionality with local sections in the future.

I propose to stay here for this ticket, i.e. to let the modification of TopologicalVectorBundle.local_frame() to a future ticket (#28718 ?). This is mostly to avoid code duplication with DifferentiableManifold.vector_frame(), waiting for a clearer view of #28718. Besides, I will be extremely busy in the coming weeks and I would like very much the vector_frame() functionality introduced in the current ticket to make its way in Sage 9.0.

Note: See TracTickets for help on using tickets.