#14888: Make FiniteField_pari_ffelt the default for generic finite fields
-------------------------------------------+-------------------------------
Reporter: pbruin | Owner: cpernet
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-pending
Component: finite rings | Resolution:
Keywords: FiniteField performance | Merged in:
Authors: Peter Bruin | Reviewers: Jean-Pierre
Report Upstream: N/A | Flori
Branch: | Work issues: PARI sig_on()
Dependencies: #12142, #15124, #15125 | Commit:
| Stopgaps:
-------------------------------------------+-------------------------------
Changes (by jdemeyer):
* dependencies: #12142 => #12142, #15124, #15125
* milestone: sage-5.12 => sage-pending
Old description:
> Ticket #12142 implements an interface to PARI's t_FFELT type for finite
> fields, which is much faster than the one currently used by Sage, in
> which finite field elements are PARI objects like `Mod(Mod(1, 3)*a,
> Mod(1, 3)*a^17 + Mod(2, 3)*a + Mod(1, 3))`. The attached patch makes the
> new implementation the default for those finite fields that currently use
> the slow PARI implementation, namely those of cardinality ''p^n^'' with
> ''p'' > 2 prime, ''n'' > 1 and ''p^n^'' > 2^16^.
>
> The actual switch is just a trivial change in the `FiniteField`
> constructor. The only other real addition is construction of `Integer`
> from `t_FFELT`; the rest of the patch fixes doctests. Almost all fixes
> are for doctests that assumed `FiniteField_elt_pari` to be the default.
> One somewhat notable point is that certain finite elements now compare
> differently (see the changed doctest in `polynomial_zz_pex.py`). This is
> because `gcmp_sage` (in `sage/libs/pari/misc.h`) compares all non-real
> PARI types via their string representations. With the new
> `FiniteFieldElement_pari_ffelt`, string comparison gives the same result
> as lexicographic comparison of polynomials expressing finite field
> elements in terms of the chosen generator, which is nice.
>
> Apply:
> - [attachment:trac_14888-switch_to_pari_ffelt.patch]
> - [attachment:long_to_ffelt.patch]
New description:
Ticket #12142 implements an interface to PARI's t_FFELT type for finite
fields, which is much faster than the one currently used by Sage, in which
finite field elements are PARI objects like `Mod(Mod(1, 3)*a, Mod(1,
3)*a^17 + Mod(2, 3)*a + Mod(1, 3))`. The attached patch makes the new
implementation the default for those finite fields that currently use the
slow PARI implementation, namely those of cardinality ''p^n^'' with ''p''
> 2 prime, ''n'' > 1 and ''p^n^'' > 2^16^.
The actual switch is just a trivial change in the `FiniteField`
constructor. The only other real addition is construction of `Integer`
from `t_FFELT`; the rest of the patch fixes doctests. Almost all fixes
are for doctests that assumed `FiniteField_elt_pari` to be the default.
One somewhat notable point is that certain finite elements now compare
differently (see the changed doctest in `polynomial_zz_pex.py`). This is
because `gcmp_sage` (in `sage/libs/pari/misc.h`) compares all non-real
PARI types via their string representations. With the new
`FiniteFieldElement_pari_ffelt`, string comparison gives the same result
as lexicographic comparison of polynomials expressing finite field
elements in terms of the chosen generator, which is nice.
Apply:
- [attachment:trac_14888-switch_to_pari_ffelt.patch]
--
--
Ticket URL: <http://trac.sagemath.org/ticket/14888#comment:10>
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/groups/opt_out.