hi there,

i thought i'd report this bug, even though it's hard to reproduce and
not well-identified. I have a ring R of type:

Fraction Field of Multivariate Polynomial Ring in x0, x1, x2, x3, x4,
x0_iv, x1_iv, x2_iv, x3_iv, x4_iv over Cyclotomic Field of order 4 and
degree 2

(the _iv variables will play no role in the sequel -- not that it
matters.)

And I have a list L of 64 matrices in MatrixSpace(R, 2).
When i try sum(L), I get:

/home/pedro/Bureau/sage-3.0.2-ubuntu32-intel-i686-Linux/local/lib/
python2.5/site-packages/sage/rings/fraction_field_element.py in
_add_(self, right)
    298                         numer = numer // new_gcd
    299                         denom = denom // new_gcd
--> 300                     return FractionFieldElement(self.parent(),
numer, denom, coerce=False, reduce=False)
    301                 # else: no reduction necessary
    302             except AttributeError: # missing gcd or quo_rem,
don't reduce

/home/pedro/Bureau/sage-3.0.2-ubuntu32-intel-i686-Linux/local/lib/
python2.5/site-packages/sage/rings/fraction_field_element.py in
__init__(self, parent, numerator, denominator, coerce, reduce)
     65                 pass
     66         if self.__denominator.is_zero():
---> 67             raise ZeroDivisionError, "fraction field element
division by zero"
     68
     69     def reduce(self):

ZeroDivisionError: fraction field element division by zero

(This is sage 3.1.1 despite the folder name.)

If i try to do a for loop and sum the matrices one by one, i realize
that the problem is with the addition of sum(L[:49]) (call it M) and
L[49] (call it N). I can compute them separately and get the same
error message by trying M+N.

Of course you'd like to see M and N. Well be ready for a
disappointment: M is

[  ((37/32*I - 5/16)*x0^2*x1*x2*x3 + (-5/64*I + 7/32)*x1*x2^2*x3^2 +
(-19/32*I + 7/16)*x0^2*x1*x2*x4 + (-9/32*I - 1/16)*x0^2*x1*x3*x4 +
(-5/32*I + 13/16)*x0^2*x2*x3*x4 + (-19/8*I - 89/16)*x1^2*x2*x3*x4 +
(15/32*I - 3/8)*x1*x2^2*x3*x4 + (31/64*I - 27/64)*x2^3*x3*x4 +
(-31/32*I + 5/16)*x1*x2*x3^2*x4 + (21/32*I - 13/64)*x2*x3^3*x4 +
(-5/16*I + 15/64)*x1*x2^2*x4^2 + (-3/32*I + 1/4)*x1*x2*x3*x4^2 +
(-7/64*I + 3/64)*x1*x3^2*x4^2 + (13/64*I + 5/8)*x2*x3*x4^3)/
(x1*x2*x3*x4)      ((5/32*I - 11/32)*x0^2*x1*x2*x3 + (1/8*I -
1/4)*x1*x2^2*x3^2 + (7/32*I + 15/32)*x0^2*x1*x2*x4 + (3/32*I -
1/32)*x0^2*x1*x3*x4 + (9/32*I - 3/32)*x0^2*x2*x3*x4 + (-29/32*I +
303/128)*x1^2*x2*x3*x4 + (5/16*I + 11/16)*x1*x2^2*x3*x4 + (-1/64*I +
29/128)*x2^3*x3*x4 + (11/8*I + 1/8)*x1*x2*x3^2*x4 + (21/64*I -
13/128)*x2*x3^3*x4 + (-17/64*I - 7/32)*x1*x2^2*x4^2 + (-7/8*I +
7/8)*x1*x2*x3*x4^2 + (-9/64*I - 7/64)*x1*x3^2*x4^2 + (5/16*I -
13/128)*x2*x3*x4^3)/(x1*x2*x3*x4)]
[((-5/32*I + 11/32)*x0^2*x1*x2*x3 + (-1/8*I + 1/4)*x1*x2^2*x3^2 +
(-7/32*I - 15/32)*x0^2*x1*x2*x4 + (-3/32*I + 1/32)*x0^2*x1*x3*x4 +
(-9/32*I + 3/32)*x0^2*x2*x3*x4 + (-267/32*I + 161/128)*x1^2*x2*x3*x4 +
(-5/16*I + 23/16)*x1*x2^2*x3*x4 + (1/64*I - 29/128)*x2^3*x3*x4 +
(-1/8*I + 3/2)*x1*x2*x3^2*x4 + (-21/64*I + 13/128)*x2*x3^3*x4 +
(17/64*I + 7/32)*x1*x2^2*x4^2 + (7/8*I + 7/4)*x1*x2*x3*x4^2 + (9/64*I
+ 7/64)*x1*x3^2*x4^2 + (-5/16*I + 13/128)*x2*x3*x4^3)/(x1*x2*x3*x4)
((47/32*I - 7/8)*x0^2*x1*x2*x3 + (5/64*I + 15/32)*x1*x2^2*x3^2 +
(47/32*I + 3/4)*x0^2*x1*x2*x4 + (-15/32*I + 1/2)*x0^2*x1*x3*x4 +
(-27/32*I + 1/2)*x0^2*x2*x3*x4 + (41/8*I + 49/16)*x1^2*x2*x3*x4 +
(-13/32*I + 1/16)*x1*x2^2*x3*x4 + (-27/64*I - 31/64)*x2^3*x3*x4 +
(33/32*I + 13/8)*x1*x2*x3^2*x4 + (21/32*I - 13/64)*x2*x3^3*x4 + (1/8*I
- 29/64)*x1*x2^2*x4^2 + (-83/32*I - 15/16)*x1*x2*x3*x4^2 + (-1/64*I -
25/64)*x1*x3^2*x4^2 + (-13/64*I - 5/8)*x2*x3*x4^3)/(x1*x2*x3*x4)]

