On 31 mar, 21:44, Edgar Duéñez-Guzmán <eadue...@gmail.com> wrote: > Hello, > > I recently upgraded sage to the binary version 4.6.2 for Ubuntu i586, > and ran into the following error: > > sage: (r,s,t,c,d,p,q) = var( 'r,s,t,c,d,p,q' ) > sage: A = matrix( [ [r, -s, r, -s], [t, 0, t-p, -p], [r, -s-c, r, -s-d], [t, > -c, t-q, -q-d] ] ) > sage: A > [ r -s r -s] > [ t 0 -p + t -p] > [ r -c - s r -d - s] > [ t -c -q + t -d - q] > sage: u = A.solve_right( vector([1,1,1,1]) ) > --------------------------------------------------------------------------- > NotImplementedError Traceback (most recent call last) > > /home/duenez/Download/sage-4.6.2-linux-32bit-ubuntu_10.04_lts-i686-Linux-i686-Linux/<ipython > console> in <module>() > > /home/duenez/Download/sage-4.6.2-linux-32bit-ubuntu_10.04_lts-i686-Linux-i686-Linux/local/lib/python2.6/site-packages/sage/matrix/matrix2.so > in sage.matrix.matrix2.Matrix.solve_right (sage/matrix/matrix2.c:3387)() > > /home/duenez/Download/sage-4.6.2-linux-32bit-ubuntu_10.04_lts-i686-Linux-i686-Linux/local/lib/python2.6/site-packages/sage/rings/ring.so > in sage.rings.ring.Ring.is_integral_domain (sage/rings/ring.c:6035)() > > NotImplementedError: > > This was working perfectly in version 4.5.3 OpenSuSE 11.1, and it seems > that it has nothing to do with SuSE vs Ubuntu (I am on OpenSuSE 11.4). > > It seems that the problem is in the Symbolic Ring (SR) not implementing > the *is_integral_domain *function. This changed from 4.3 to 4.6 in ticket > #10481 where they (correctly) changed the behavior of *is_integral_domain() > *to raise an exception. The problems seems to be that SR does not implement > this correctly. SR should be an integral domain for most practical uses, > right? Or am I missing something? > > If this is truly a bug (or unintended feature), I think overriding * > is_integral_domain* in SymbolicRing to return *True* should be a good idea.
Hi Edgar, this reminds me of a recent trac ticket about the determinant function: http://trac.sagemath.org/sage_trac/ticket/10063 The computation of the determinant can be done by a faster algorithm when the coefficients of the matrix live in a field, but there is also a way to compute it in the more general setting of coefficients in a ring. The ticket was opened after trying to compute a determinant of a matrix with coefficients in a ring which was the quotient of a ring by an ideal. The algorithm tested whether the ideal was maximal in order to know whether the quotient ring was a field. In the particular case that was being used, a NotImplementedError was being returned by is_maximal(). However testing whether the field is a ring was there only to decide between a faster algorithm which works only for fields, and a slower algorithm which works for all rings, so when the test fails for some reason, one should just go ahead and use the more general method which works for all rings. The solution was to introduce a "try" test in the appropriate place (see the ticket for the discussion about the appropriate placement of the "try" test). Maybe a similar ticket should be opened for the problem you mention, and hopefully the ticket 10063 about determinants can be mimicked to provide a patch quickly. Samuel -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org