#28916 closed enhancement (fixed)
MixedFormAlgebra  More Flexible Coercions
Reported by:  ghDeRhamSource  Owned by:  

Priority:  major  Milestone:  sage9.1 
Component:  geometry  Keywords:  manifolds, mixedforms 
Cc:  egourgoulhon, tscrim  Merged in:  
Authors:  Michael Jung  Reviewers:  Travis Scrimshaw 
Report Upstream:  N/A  Work issues:  
Branch:  37863df (Commits, GitHub, GitLab)  Commit:  
Dependencies:  Stopgaps: 
Description (last modified by )
This makes the coercion model of mixed forms more robust against modifications regarding differential forms. For instance: As soon as all differential forms of another mixed form have a coerce map, the mixed form has one too. The same now holds for any algebraic element which is coercible into a single differential form.
At this stage, the method degree
is used and special cases are handled separately. But notice that not all coercible objects provide this method (symbolic ring). Or conversely, having this method doesn't mean being coercible into a differential form. Hence this invocation is now entirely avoided.
In particular we have:
sage: M = Manifold(2, 'M') sage: Omega = M.mixed_form_algebra() sage: Omega1 = M.diff_form_module(1) sage: T01 = M.tensor_field_module((0,1)) sage: Omega1.has_coerce_map_from(T01) True
But at this stage:
sage: Omega.has_coerce_map_from(T01) False
With this ticket:
sage: Omega.has_coerce_map_from(T01) True
Change History (23)
comment:1 Changed 16 months ago by
 Branch set to u/ghDeRhamSource/mixedformalgebra___more_flexible_coercions
comment:2 Changed 16 months ago by
 Cc egourgoulhon tscrim added
 Commit set to 4ba780eeb294c0390f3d83f1ffc355802590e018
 Component changed from PLEASE CHANGE to geometry
 Description modified (diff)
 Keywords manifolds mixedforms added
 Status changed from new to needs_review
 Type changed from PLEASE CHANGE to enhancement
comment:3 Changed 16 months ago by
 Commit changed from 4ba780eeb294c0390f3d83f1ffc355802590e018 to 3132acc35ea82346bafe2eecc81ca97f6adf5e2b
Branch pushed to git repo; I updated commit sha1. New commits:
3132acc  Trac 28916: Bugs fixed and code cleaned

comment:4 Changed 16 months ago by
I spared the try...except
block now completely. I think this is a negligible loss of computation time. Also this is more robust and works everytime.
comment:5 Changed 16 months ago by
 Commit changed from 3132acc35ea82346bafe2eecc81ca97f6adf5e2b to 6775b86a3a5c4dd10185bc1e7e2eb25136c31041
Branch pushed to git repo; I updated commit sha1. New commits:
6775b86  Trac 28916: try...except removed

comment:6 Changed 16 months ago by
comment:7 Changed 16 months ago by
Do you have some examples that demonstrates that this change now covers something that it didn't (correctly) do before? If so, please add them to the documentation, but if not, can you give a more detailed explanation as to why you think this is better?
comment:8 Changed 16 months ago by
Fair enough. I'm not sure this change covers even more at this stage.
The only improvement so far: There might be objects with a method degree
which are not coercible into differential forms. Or conversely there are coercible objects without having a degree method (like elements of the symbolic ring). So I avoid invoking degree
completely.
Assume in a future version there come more objects not having a degree
method but are coercible into differential forms (I admit, I have no idea what else it could be). Nevertheless, these cases have to be handled separately now. But with this changes, all potential coercions are covered.
Was that clearer? What do you think about it? And how could I improve my description?
By the way: Merry christmas retrospectively. :)
comment:9 Changed 16 months ago by
 Description modified (diff)
comment:10 Changed 16 months ago by
 Description modified (diff)
 Milestone changed from sage9.0 to sage9.1
comment:11 Changed 16 months ago by
 Commit changed from 6775b86a3a5c4dd10185bc1e7e2eb25136c31041 to ee4ad9352b5ac563b7ea1efde674d423ab8cc9b8
Branch pushed to git repo; I updated commit sha1. New commits:
ee4ad93  Merge branch 'develop' into t/28916/mixedformalgebra___more_flexible_coercions

comment:12 Changed 16 months ago by
Yes, that is more clear, thank you. So can you please add such an example that now coerces that previously did not?
comment:14 Changed 16 months ago by
 Commit changed from ee4ad9352b5ac563b7ea1efde674d423ab8cc9b8 to dc5b909ab4f9fa2c0e5e7b5fff0747b5d92a0508
Branch pushed to git repo; I updated commit sha1. New commits:
dc5b909  Trac #28916: Any iteration

comment:15 Changed 16 months ago by
Thank you, but can you add that example as a doctest?
comment:16 Changed 15 months ago by
 Commit changed from dc5b909ab4f9fa2c0e5e7b5fff0747b5d92a0508 to 37863dffe422080bacb83e930ad22b7c92f92749
Branch pushed to git repo; I updated commit sha1. New commits:
37863df  Trac #28916: Doctest for coerce map added

comment:17 Changed 15 months ago by
Like this or something in more detail?
New commits:
37863df  Trac #28916: Doctest for coerce map added

comment:18 Changed 15 months ago by
 Reviewers set to Travis Scrimshaw
 Status changed from needs_review to positive_review
Yep, exactly. Thank you.
comment:19 Changed 15 months ago by
 Branch changed from u/ghDeRhamSource/mixedformalgebra___more_flexible_coercions to 37863dffe422080bacb83e930ad22b7c92f92749
 Resolution set to fixed
 Status changed from positive_review to closed
comment:20 Changed 15 months ago by
 Branch changed from 37863dffe422080bacb83e930ad22b7c92f92749 to u/ghDeRhamSource/37863dffe422080bacb83e930ad22b7c92f92749
comment:21 Changed 15 months ago by
 Commit changed from 37863dffe422080bacb83e930ad22b7c92f92749 to 36e68ad95ba5be50c6c745d91489211d0d9407cd
Damn it. I thought the tickets are still open...
New commits:
36e68ad  Trac #28916: Merge branch 'develop' into t/28916/mixedformalgebra___more_flexible_coercions

comment:22 Changed 15 months ago by
 Branch changed from u/ghDeRhamSource/37863dffe422080bacb83e930ad22b7c92f92749 to 37863dffe422080bacb83e930ad22b7c92f92749
 Commit 36e68ad95ba5be50c6c745d91489211d0d9407cd deleted
comment:23 Changed 15 months ago by
I hope that is it. Sorry!
This makes the coercion model of mixed forms more robust against modifications regarding differential forms. For instance: As soon as differential forms of every degree have coerce maps, the mixed form has one too.
New commits:
Trac 28916: Flexible coercion of mixed forms