#7841: Use NTL's ZZ_pEX for polynomial arithmetic over extension fields
---------------------------+------------------------------------------------
Reporter: ylchapuy | Owner: AlexGhitza
Type: enhancement | Status: new
Priority: major | Milestone: sage-4.3.1
Component: algebra | Keywords:
Work_issues: | Author:
Upstream: N/A | Reviewer:
Merged: |
---------------------------+------------------------------------------------
Comment(by ylchapuy):
The attached patch defines a new class Polynomial_ZZ_pEX via templating
(uses polynomial_template.pxi).
This class should be used for polynomials over GF(p^k) with
p>NTL_SP_BOUND.
For smaller values of p, we should wrap NTL's lzz_pEX which is not done
yet at all.
For the record, some comparisons:
{{{
----------------------------------------------------------------------
| Sage Version 4.3, Release Date: 2009-12-24 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
Loading Sage library. Current Mercurial branch is: NTL
sage: K.<a>=GF(next_prime(2**60)**3)
sage: R.<x> = PolynomialRing(K,implementation='NTL')
sage: S.<X>=PolynomialRing(K)
sage: P=R.random_element(degree=100)
sage: Q=S(list(P))
sage: P2=R.random_element(degree=100)
sage: Q2=S(list(P2))
sage: %timeit P+P2
10000 loops, best of 3: 68.7 µs per loop
sage: %timeit Q+Q2
1000 loops, best of 3: 1.53 ms per loop
sage: %timeit P*P2
100 loops, best of 3: 2.17 ms per loop
sage: %timeit Q*Q2
10 loops, best of 3: 298 ms per loop
sage: %timeit P**30
10 loops, best of 3: 79.8 ms per loop
sage: time ll=Q**10
CPU times: user 12.71 s, sys: 0.20 s, total: 12.91 s
Wall time: 13.15 s
sage: %timeit P//(P2>>50)
100 loops, best of 3: 4.85 ms per loop
sage: %timeit Q//(Q2>>50)
10 loops, best of 3: 203 ms per loop
sage: time P.is_irreducible()
CPU times: user 1.44 s, sys: 0.00 s, total: 1.44 s
Wall time: 1.44 s
False
sage: time Q.is_irreducible()
CPU times: user 11.66 s, sys: 0.01 s, total: 11.67 s
Wall time: 11.79 s
False
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7841#comment:1>
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.