#1956: implement multivariate truncated power series arithmetic
-------------------------------------------+--------------------------------
   Reporter:  was                          |          Owner:  pernici           
       
       Type:  enhancement                  |         Status:  needs_review      
       
   Priority:  major                        |      Milestone:  sage-4.7          
       
  Component:  commutative algebra          |       Keywords:  multivariate 
power series
Work_issues:                               |       Upstream:  N/A               
       
   Reviewer:  Martin Albrecht, Simon King  |         Author:  Niles Johnson     
       
     Merged:                               |   Dependencies:                    
       
-------------------------------------------+--------------------------------
Changes (by niles):

  * status:  needs_work => needs_review


Comment:

 Replying to [comment:105 malb]:

 Thanks for taking a look; sorry for the coverage negligence.  I've added
 the `#indirect notes`, and a docstring for `unpickle`.  Now `sage
 -coverage` returns 100% for both `multi_power_series` files.  As a bonus,
 I've added a docstring for the unpickle function of univariate power
 series too.

 I believe your other comments do not require changes -- I've elaborated
 below.  This means we are once again ready for review :)

 >
 > > 4. multi_power_series_ring.py: the code accurately does what it claims
 to do (needs_review)
 >
 > Shouldn't ```def _element_constructor_(self,f)``` use the default
 precision of the ring?
 >

 No, I believe not.  Default precision is used only when absolutely
 necessary to convert an infinite precision element to a finite precision
 one (e.g. for inversion or reversion).  But, for example, coercion of a
 polynomial should result in an infinite precision element, not a finite
 precision one.  This is consistent with the behavior of univariate power
 series rings:

 {{{
 sage: P = QQ[x]; P
 Univariate Polynomial Ring in x over Rational Field

 sage: S = P.completion(P.gen()); S
 Power Series Ring in x over Rational Field

 sage: S(P.random_element()).prec()
 +Infinity
 }}}
 {{{
 sage: P = QQ['x,y,z']; P
 Multivariate Polynomial Ring in x, y, z over Rational Field

 sage: S = P.completion(P.gens()); S
 Multivariate Power Series Ring in x, y, z over Rational Field

 sage: S(P.random_element()).prec()
 +Infinity
 }}}


 > > 6. Integration with the rest of sage: construction and use of
 `PowerSeriesRing`
 > > works correctly, and parallels behavior of polynomial rings (needs
 review)
 >
 > '''needs work'''
 >
 > The {{{default_prec}}} parameter does not seem to work as expected (or
 is my expectation wrong?)
 >
 >
 {{{
 #!python
 sage: P.<x,y> = PowerSeriesRing(GF(127),default_prec=20)
 sage: x.prec()
 +Infinity
 }}}


 I believe that your expectation is wrong, as described above.  Note the
 parallel behavior for univariate power series rings:
 {{{
 sage: P.<x> = PowerSeriesRing(GF(127),default_prec=20)
 sage: x.prec()
 +Infinity
 }}}


 > > 8. Coding: the code is free from obvious inefficiencies in error
 handling, memory
 > > management, etc. (needs review)
 >
 > If the performance is good (7), then I think we can just assume it's
 okay. We can always come back and fix stuff later which is too slow.

 so...I'm reading 'positive review', right? ;)
 (free from *obvious* inefficiencies, etc.)


 >
 > I have to say that I don't like the excessive use of double underscore
 attributes. It makes it harder to inherit from it or reach into the
 internals (just as you have to write
 {{{_PowerSeriesRing_generic__poly_ring}}}) I'd just use a single
 underscore. I'll leave it up to you (i.e., not make my review dependent on
 it) whether you insist on keeping them.

 Excessive or not, each of the double underscore methods is necessary to
 replace the corresponding method of `PowerSeries` or
 `PowerSeriesRing_generic`, from which the `MPowerSeries*` classes inherit.
 Here's a complete list of the double underscore attributes:

 {{{
 MPowerSeries.__init__
 MPowerSeries.__reduce__
 MPowerSeries.__call__
 MPowerSeries.__getitem__
 MPowerSeries.__invert__
 MPowerSeries.__cmp__
 MPowerSeries.__mod__
 MPowerSeries.__lshift__
 MPowerSeries.__rshift__

 MPowerSeriesRing_generic.__init__
 MPowerSeriesRing_generic.__reduce__
 MPowerSeriesRing_generic.__cmp__
 }}}

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