Trac 16383: more direct conversion in polynomial evaluation over finite fields
16438 : use d3js spkg if available
Merge branch 'develop' into t/16438/use_d3js_package_if_available
#16438 move warning from code to documentation.
Trac #16438: Use d3js package if available

The aim of this ticket is to use the package provided by #16434 when
drawing graphs, instead of fetching `d3.min.js` online (see #14953).

URL: http://trac.sagemath.org/16438
Reported by: tmonteil
Ticket author(s): Thierry Monteil
Reviewer(s): Nathann Cohen
Trac #16383: Can't evaluate a polynomial on a finite field if representation is not "poly"

Evaluating a polynomial on a finite field does not work if the finite
field was created with a 'repr' argument in the constructor different
than the default one (poly).

Curently using sage 6.1.1 on ubuntu 12.04 but same behaviour in 6.2.

Here is the code that works :

{{{
sage: F.<a>=GF(2**8)
sage: PR.<x>=PolynomialRing(F)
sage: f=PR.random_element(9)
sage: b=F.random_element()
sage: f(b)
a^6 + a^5 + a^4 + a^3 + a^2 + 1
}}}

And the same code with the repr parameter changed (same behaviour with
repr="int") :

{{{
sage: F.<a>=GF(2**8, repr="log")
sage: PR.<x>=PolynomialRing(F)
sage: f=PR.random_element(9)
sage: b=F.random_element()
sage: f(b)
------------------------------------------------------------------------
---
NameError                                 Traceback (most recent call
last)
<ipython-input-5-a6714ffdcf66> in <module>()
----> 1 f(b)

/home/local/user/sage/sage-6.2-x86_64-Linux/local/lib/python2.7/site-
packages/sage/rings/polynomial/polynomial_zz_pex.so in
sage.rings.polynomial.polynomial_zz_pex.Polynomial_ZZ_pEX.__call__
(sage/rings/polynomial/polynomial_zz_pex.cpp:14427)()

/home/local/user/sage/sage-6.2-x86_64-Linux/local/lib/python2.7/site-
packages/sage/structure/parent.so in
sage.structure.parent.Parent.__call__ (sage/structure/parent.c:8858)()

/home/local/user/sage/sage-6.2-x86_64-Linux/local/lib/python2.7/site-
packages/sage/structure/coerce_maps.so in
sage.structure.coerce_maps.DefaultConvertMap_unique._call_
(sage/structure/coerce_maps.c:4206)()

/home/local/user/sage/sage-6.2-x86_64-Linux/local/lib/python2.7/site-
packages/sage/structure/coerce_maps.so in
sage.structure.coerce_maps.DefaultConvertMap_unique._call_
(sage/structure/coerce_maps.c:4113)()

/home/local/user/sage/sage-6.2-x86_64-Linux/local/lib/python2.7/site-
packages/sage/rings/finite_rings/finite_field_givaro.pyc in
_element_constructor_(self, e)
    355             2*a4^3 + 2*a4^2 + 1
    356         """
--> 357         return self._cache.element_from_data(e)
    358
    359     def gen(self, n=0):

/home/local/user/sage/sage-6.2-x86_64-Linux/local/lib/python2.7/site-
packages/sage/rings/finite_rings/element_givaro.so in
sage.rings.finite_rings.element_givaro.Cache_givaro.element_from_data
(sage/rings/finite_rings/element_givaro.cpp:6459)()

/home/local/user/sage/sage-6.2-x86_64-Linux/local/lib/python2.7/site-
packages/sage/rings/finite_rings/element_givaro.so in
sage.rings.finite_rings.element_givaro.Cache_givaro.element_from_data
(sage/rings/finite_rings/element_givaro.cpp:5381)()

<string> in <module>()
}}}

URL: http://trac.sagemath.org/16383
Reported by: landais
Ticket author(s): Peter Bruin
Reviewer(s): Ralf Stephan