Closed egourgoulhon closed 4 years ago
New commits:
013fb8b | Add construction of a vector frame from a family of vector fields |
Commit: 013fb8b
Description changed:
---
+++
@@ -14,7 +14,7 @@
sage: (e[0], e[1]) == (e0, e1)
True
-Previously, the only way to introduce the vector frame e
was to first introduce an automorphism relating the frame (d/dx, d/dy)
to (e0, e1)
and to pass this automorphism to VectorFrame.new_frame()
:
+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()
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
.
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.
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...
Replying to @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.
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.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.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.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.
Description changed:
---
+++
@@ -1,11 +1,11 @@
-This ticket introduces the keyword argument `from_family` to `DifferentiableManifold.vector_frame()` to allow for constructing a vector frame from a spanning family of linearly independent vector fields:
+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', from_family=(e0, e1)); e +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 @@ -21,6 +21,6 @@ sage: aut[:] = [[e0[0], e1[0]], [e0[1], e1[1]]] sage: e = X.frame().new_frame(aut, 'e')
-The introduction of `from_family` in `vector_frame()` simplifies this process.
+
**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.
Do you agree with the above changes (comment:9)?
Partially. Of course, we can postpone this to another ticket, preferrably to #28718. However, I think this fits in here perfectly well and enables the feature for vector bundles in Sage 9.0 without too much effort [1] as you already did it for the tensor bundle. But I have no strong opinion on that so just do as you prefer.
One personal reformulation:
- any connection with previously defined vector frames or vector fields
- (the connection can be performed later via the method
+ connecting it to previously defined vector frames or vector fields
+ (this can still be performed later via the method
[1] at least so far as I can see
Branch pushed to git repo; I updated commit sha1. New commits:
6635fad | Construction of a local frame on a vector bundle from a family of sections |
Replying to @DeRhamSource:
Partially. Of course, we can postpone this to another ticket, preferrably to #28718. However, I think this fits in here perfectly well and enables the feature for vector bundles in Sage 9.0 without too much effort [1] as you already did it for the tensor bundle.
OK I've done it in the above commit. I've also improved the catching of the error in case of linearly dependent elements.
One personal reformulation:
- any connection with previously defined vector frames or vector fields - (the connection can be performed later via the method + connecting it to previously defined vector frames or vector fields + (this can still be performed later via the method
Done as well.
Thank you so much! I'll give it a further look this or tomorrow afternoon.
It seems, we are at beta6 now.
I gave it some short tests. This is a huge improvement for using frames! Thanks! :)
Just a minor thing:
- ``self`` (`n` being the dimension of ``self``) defining the local
+ ``self`` (`n` being the rank of ``self``) defining the local
Apart from that it looks fine to me. As soon as you merged the recent develop branch into this one and patchbot says "yes", I could give it a positive review. Travis?
Replying to @DeRhamSource:
Just a minor thing:
- ``self`` (`n` being the dimension of ``self``) defining the local + ``self`` (`n` being the rank of ``self``) defining the local
Thanks for pointing this; it is corrected in the above commit.
There is one thing I'm not sure about. Namely the line:
mat = [[c[[i]] for c in comps] for i in fmodule.irange()]
aut.add_comp(basis)[:] = mat
this --> aut.add_comp(self)[:] = mat
fmodule.set_change_of_basis(basis, self, aut)
in free_module_basis.py
.
Shouldn't it be the identity matrix with respect to that basis? Or did I get something wrong?
Replying to @DeRhamSource:
There is one thing I'm not sure about. Namely the line:
mat = [[c[[i]] for c in comps] for i in fmodule.irange()] aut.add_comp(basis)[:] = mat this --> aut.add_comp(self)[:] = mat fmodule.set_change_of_basis(basis, self, aut)
in
free_module_basis.py
.Shouldn't it be the identity matrix with respect to that basis? Or did I get something wrong?
The formula is correct: it should not be the identity matrix but the matrix of the change-of-basis automorphism, which has the same expression in both bases.
Replying to @egourgoulhon:
The formula is correct: it should not be the identity matrix but the matrix of the change-of-basis automorphism, which has the same expression in both bases.
Yeah, you're absolutely right. I thought it through once again and come to the same conclusion now. Furthermore, some tests on this did work properly. Sorry!
So from my perspective, everything is fine. I'll give it a positive review.
Reviewer: Michael Jung
Thank you for the review!
Merge conflict
Replying to @vbraun:
Merge conflict
There is no conflict with the just released 9.0.beta7. Is it a conflict with #27784 (which is not merged yet)?
Replying to @egourgoulhon:
Replying to @vbraun:
Merge conflict
There is no conflict with the just released 9.0.beta7. Is it a conflict with #27784 (which is not merged yet)?
Not sure. But to run some tests for my thesis, I merged these two tickets and a conflict occured. Just a very minor thing about lines if I remember correctly.
However, either ticket needs to be merged to be certain.
Replying to @DeRhamSource:
Replying to @egourgoulhon:
Replying to @vbraun:
Merge conflict
There is no conflict with the just released 9.0.beta7. Is it a conflict with #27784 (which is not merged yet)?
Not sure. But to run some tests for my thesis, I merged these two tickets and a conflict occured. Just a very minor thing about lines if I remember correctly.
Yes most of the time these conflicts due to various developments performed in parallel are very minor and easy to solve.
However, either ticket needs to be merged to be certain.
Yes. I am afraid we have to wait for the next beta to solve this...
Since you basically know what ticket, I would just merge that in and set this back to positive review with that as a dependency.
Replying to @tscrim:
Since you basically know what ticket, I would just merge that in and set this back to positive review with that as a dependency.
Good idea. I'll do that for #27784. I need to add a minor thing into the documentation of characteristic classes anyway.
Replying to @DeRhamSource:
Replying to @tscrim:
Since you basically know what ticket, I would just merge that in and set this back to positive review with that as a dependency.
Good idea. I'll do that for #27784. I need to add a minor thing into the documentation of characteristic classes anyway.
Done.
Replying to @DeRhamSource:
Replying to @DeRhamSource:
Replying to @tscrim:
Since you basically know what ticket, I would just merge that in and set this back to positive review with that as a dependency.
Good idea. I'll do that for #27784. I need to add a minor thing into the documentation of characteristic classes anyway.
Done.
Thanks!
I am then setting this ticket back to positive review and will have a look at #27784.
According to comment:29.
Changed branch from public/manifolds/vector_frame_from_family-28716 to 81e2f60
This ticket modifies
DifferentiableManifold.vector_frame()
to allow for constructing a vector frame from a spanning family of linearly independent vector fields: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 toVectorFrame.new_frame()
: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 methodFreeModuleBasis._init_from_family()
, in order to be used inDifferentiableManifold.vector_frame()
as well.CC: @tscrim
Component: geometry
Keywords: vector_frame
Author: Eric Gourgoulhon
Branch/Commit:
81e2f60
Reviewer: Michael Jung
Issue created by migration from https://trac.sagemath.org/ticket/28716