Ticket #5451 (closed defect: fixed)
[with patch, positive review] Bug in addition of rational functions over a finite field
|Reported by:||cremona||Owned by:||tbd|
|Component:||algebra||Keywords:||rational function addition|
Alex Lara reported on sage-support on 20090307:
I recently upgrade sage from 3.2.3 to 3.3. I'm also have sage 3.1.1 The thing is that the following commands give different results: F.<theta>=FiniteField(9) A.<t> = PolynomialRing(F) K.<t> = FractionField(A) f= 2/(t^2+2*t); g =t^9/(t^18 + t^10 + t^2);f+g In 3.1.1 gives the right answer (I guess) but in 3.2.3 give an error: ZeroDivisionError Traceback (most recent call last) ... ZeroDivisionError: division by zero in finite field.
In more detail that traceback is
ZeroDivisionError Traceback (most recent call last) /home/john/.sage/temp/ubuntu/30503/_home_john__sage_init_sage_0.py in <module>() /home/john/sage-3.4.alpha0/local/lib/python2.5/site-packages/sage/structure/element.so in sage.structure.element.ModuleElement.__add__ (sage/structure/element.c:5746)() /home/john/sage-3.4.alpha0/local/lib/python2.5/site-packages/sage/rings/fraction_field_element.so in sage.rings.fraction_field_element.FractionFieldElement._add_ (sage/rings/fraction_field_element.c:3975)() /home/john/sage-3.4.alpha0/local/lib/python2.5/site-packages/sage/structure/element.so in sage.structure.element.PrincipalIdealDomainElement.gcd (sage/structure/element.c:11697)() /home/john/sage-3.4.alpha0/local/lib/python2.5/site-packages/sage/rings/polynomial/polynomial_element_generic.pyc in _gcd(self, other) 558 Return the GCD of self and other, as a monic polynomial. 559 """ --> 560 g = EuclideanDomainElement._gcd(self, other) 561 c = g.leading_coefficient() 562 if c.is_unit(): /home/john/sage-3.4.alpha0/local/lib/python2.5/site-packages/sage/structure/element.so in sage.structure.element.EuclideanDomainElement._gcd (sage/structure/element.c:11939)() /home/john/sage-3.4.alpha0/local/lib/python2.5/site-packages/sage/rings/polynomial/polynomial_element_generic.pyc in quo_rem(self, other) 542 Q = P.zero_element() 543 while R.degree() >= B.degree(): --> 544 aaa = R.leading_coefficient()/B.leading_coefficient() 545 diff_deg=R.degree()-B.degree() 546 Q += P(aaa).shift(diff_deg) /home/john/sage-3.4.alpha0/local/lib/python2.5/site-packages/sage/structure/element.so in sage.structure.element.RingElement.__div__ (sage/structure/element.c:9099)() /home/john/sage-3.4.alpha0/local/lib/python2.5/site-packages/sage/rings/finite_field_givaro.so in sage.rings.finite_field_givaro.FiniteField_givaroElement._div_ (sage/rings/finite_field_givaro.cpp:9661)() ZeroDivisionError: division by zero in finite field.
which shows that somewhere in a gcd computation, a leading coefficient of 0 is being returned.
- Status changed from closed to reopened
- Summary changed from Bug in addition of rational functions over a finite field to [with patch, needs review] Bug in addition of rational functions over a finite field
- Resolution fixed deleted
- Milestone changed from sage-3.4.2 to sage-3.4.1
- Summary changed from [with patch, needs review] Bug in addition of rational functions over a finite field to [with patch, positive review] Bug in addition of rational functions over a finite field