Jason Grout wrote: > The problem here is that no one has really implemented a numerically > stable version of echelon_form for RR. I thought we called scipy for > rank calculations over RDF, but apparently we don't even do that! Scipy > answers correctly: > > sage: import scipy > sage: scipy.rank(m.numpy()) > 2 > > > Very little attention has been paid to numerically stable linear algebra > for non-exact rings. We do get some numerically stable things for > matrices over RDF and CDF because those are based on numpy and scipy > (which call blas and lapack routines). However, apparently we don't > call numpy/scipy to calculate the rank, but instead rely on our unstable > echelon form computation!
This was hinted at by the (m == n) example in my original message, but if I can type it, it isn't an irrational number. Since any (decimal) number entered manually is guaranteed to be rational, it can be represented as a fraction, and those are handled correctly. This is probably already implemented to some extent, or else (m == n) would not have returned True. > If someone wanted to take make a good library of numerically stable > linear algebra routines based on mpfr, I think it would be absolutely > awesome. Irrationals have to be entered symbolically, and SAGE can already manipulate symbols well-enough. I would like to say, "just compute the rref symbolically," but that idea breaks down somewhat given two irrationals that are linearly dependent. I should review my algebra before saying something dumb, but I think that arbitrary precision would be useful in that case. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---