Opened 2 years ago
Closed 2 years ago
#30267 closed defect (fixed)
Coercion via restriction of chart functions
Reported by:  Michael Jung  Owned by:  

Priority:  major  Milestone:  sage9.2 
Component:  manifolds  Keywords:  
Cc:  Eric Gourgoulhon, Travis Scrimshaw  Merged in:  
Authors:  Michael Jung  Reviewers:  Travis Scrimshaw, Eric Gourgoulhon 
Report Upstream:  N/A  Work issues:  
Branch:  d494bbd (Commits, GitHub, GitLab)  Commit:  d494bbd912c42ca2386664c597b15de117dd52a9 
Dependencies:  Stopgaps: 
Description
At this stage, scalar fields (and tensor fields) support coercions via restrictions:
sage: M = Manifold(2, 'M') sage: c.<x,y> = M.chart() sage: D = M.open_subset('D') sage: A = M.scalar_field_algebra(); A_D = D.scalar_field_algebra() sage: A_D.has_coerce_map_from(A) True
But the chart function ring does not support that coercion, even for derived charts:
sage: c_D = c.restrict(D, x^2+y^2<1) sage: R = c.function_ring(); R_D = c_D.function_ring() sage: R_D.has_coerce_map_from(R) False
Consequently, this should be treated the same way as scalar fields since chart functions are the very foundation of scalar fields.
I suggest we add that coercion in case one chart (here c_D
) is the restriction of the other (here c
).
Change History (10)
comment:1 Changed 2 years ago by
Authors:  → Michael Jung 

Status:  new → needs_review 
comment:2 Changed 2 years ago by
Branch:  → u/ghmjungmath/coercion_via_restriction_of_chart_functions 

comment:3 Changed 2 years ago by
Commit:  → 4bcd2eeb367909eef66de8f0390f4fa7abea22c9 

comment:4 Changed 2 years ago by
Reviewers:  → Travis Scrimshaw 

Status:  needs_review → positive_review 
LGTM.
comment:6 followup: 8 Changed 2 years ago by
Thanks for this ticket. May I suggest to correct a typo:
 The ring of all chart function w.r.t. to a chart:: + The ring of all chart functions w.r.t. to a chart::
comment:7 Changed 2 years ago by
Commit:  4bcd2eeb367909eef66de8f0390f4fa7abea22c9 → d494bbd912c42ca2386664c597b15de117dd52a9 

Status:  positive_review → needs_review 
Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:
d494bbd  Trac #30267: docstring typo fixed

comment:8 Changed 2 years ago by
Replying to egourgoulhon:
Thanks for this ticket. May I suggest to correct a typo:
 The ring of all chart function w.r.t. to a chart:: + The ring of all chart functions w.r.t. to a chart::
Done. Thank you.
comment:9 Changed 2 years ago by
Reviewers:  Travis Scrimshaw → Travis Scrimshaw, Eric Gourgoulhon 

Status:  needs_review → positive_review 
comment:10 Changed 2 years ago by
Branch:  u/ghmjungmath/coercion_via_restriction_of_chart_functions → d494bbd912c42ca2386664c597b15de117dd52a9 

Resolution:  → fixed 
Status:  positive_review → closed 
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
Trac #30267: coercion via restriction added