#1956: implement multivariate power series arithmetic
-------------------------------------------+--------------------------------
   Reporter:  was                          |       Owner:  malb                 
    
       Type:  enhancement                  |      Status:  needs_review         
    
   Priority:  major                        |   Milestone:  sage-4.6             
    
  Component:  commutative algebra          |    Keywords:  multivariate power 
series
     Author:  Niles Johnson                |    Upstream:  N/A                  
    
   Reviewer:  Martin Albrecht, Simon King  |      Merged:                       
    
Work_issues:                               |  
-------------------------------------------+--------------------------------

Comment(by niles):

 Replying to [comment:46 malb]:

 >
 > Here are some performance figures:
 > <SNIP>

 Thanks; I think these are outside the scope of this ticket (although
 important!)  Here are the numbers I get:

 {{{
 sage: R.<t,u,v> = PowerSeriesRing(QQ); R
 Multivariate Power Series Ring in t, u, v over Rational Field
 sage: f = R.random_element(prec=20,bound=20)
 sage: fp = f.polynomial()
 sage: %timeit f^2 # power series
 125 loops, best of 3: 2.67 ms per loop

 sage: %timeit fp^2 # polynomials
 625 loops, best of 3: 52.3 µs per loop
 }}}

 The arithmetic is done in a univariate power series ring over a
 multivariate power series ring (called the "background ring" in the code):
 {{{
 sage: R._bg_ps_ring()
 Power Series Ring in T over Multivariate Polynomial Ring in t, u, v over
 Rational Field
 sage: fb = f._bg_value
 sage: %timeit fb^2
 125 loops, best of 3: 2.61 ms per loop
 }}}

 So the speed is a limitation of univariate power series rings over
 multivariate polynomial rings . . .

 {{{
 sage: R.<t,u,v> = PowerSeriesRing(GF(127)); R
 Multivariate Power Series Ring in t, u, v over Finite Field of size 127
 sage: f = R.random_element(prec=20,bound=20)
 sage: fp = f.polynomial()

 sage: %timeit f^2 # power series
 625 loops, best of 3: 1.48 ms per loop

 sage: %timeit fp^2 # polynomials
 625 loops, best of 3: 20.8 µs per loop

 sage: fb = f._bg_value # univariate power series over multivariate
 polynomials
 sage: %timeit fb^2
 625 loops, best of 3: 1.42 ms per loop
 }}}

 >
 > Conversion to Magma didn't seem to work at all, or am I doing it wrong?
 >
 I don't know anything about converting to magma, but the following are
 also broken:

 {{{
 sage: magma(fp)
 TypeError: Error evaluating Magma code.
 
IN:_sage_[5]:=SageCreateWithNames(PolynomialRing(_sage_ref2,3,negdeglex),["t","u","v"]);
 OUT:
 >>
 _sage_[5]:=SageCreateWithNames(PolynomialRing(_sage_ref2,3,negdeglex),["t",
                                                               ^

 User error: Identifier 'negdeglex' has not been declared or assigned

 sage:magma(fb)
 >> _sage_[6]:=32*t^4*T^4 + 30*t^2*u*v^5*T^8 - 21*t^3*u^3*v^3*T^9 +
 56*t*u^7*v^
                  ^
 User error: Identifier 't' has not been declared or assigned

 }}}

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