#10720: nth_root in power series
-----------------------------------+----------------------------------------
   Reporter:  pernici              |       Owner:  pernici     
       Type:  PLEASE CHANGE        |      Status:  new         
   Priority:  minor                |   Milestone:  sage-4.6.2  
  Component:  commutative algebra  |    Keywords:  power series
     Author:  mario pernici        |    Upstream:  N/A         
   Reviewer:                       |      Merged:              
Work_issues:                       |  
-----------------------------------+----------------------------------------

Comment(by pernici):

 The nth-root of power series `y = x^n` is computed using
 the Newton method for `y = x^-n`

 {{{
 x' = (1+1/n)*x - y*x^(n+1)/n
 }}}

 {{{
 sage: R.<t> = QQ[]
 sage: p = (1 + 2*t + 5*t^2 + 7*t^3 + O(t^4))^3
 sage: p.nth_root(3)
 1 + 2*t + 5*t^2 + 7*t^3 + O(t^4)
 sage: p = (1 + 2*t + 5*t^2 + 7*t^3 + O(t^4))^-3
 sage: p.nth_root(-3)
 1 + 2*t + 5*t^2 + 7*t^3 + O(t^4)
 }}}


 With this patch `nth_root` works also for series on `ZZ`

 {{{
 sage: R.<t> = ZZ[[]]
 sage: p = 1 + 4*t^2 + 3*t^3 + O(t^4)
 sage: p.nth_root(2)
 1 + 2*t^2 + 3/2*t^3 + O(t^4)
 sage: p.sqrt(2)
 1 + 2*t^2 + 3/2*t^3 + O(t^4)
 sage: p.nth_root(3)
 1 + 4/3*t^2 + t^3 + O(t^4)
 sage: p = 4*t^2 + 3*t^3 + O(t^4)
 sage: p.nth_root(2)
 2*t + 3/4*t^2 + O(t^3)
 sage: p.sqrt(2)
 Traceback (most recent call last):
 ...
 TypeError: no conversion of this rational to integer
 }}}

 there is a bug in `sqrt` in this case.

 `nth_root` can be used to compute the square root of series which
 currently `sqrt` does not support
 {{{
 sage: R.<x,y> = QQ[]
 sage: S.<t> = R[[]]
 sage: p = 4 + t*x + t^2*y + O(t^3)
 sage: p.nth_root(2)
 2 + 1/4*x*t + (-1/64*x^2 + 1/4*y)*t^2 + O(t^3)
 sage: p = 32*t^5 + x*t^6 + y*t^7 + O(t^8)
 sage: p.nth_root(5)
 2*t + 1/80*x*t^2 + (-1/6400*x^2 + 1/80*y)*t^3 + O(t^4)
 sage: p.sqrt()
 Traceback (most recent call last):
 ...
 AttributeError:
 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular'
 object has no attribute 'sqrt'
 }}}

 `nth-root` iteration formula is division-free, which is convenient in this
 case; in this case `sqrt`  could call `nth_root`.


 `nth_root` can be used in the multivariate series considered
 in ticket #1956 .

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