-
-
Notifications
You must be signed in to change notification settings - Fork 453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding support for differential forms #9650
Comments
comment:2
Wow, thanks! I'm not an expert in differential geometry, so I'm going to have to rely on someone else to vet the theoretical design at this level. Here are a few python comments, though:
I also added mention of two other mma packages to the wiki page, one of which has a nice Integral command. Do you see us getting a command that can integrate like the following commands indicate?
|
comment:3
Also, if you feel like the patch is to the point that it needs review, please change the status below to "needs review". |
comment:5
Thanks for the comments, which not only improved the patch but my Python knowledge as well! I've updated the patch in the meantime. Thanks also for guiding me through the sage patch process! Some quick comments and questions:
|
comment:7
I'm going to set the patch to "needs review", firstly since as burcin pointed out in a private email, the licensing situation of the mathematica package is somewhat unclear, and secondly the implementation of the differential forms class is sufficiently simple so that the issue won't be with the algorithms that I used but rather whether this is good sage programming. Some things to keep in mind: right now, the way to create a differential form is as follows: first you create a !
Let me know if this construction is confusing or can be simplified in any way. |
comment:8
Oops: inside of triple-braces, things are quoted literally:
|
Changed author from jvkersch to Joris Vankerschaver |
comment:13
To placate
messages, could you add an empty Also, if you'd like to document your new modules in the reference manual, you can add
and create $ cd SAGE_ROOT
$ ./sage -b
$ ./sage -docbuild reference html -j Sphinx should print warnings about any docstring formatting problems. The results will be in
|
Work Issues: init.py, documentation warnings, gens() |
Reviewer: Niles Johnson |
comment:14
Hi Joris, I saw your e-mail to I ran a complete doctest of the sage library, and tested building the documentation, as well as playing with a few examples. Here are some notes
|
comment:15
the first point is about |
comment:16
oh, and doctest coverage is at 100% for each of the 3 files! |
comment:17
Hi Niles and Mitesh, Thank you for your instructive comments. Niles, thanks also for agreeing to review my patch! The suggestion to include this functionality to the reference manual was especially helpful -- it makes everything so much clearer to see the documentation in nice, crisp HTML form. I implemented the changes you suggested (adding to the reference manual, adding authors, making
|
comment:18
Replying to @jvkersch:
Done.
A peculiarity of Mercurial is that it can't check in empty files. So usually we'll add either a space, or a comment like:
or something like that.
Personally, I'm okay with "tensor", since "differential_forms" would be equally confusing to my calc 3 students, so (a) there will be a learning curve anyway, and (b) most functions students would use are probably going to be imported into the top-level namespace anyway. |
comment:19
Replying to @jasongrout:
Thanks a lot for pointing that out -- this is really helpful! I've updated the patch with the |
comment:20
It looks like the top of coordinate_patch.py is repeated around line 232. Was that intentional? |
comment:21
In fact, it looks like the entire content of coordinate_patch.py is duplicated, starting around line 232 of that file. |
Changed work issues from init.py, documentation warnings, gens() to documentation formatting, duplicates in coordinate_patch.py |
comment:29
Hi Marshall and Niles, Thanks for testing the patch. I never would have expected this behavior, so I'm glad it comes out now, thanks!! I followed Niles' suggestion and added a More generally, Marshall's issue uncovers something strange having to do with coercion into the symbolic ring:
I.e, if I coerce Let me know what you guys think -- for now I'll leave this as needs_work. |
comment:30
Think of SR as a wrapper around any python object. For example, continuing from your example above
I think it's fine to let the explicit conversion SR(q) work---by default, explicitly converting to SR just wraps the object as above, and I think is supported for every Sage object, whether or not it makes "sense". Do you see someplace that the conversion to an SR object is implicit? That would be a problem. |
comment:31
By the way, I notice a lot of methods that have AttributeErrors. For example, |
comment:32
Replying to @jasongrout:
I agree with Jason; I usually think of Also, Joris, I completely agree on your decision to raise an error for additional arguments to As for the method inheritance problem, I'm of two minds. This problem has come up for me (and probably others) too, and stems from wanting to inherit most of the functionality of another class, but not all of the methods. The technically correct thing to do is write a new master class, inherit from that, and rewrite the other class also inheriting from the new master class -- this will probably take a while, and has the potential to raise subtle bugs. The laziest thing to do is ignore the problem -- this will probably be fine for most users, and confusing for some. A middle road is to go through all of the inherited methods and make sense out of the ones you can. For those you can't, override the method to raise For this ticket, I'd be in support of raising |
comment:33
Thanks for elucidating the role of Replying to @nilesjohnson:
OK, I've updated the patch so that the methods which are not applicable raise |
comment:34
Replying to @jvkersch:
I think you've gone above and beyond the requirement with this last one. Thanks! Again, I think the code looks good. If someone else wants to give a final positive review on the mathematical foundation, let's mark this positive review and get it in. |
Changed work issues from diff() to none |
comment:36
Jason, I agree, I think this is in good enough shape for inclusion. I think its important to get this sort of new functionality in as soon as possible as long as the design looks reasonable, which it does. I think this is very exciting, its the sort of functionality that Sage is meant for, and I'm very happy to see this addition. |
comment:37
Could someone please update attachment: trac9650_differential_forms_v2.patch with a more descriptive commit string that includes the ticket number? For example: |
comment:38
Attachment: trac9650_differential_forms_v2.patch.gz Replying to @qed777:
Done -- thanks for pointing that out. |
comment:39
Hi Jason and Marshall, Thanks a lot for the final positive review and thanks all for the many comments along the way -- I can honestly say that I've learned more about Sage (and even Python) in the last few weeks than ever before! Hopefully I can keep contributing in the future. Best wishes, |
corrected formatting for NotImplemented methods |
comment:42
Attachment: trac9650_differential_forms_v2-reviewer.patch.gz Replying to @jvkersch:
This looks great, and I agree with others on getting it included into sage soon. There were some formatting errors in the new docstrings (need newline between |
comment:43
Hi Niles, Sorry for the formatting error and thanks for catching it so soon. I will go over everything again soon, and if I find any more inconsistencies which crept in during my last round of implementations, I will post a new patch. |
Merged: sage-4.6.alpha1 |
Implements support for differential forms to Sage. After applying the patch, three new classes are added to sage:
CoordinatePatch
-- an open subset of Rn on which differential forms can be definedDifferentialForms
-- a differential forms parentDifferentialForm
-- a differential forms class.Please see the documentation in the
DifferentialForm
class for more information about syntax, available methods, etc.This is a very basic implementation, providing support for exterior differentiation and wedge products of forms, but not much more. The emphasis is on making sure that the framework is implemented correctly.
See discussion at
CC: @sagetrac-mhampton @jasongrout @jdemeyer @qed777 @novoselt @nilesjohnson
Component: symbolics
Keywords: forms, functions, symbolics
Author: Joris Vankerschaver
Reviewer: Niles Johnson
Merged: sage-4.6.alpha1
Issue created by migration from https://trac.sagemath.org/ticket/9650
The text was updated successfully, but these errors were encountered: