On 10/28/19 12:03 PM, Nils Bruin wrote: > On Monday, October 28, 2019 at 3:30:03 AM UTC-7, Michael Jung wrote: > > Nice example! I see your point. > > However, I wonder. The matrix inversion should cause the same > problem, but it is implemented for the symbolic ring. What is different? > > > I don't think it is really implemented *for* the symbolic ring. It's > just an implementation that gets used for the symbolic ring and once > people submit enough bug reports about it, it probably needs to be > deprecated of be adorned with a warning message. > > For Gram-Schmidt, there's a further problem: you need a definite inner > product for it to work....
I'm torn on this one. I think the practical reason that Gram-Schmidt isn't implemented for inexact rings is because the QR method isn't implemented for matrices over inexact rings, and all gram_schmidt() does is call QR(). And while I know that linear algebra doesn't work over an inexact field, it would still be nice sometimes if I didn't have to play these games in my library code. Ultimately, all you need for Gram-Schmidt is a list of vectors in some space where an inner_product() method is defined. No matrix or anything, just a list of vectors. Then you compute the thing using the Wikipedia algorithm, and get back another list of orthogonal (and optionally normal) vectors. There's no need to even involve a matrix, and having to go from an abstract Hilbert space element to a vector to a matrix to the matrix's transpose to its QR factorization to its transpose to a list of vectors that might be zero to a list of vectors that are non-zero and then back to abstract elements starts to feel like maybe it's not the most efficient way to do things. Will it give you great answers on pathological sets? Nope. But nothing else in linear algebra works either, so as long as we're still allowed to create vector spaces over RR, SR, and friends -- this seems like an odd place to draw a line in the sand. I've had to reimplement Gram-Schmidt four or five times now to work around this so that people who use my code can ignore my warnings and use RealField(100) as their base field. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/658ff80e-b370-d420-8ca4-596da526e23c%40orlitzky.com.