Interesting. It seems the problem is that
cm.discover_action(GF(5), ZZ, operator.div)
tries to look for a right action on of
cm.discover_action(GF(5), Frac(ZZ), operator.mul)
which doesn't exist as there are no coercions between GF(5) and QQ.
I posted a patch to http://trac.sagemath.or
Hi
Set x=GF(5)['x'].gen()
I dunno if this helps but here is an explanation why one gets a
different behavior for x/7 than cm.bin_op(x,7,operator.div):
If you do "x/7" then I think it calls __div__ from polynomial_element
(Polynomial class):
try:
if not isinstance(right, Element) or right.pa
2015-02-05 21:38 UTC+01:00, John Cremona :
> If you ask for operator.mul instead of operator.div then you get the
> poly ring. Is that it, perhaps?
Nope. I want to get rid of many hacks in rings/polynomial. In order to
do that I need the div operation to be correctly handled by the
coercion (or p
If you ask for operator.mul instead of operator.div then you get the
poly ring. Is that it, perhaps?
John
On 5 February 2015 at 18:48, Vincent Delecroix
<20100.delecr...@gmail.com> wrote:
> sage: cm = sage.structure.element.get_coercion_model()
> sage: cm.explain(GF(5)['x'], ZZ, operator.div)
>
sage: cm = sage.structure.element.get_coercion_model()
sage: cm.explain(GF(5)['x'], ZZ, operator.div)
Coercion on right operand via
Composite map:
From: Integer Ring
To: Univariate Polynomial Ring in x over Finite Field of size 5
Defn: Natural morphism:
From:
Hello,
I'm not sure if I should open a ticket on the following issue, or if
this is just a case of "Error Between Keyboard And Chair". Here is a
simplified version of what happened.
I had parents A and B and map phi between them, as follows:
sage: A = CombinatorialFreeModule(ZZ,[1,2,3],prefix='X
Is this a bug?
sage: version()
'Sage Version 3.4.2, Release Date: 2009-05-05'
sage: S. = PolynomialRing(Integers(14641))
sage: f = 1 + 9581*t
sage: R = PolynomialRing(Integers(1331), "t")
sage: ff = f.change_ring(R)
sage: ff
264*t + 1
sage: type(f)
sage: type(ff)
sage: ff[0]
264*t + 1
sage: f[0
Consider the following Sage run, from Sage 3.0.3:
sage: x1 = PolynomialRing(ZZ, 'x').gen()
sage: x2 = PolynomialRing(ZZ, 'x', sparse=True).gen()
sage: (x1+x2).parent()
Univariate Polynomial Ring in x over Integer Ring
sage: (x2+x1).parent()
Univariate Polynomial Ring in x over Integer Ring
where