#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
     Author:  Niles Johnson                |    Upstream:  N/A                  
    
   Reviewer:  Martin Albrecht, Simon King  |      Merged:                       
    
Work_issues:                               |  
-------------------------------------------+--------------------------------
Changes (by hlaw):

 * cc: hlaw (added)


Comment:

 First, thanks for all your work Niles, what you've done has already saved
 me hours of pain!

 There seems to be a problem with how coercion/evaluation works between two
 multivariate power series rings when the number of variables in each
 differs.  For example:

 {{{
 sage: A.<a, b, c> = PowerSeriesRing(QQ)
 sage: B.<s, t> = PowerSeriesRing(QQ)
 sage: s(a, b)
 ---------------------------------------------------------------------------
 TypeError                                 Traceback (most recent call
 last)

 /home/hlaw/Dropbox/org/<ipython console> in <module>()

 /home/hlaw/src/sage-src/local/lib/python2.6/site-
 packages/sage/rings/multi_power_series_ring_element.pyc in __call__(self,
 *x, **kwds)
     419         for i in range(len(x)):
     420             try:
 --> 421                  xi = self.parent(x[i])
     422             except AttributeError:
     423                 raise AttributeError(str(x[i])+" does not coerce
 to parent ring.")

 /home/hlaw/src/sage-src/local/lib/python2.6/site-
 packages/sage/structure/element.so in
 sage.structure.element.Element.parent (sage/structure/element.c:4069)()

 /home/hlaw/src/sage-src/local/lib/python2.6/site-
 packages/sage/rings/power_series_ring.pyc in __call__(self, f, prec,
 check)
     604             v = sage_eval(f.Eltseq())
     605             return self(v) * (self.gen(0)**f.Valuation())
 --> 606         return self.__power_series_class(self, f, prec,
 check=check)
     607
     608     def construction(self):

 /home/hlaw/src/sage-src/local/lib/python2.6/site-
 packages/sage/rings/multi_power_series_ring_element.pyc in __init__(self,
 parent, x, prec, is_gen, check)
     352                     self._bg_value =
 parent._bg_ps_ring(x._bg_value)
     353                 except TypeError:
 --> 354                     raise TypeError("Unable to coerce into
 background ring.")
     355
     356             elif xparent == parent._bg_ps_ring():

 TypeError: Unable to coerce into background ring.
 }}}
 I would expect this to print `a`.  Similar permutations with `s^2`, `s +
 t`, etc. produce the same result.

 Another problem, possibly related, is the following:

 {{{
 sage: B.<s, t> = PowerSeriesRing(QQ)
 sage: C.<z> = PowerSeriesRing(QQ)
 sage: s(z, z)  # expect z
 1
 sage: s(z, z^2)  # expect z
 1
 sage: s(0, z^2)  # expect 0
 0
 sage: s(z^2, 0)  # expect z^2
 1
 sage: (2*s^2)(z, z)  # expect 2*z^2
 2
 sage: (2*s^2 + 3*t)(z, z)  # expect 3*z + 2*z^2
 5
 sage: t(0, z)  # expect z
 1
 sage: t(z, z)  # expect z
 1
 sage: z(s + t) # expect s + t
 s + t
 sage: z(s)  # expect s
 s
 sage: z(t)  # expect t
 t
 }}}
 Clearly `z` is being sent to 1 (one) somehow when going from `QQ[[s,t]]`
 to `QQ[[z]]`, but the maps in the other direction work fine.

 Both of these problems (assuming they're distinct) disappear when one does
 the analogous calculations directly with multivariate ''polynomial''
 rings.

 Cheers, Hamish.

 (Using Sage 4.6.2 +power series patches, on Ubuntu 10.10 64bit, Macbook
 5.1.)

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