#14888: Make FiniteField_pari_ffelt the default for generic finite fields
-------------------------------------+-------------------------------------
       Reporter:  pbruin             |        Owner:  cpernet
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-5.13
      Component:  finite rings       |   Resolution:
       Keywords:  FiniteField        |    Merged in:
  performance                        |    Reviewers:  Jean-Pierre Flori,
        Authors:  Peter Bruin,       |  Jeroen Demeyer
  Jeroen Demeyer                     |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |     Stopgaps:
   Dependencies:  #12142, #15124,    |
  #15125                             |
-------------------------------------+-------------------------------------
Changes (by {'newvalue': u'Peter Bruin, Jeroen Demeyer', 'oldvalue': u'Peter 
Bruin'}):

 * status:  needs_work => needs_review
 * author:  Peter Bruin => Peter Bruin, Jeroen Demeyer


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:14888_fix_32bit.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]
  - [attachment:14888_fix_32bit.patch]
  - [attachment:14888_review.patch]

--

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

Reply via email to