Opened 2 years ago
Closed 2 years ago
#29953 closed enhancement (fixed)
Let diff() act on chart functions and differentiable forms
Reported by: | Eric Gourgoulhon | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-9.2 |
Component: | geometry | Keywords: | |
Cc: | Travis Scrimshaw | Merged in: | |
Authors: | Eric Gourgoulhon | Reviewers: | Travis Scrimshaw |
Report Upstream: | N/A | Work issues: | |
Branch: | f5b9831 (Commits, GitHub, GitLab) | Commit: | f5b983168993909a0ba713d4b72a8c33fc23dcc2 |
Dependencies: | Stopgaps: |
Description (last modified by )
In Sage 9.1, we have
sage: M = Manifold(2, 'M') sage: X.<x,y> = M.chart() sage: f = X.function(x^2*y) sage: f.diff(x) 2*x*y sage: diff(f, x) ... NotImplementedError:
Similarly, if one tries to apply diff
to get the exterior derivative of a differentiable form, one gets an error:
sage: a = M.one_form(-y, x) sage: a.display() -y dx + x dy sage: diff(a) ... TypeError: unable to convert 1-form on the 2-dimensional differentiable manifold M to a symbolic expression
With the code implemented in this ticket, we get
sage: diff(f, x) 2*x*y sage: type(diff(f,x)) <class 'sage.manifolds.chart_func.ChartFunctionRing_with_category.element_class'>
and
sage: diff(a) 2-form on the 2-dimensional differentiable manifold M sage: diff(a).display() 2 dx/\dy sage: diff(a) is a.exterior_derivative() True
To achieve this, the modification of the code reduces to
- rename
ChartFunction.diff
toChartFunction.derivative
, makingdiff
an alias for the methodderivative
- add the alias
derivative
for the methodDiffForm.exterior_derivative
- add the alias
derivative
for the methodDiffScalarField.differential
Change History (5)
comment:1 Changed 2 years ago by
Branch: | → public/manifolds/diff_functions_forms |
---|---|
Cc: | Travis Scrimshaw added |
Commit: | → f5b983168993909a0ba713d4b72a8c33fc23dcc2 |
Status: | new → needs_review |
comment:2 Changed 2 years ago by
Description: | modified (diff) |
---|
comment:3 Changed 2 years ago by
Reviewers: | → Travis Scrimshaw |
---|---|
Status: | needs_review → positive_review |
LGTM.
comment:5 Changed 2 years ago by
Branch: | public/manifolds/diff_functions_forms → f5b983168993909a0ba713d4b72a8c33fc23dcc2 |
---|---|
Resolution: | → fixed |
Status: | positive_review → closed |
Note: See
TracTickets for help on using
tickets.
New commits:
diff() acting on chart functions and differentiable forms