#20889: truncated power for polynomials
-------------------------------------+-------------------------------------
       Reporter:  vdelecroix         |        Owner:
           Type:  enhancement        |       Status:  needs_work
       Priority:  major              |    Milestone:  sage-7.3
      Component:  algebra            |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Vincent Delecroix  |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/vdelecroix/20889                 |  7e24e7abb3c962d90f4c64ec14adae17fe3e1fd9
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by vdelecroix):

 Replying to [comment:5 bruno]:
 > * How much does it gain to statically type the arguments of the method?
 One drawback is that you cannot do the following (though the computation
 would be fast):
 >
 >     {{{#!python
 >     sage: p = 7
 >     sage: R.<x> = GF(p)[]
 >     sage: f = x^2 + x + 1
 >     sage: f.power_trunc(2^100, 1000)
 >     Traceback (most recent call last):
 >     ...
 >     OverflowError: long int too large to convert
 >     }}}

 The reason is that I want to use library calls when available. Some of
 them does not support arbitrary precision exponent. I used the type from
 flint.

 > * On a related note, do you think it may be useful to allow for a
 negative power? The code could be as follows:
 >
 >     {{{#!python
 >     if n < 0:
 >         return self.inverse_series_trunc(prec).power_trunc(-n, prec)
 >     }}}

 I don't know. I do not think of `power_trunc` as a convenience function. I
 want to use it in algorithms (like `nth_root`). We might propose
 `_power_trunc_` (or `_power_trunc` or any other names) with restricted
 types. And on the other hand `power_trunc` with arbitrary precision and
 possibly negative input... Library calls would just override the
 specialized function `_power_trunc_`. What do you think?

 > * The first line of documentation is pretty terse...

 I will change it.

--
Ticket URL: <https://trac.sagemath.org/ticket/20889#comment:6>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to