#11530: Conversion of finite field elements to PARI disregards characteristic
and
mangles "Mod"
------------------------------+---------------------------------------------
Reporter: rbeezer | Owner: AlexGhitza
Type: defect | Status: needs_review
Priority: major | Milestone: sage-4.7.1
Component: algebra | Keywords: _pari_init_, variable name,
finite field
Work_issues: | Upstream: N/A
Reviewer: Jeroen Demeyer | Author: Simon King, Rob Beezer
Merged: | Dependencies:
------------------------------+---------------------------------------------
Changes (by rbeezer):
* status: needs_work => needs_review
Old description:
> {{{
> sage: F.<d> = GF(3^2)
> sage: d._pari_()
> Mod(d, Mod(1, 3)*d^2 + Mod(2, 3)*d + Mod(2, 3))
> sage: d._pari_init_("m")
> 'Mom(m, Mom(1, 3)*m^2 + Mom(2, 3)*m + Mom(2, 3))'
> sage: d._pari_init_("p")
> 'Mop(p, Mop(1, 3)*p^2 + Mop(2, 3)*p + Mop(2, 3))'
> sage: d._pari_init_("b")
> 'Mob(b, Mob(1, 3)*b^2 + Mob(2, 3)*b + Mob(2, 3))'
> }}}
>
> More care needs to be taken with a search and replace, maybe it should
> come earlier in
> {{{sage.rings.finite_rings.element_givaro.FiniteField_givaroElement._pari_init_}}}.
>
> '''Apply:'''
> 1. [attachment:11530_pari_init-v4.patch]
New description:
{{{
sage: F.<d> = GF(3^2)
sage: d._pari_()
Mod(d, Mod(1, 3)*d^2 + Mod(2, 3)*d + Mod(2, 3))
sage: d._pari_init_("m")
'Mom(m, Mom(1, 3)*m^2 + Mom(2, 3)*m + Mom(2, 3))'
sage: d._pari_init_("p")
'Mop(p, Mop(1, 3)*p^2 + Mop(2, 3)*p + Mop(2, 3))'
sage: d._pari_init_("b")
'Mob(b, Mob(1, 3)*b^2 + Mob(2, 3)*b + Mob(2, 3))'
}}}
More care needs to be taken with a search and replace, maybe it should
come earlier in
{{{sage.rings.finite_rings.element_givaro.FiniteField_givaroElement._pari_init_}}}.
'''Apply:'''
1. [attachment:11530_pari_init-v5.patch]
--
Comment:
v5 patch:
Consistent commands, as suggested.
Dead code removal ("modulus_as_str" routines).
Corrected doctests.
Upgraded docstrings.
Passes tests in sage/rings.
Will likely run full tests over dinner and report back.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11530#comment:18>
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.