#16664: Add a finite field implementation using FLINT's fq and fq_nmod modules
-------------------------------------+-------------------------------------
Reporter: jpflori | Owner:
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.4
Component: finite rings | Resolution:
Keywords: flint finite | Merged in:
field | Reviewers:
Authors: Jean-Pierre Flori | Work issues:
Report Upstream: N/A | Commit:
Branch: | 9587ba65d705fd9480d380908e31ba000565d676
u/jpflori/flint_fq_nmod | Stopgaps:
Dependencies: #15015, #17470 |
-------------------------------------+-------------------------------------
Comment (by jpflori):
Replying to [comment:66 vdelecroix]:
> Hello,
>
> In `_element_constructor_` the following case should not happen
> {{{
> if isinstance(x, self.element_class) and x.parent() is self:
> }}}
> as if `parent(x)` is `self` then this is catched by the `__call__` of
`Parent`. See line 1080-1083 of `parent.pyx`
> {{{
> cdef R = parent_c(x)
> cdef bint no_extra_args = len(args) == 0 and len(kwds) == 0
> if R is self and no_extra_args:
> return x
> }}}
>
> Instead of making `__nonzero__` relies on `is_unit` I would rather
implement `__nonzero__` and call it in bot `is_unit` and `is_zero`. BTW
for the latter this is what is in `Element.is_zero` by default, so you can
even remove it. The reason why is that there is a special slot for
`__nonzero__` in Python objects. So the fastest (Python) way to do things
should be
> {{{
> if not my_element:
> XYZ
> }}}
> and not
> {{{
> if my_element.is_zero():
> XYZ
> }}}
Thanks, I'll have a look at both of these.
Not that the code is mainly cpoied/pasted from the PARI wrapper by Peter
Bruin.
I'll also check the PARI wrapper.
Note the PARI wrapper is Python rather than Cython (as we have already
have a cython "proxy" for PARI elements).
>
> What are the status of the flint patches? Are there incorporated in
flint-2.5? If that is so, it would make sense to first include it into
Sage.
I guess so.
Integrating flint 2.5 first is a good idea anyway.
It will also allow to use the lacking in flint 2.4 fq_div function.
>
> Vincent
--
Ticket URL: <http://trac.sagemath.org/ticket/16664#comment:67>
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.