#10132: Differential Geometry via Sage
------------------------------------+---------------------------------------
   Reporter:  mikarm                |       Owner:  mhampton                    
               
       Type:  enhancement           |      Status:  new                         
               
   Priority:  major                 |   Milestone:                              
               
  Component:  geometry              |    Keywords:  differential geometry, 
parametrized surface
     Author:  Mikhail Malakhaltsev  |    Upstream:  N/A                         
               
   Reviewer:                        |      Merged:                              
               
Work_issues:                        |  
------------------------------------+---------------------------------------

Comment(by jvkersch):

 I had a great time playing with this code during the weekend and I am
 really looking forward to the time where I'll be able to take a book on
 curves and surfaces and work through the examples using Sage.  I didn't
 really look at the mathematics or the usability (both seem fine for now),
 but I went ahead and made this into a Sage class (following the
 instructions at
 [http://www.sagemath.org/doc/developer/coding_in_python.html#creating-a
 -new-directory this page]).  Please see the attached patch for details.
 What it does is the following:

  1. Create a new directory `riemann`, containing the parametrized surface
 class that Mikhail uploaded in the zip file, together with the vector
 functions class.

  2. Updates `setup.py` and `all.py` to make Sage aware of these additions.

 I deliberately did not want to change any code if I could help it, but
 here are the modifications that I made:
  1. Changed the capitalization to `ParametrizedSurface3D` to conform to
 the Sage standard;
  2. Removed the references to `RR` and `CC` since these already have
 standard meanings in Sage;
  3. I added a class `GenericManifold` as per the suggestions of Andrey.  I
 think this is a good idea (even if we don't implement anything generic
 now), as it will keep us focused on the need to tie this in with more
 general differential geometric classes.
  4. Throughout the code, I added various import statements where it was
 necessary.  I ended up changing some of the constructions in the functions
 `principal_curvatures`, ` geodesics_numerical` and
 `parallel_translation_numerical` as these relied on some constructions
 that weren't pure Python.  As you will see, the code that I added is quite
 hideous and just serves to make things work -- definitely needs to be
 streamlined.

 With these changes, my version of Sage (4.6.alpha3 without any other
 patches) built cleanly and I was able to replicate all of the
 constructions in the Sage worksheet.  So hopefully the uploaded patch can
 provide a good starting point for further work.

 Here are a few remarks that I came across while tweaking the code.

  1. Sometimes the terminology "vector" is used where "vector field" would
 be more appropriate.
  2. It seems as if this class would benefit from having a small template
 for a generic tensor class.  Right now, many of the member functions
 return tensors as lists (which is fine), but there are also member
 functions which take an optional argument to return only one component of
 that tensor.  This code then needs to check whether the optional argument
 is valid, adding some complexity to the code.  Maybe we could define a
 simple tensor class which just has `__getitem__` and `__setitem__` and
 then let this class deal with components, input checking, etc.
  3. I think that some of the functions in the `vector_functions` module
 have Sage alternatives, which should be used instead.
  4. We need to think on providing an interface to `parametric_plot3d`, so
 that these kind of surfaces can easily be plotted.

 As Mikhail remarked in his original post, the code hasn't been optimized
 for speed.  I thought this could be addressed by the following (could be a
 longer term goal for this patch).
  1. Caching the result of computing the fundamental forms, the Christoffel
 symbols, etc.  This would make subsequent calls to the components of these
 tensors much faster, at the expense of some memory.
  2. The numerical routines should be optimized for float operations using
 `fast_float` or similar.

 This is just my 2 cents.  I'm looking forward to hearing your comments and
 I would definitely like to help in implementing some of these (or other)
 suggestions.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10132#comment:6>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to