while N is

[                                                                               
                                                                                
                                                                                
                                                                                
                                                                                
                                                                  0
((-5/32*I + 11/32)*x0^2*x1*x2*x3 + (-1/8*I + 1/4)*x1*x2^2*x3^2 +
(-7/32*I - 15/32)*x0^2*x1*x2*x4 + (-3/32*I + 1/32)*x0^2*x1*x3*x4 +
(-9/32*I + 3/32)*x0^2*x2*x3*x4 + (23/32*I + 129/128)*x1^2*x2*x3*x4 +
(1/2*I - 3/16)*x1*x2^2*x3*x4 + (1/64*I - 29/128)*x2^3*x3*x4 + (-3/16*I
+ 3/8)*x1*x2*x3^2*x4 + (-21/64*I + 13/128)*x2*x3^3*x4 + (17/64*I +
7/32)*x1*x2^2*x4^2 + (1/16*I + 1/4)*x1*x2*x3*x4^2 + (9/64*I +
7/64)*x1*x3^2*x4^2 + (-5/16*I + 13/128)*x2*x3*x4^3)/(x1*x2*x3*x4)]
[  ((5/32*I - 11/32)*x0^2*x1*x2*x3 + (1/8*I - 1/4)*x1*x2^2*x3^2 +
(7/32*I + 15/32)*x0^2*x1*x2*x4 + (3/32*I - 1/32)*x0^2*x1*x3*x4 +
(9/32*I - 3/32)*x0^2*x2*x3*x4 + (-23/32*I - 129/128)*x1^2*x2*x3*x4 +
(-1/2*I + 3/16)*x1*x2^2*x3*x4 + (-1/64*I + 29/128)*x2^3*x3*x4 +
(3/16*I - 3/8)*x1*x2*x3^2*x4 + (21/64*I - 13/128)*x2*x3^3*x4 +
(-17/64*I - 7/32)*x1*x2^2*x4^2 + (-1/16*I - 1/4)*x1*x2*x3*x4^2 +
(-9/64*I - 7/64)*x1*x3^2*x4^2 + (5/16*I - 13/128)*x2*x3*x4^3)/
(x1*x2*x3*x4)
 
0]

(I can provide the dumpstrings if anyone is interested in trying)
(oh and here I is sqrt(-1))

HOWEVER, it is in fact possible to do sum(L[30:]) + sum(L[:30]) !!
don't know whether the answer is meaningful though. In fact, other
experiments with these matrices lead me to believe that sometimes
sum() just gets the wrong answer (things that were supposed to commute
didn't commute; but they were sums of things which did commute).

Thoughts anyone ?

Pierre





--~--~---------~--~----~------------~-------~--~----~
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-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to