#8972: Inversion and fraction fields for power series rings
-----------------------------------------------+----------------------------
 Reporter:  SimonKing                          |         Owner:  AlexGhitza     
     Type:  defect                             |        Status:  needs_review   
 Priority:  major                              |     Milestone:  sage-4.4.4     
Component:  algebra                            |    Resolution:  fixed          
 Keywords:  power series ring, fraction field  |        Author:  Simon King     
 Upstream:  N/A                                |      Reviewer:  Robert Bradshaw
   Merged:                                     |   Work_issues:                 
-----------------------------------------------+----------------------------
Changes (by SimonKing):

  * status:  needs_work => needs_review
  * work_issues:  fix division if no fraction field exists; use ~ instead
                  of / in elliptic curve code =>


Comment:

 I think the problems are now solved. With the last patch, that is to be
 applied after all others, {{{sage -testall}}} works without errors (at
 least in version sage-4.4.2).

 '''__Changes introduced by the patch__'''

  * In some cases, if the code expects a power series, I replaced {{{a/b}}}
 for power series {{{a,b}}} by {{{a*~b}}}. Namely, the latter returns a
 power series (not a Laurent series), if possible.

  * I added a method {{{exp}}} for Laurent series, that returns the
 exponential if the Laurent series happens to be a power series.

  * With my previous patches, the underlying data of a Laurent series is
 not necessarily a power series. Therefore {{{add_bigoh}}} (similarly
 {{{_rmul_}}} and {{{_lmul_}}}) did in some cases not work. This is now
 fixed and doctested.

  * Some Power Series Rings still returned a ''formal'' fraction field.
 This is now fixed, they return a Laurent series ring.

  * If {{{a,b}}} are elements of a power series ring {{{R}}}, the rule is
 now:

    1. If {{{R}}} is an integral domain, then {{{a/b}}} always belongs to
 {{{Frac(R)}}}. This is similar to {{{1/1}}} being rational, not integer.

    2. If {{{R}}} is no integral domain, then {{{a/b}}} is an element of
 {{{R}}} or of the Laurent series ring over the base ring of {{{R}}}, if
 {{{b}}} is invertible. This is similar to division in {{{ZZ.quo(15)}}}.

    3. If possible, {{{~b}}} is a power series (possibly over the fraction
 field of the base of {{{R}}}). So, we always have {{{~b==1/b}}}, but the
 parents may be different. I hope this is acceptable.

  * A change in the default {{{_div_}}} method of {{{RingElement}}}:
 Previously, the default for {{{a._div_(b)}}} was to return
 {{{a.parent().fraction_field()(a,b)}}}. But this may be a problem (e.g.,
 if the fraction field is not a formal fraction field but a Laurent series
 ring). Therefore, if the old default results in an error,
 {{{a.parent().fraction_field(a)/a.parent().fraction_field(b)}}} is tried.

 '''__Timings__'''

 Robert was worried about potential slowdowns in the Monsky-Washnitzer
 code. It seems to me that my patches actually provide a considerably
 speedup.

 Without my patches:
 {{{
 sage -t  "devel/sage-
 powerseries/sage/schemes/elliptic_curves/monsky_washnitzer.py"
          [3.9 s]

 ----------------------------------------------------------------------
 All tests passed!
 Total time for all tests: 3.9 seconds
 }}}

 With my patches:
 {{{
 sage -t  "devel/sage-
 powerseries/sage/schemes/elliptic_curves/monsky_washnitzer.py"
          [2.3 s]

 ----------------------------------------------------------------------
 All tests passed!
 Total time for all tests: 2.3 seconds
 }}}

 So, the code seems to become faster by more than 33%!

 Ready for review again...

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8972#comment:31>
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