#18547: Improve polynomial powering in positive characteristic
-------------------------------------+-------------------------------------
Reporter: bruno | Owner:
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.9
Component: commutative | Resolution:
algebra | Merged in:
Keywords: polynomial, | Reviewers:
powering | Work issues:
Authors: Bruno Grenet | Commit:
Report Upstream: N/A | 41dd9054555eaaf7567fac4ec56d95d05b039daa
Branch: | Stopgaps:
u/bruno/polynomial_powering_positive_characteristic|
Dependencies: |
-------------------------------------+-------------------------------------
Changes (by bruno):
* status: needs_work => needs_review
Comment:
Replying to [comment:26 jdemeyer]:
> Replying to [comment:23 bruno]:
> > I am happy if you find a good way to test this function!
> You have many cases and they should all be tested:
> {{{
> sage: R1 = PolynomialRing(GF(8, 'a'), 'x')
> sage: R2 = PolynomialRing(GF(9, 'b'), 'x', sparse=True)
> sage: R3 = PolynomialRing(R2, 'y')
> sage: R4 = PolynomialRing(R1, 'y', sparse=True)
> sage: for d in range(40): # long time
> ....: for R in [R1, R2, R3, R4]:
> ....: a = R.random_element()
> ....: assert a^d == generic_power(a, d)
> }}}
I introduced your proposed doctest, with the following change: Since I put
a threshold `20` on the exponent before using the new code (for efficiency
reasons), the loop is `for d in range(20,40)`.
Replying to [comment:23 bruno]:
> Replying to [comment:19 jdemeyer]:
> > I suggest to remove the special case for finite fields. The generic
code should work just fine for finite fields.
>
> Actually, the current code is faster for finite fields.
Actually, the code was not correct for non-prime finite fields... (The
special case should have been for prime finite fields only.) So I finally
followed your advice and removed the special case. In the same time, I
refactored a bit the code.
--
Ticket URL: <http://trac.sagemath.org/ticket/18547#comment:28>
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 http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.