On Fri, 8 Nov 2019 at 01:33, saad khalid <[email protected]> wrote: > This functionality seems to be intended somehow? At least, it is made > reference to in the documentation: > http://doc.sagemath.org/html/en/reference/matrices/sage/matrix/matrix2.html > Look at the part after: > "A matrix that is not diagonalizable over the rationals, as evidenced by > its Jordan form." >
I think that this is certainly a bug, this method should return False for a non-diagonalizable matrix, not raise an error. Of course there is an issue here about whether the matrix is diagonalizable over its base field or just over an extension, but that is properly documented. It is reasonable to raise an error for matrices over RR or CC (as they are not exact) though I'm sure that many users will not like sage: m = matrix(CC,2, 2, [0,-1,1,0]) sage: m.eigenvalues() /local/localhome/masgaj/sage/src/bin/sage-ipython:1: UserWarning: Using generic algorithm for an inexact ring, which will probably give incorrect results due to numerical precision issues. #!/usr/bin/env sage-python23 [1.00000000000000*I, -1.00000000000000*I] sage: m.is_diagonalizable() (...) ValueError: base field must be exact, not Complex Field with 53 bits of precision since for such an example "obviously" the eigenvalues are distinct, but at least there is a warning. John > > > -Saad > > On Thursday, November 7, 2019 at 4:38:13 AM UTC-5, Dima Pasechnik wrote: >> >> On Thu, Nov 7, 2019 at 9:15 AM Kwankyu <[email protected]> wrote: >> > >> > Hi, >> > >> > This >> > >> > m = matrix(QQ, 3, [1, 1, 1, 0, 3, 3, -2, 1, 2]) >> > m.is_diagonalizable() >> > >> > raises an error rather than giving False. The error message gives an >> explanation why the matrix is > not diagonalizable. But I think the >> expected result for asking diagonalizability should be either True or >> False, for legitimate inputs. >> >> I agree. It seems that is_diagonalizable() is the only method among >> is_*() for matrices >> that has this strange behavior (I checked several of them, but not all). >> >> CC'ing to the original author... >> >> Dima >> >> > What do you think? >> > >> > >> > >> > >> > -- >> > You received this message because you are subscribed to the Google >> Groups "sage-support" group. >> > To unsubscribe from this group and stop receiving emails from it, send >> an email to [email protected]. >> > To view this discussion on the web visit >> https://groups.google.com/d/msgid/sage-support/4c3a3e63-14d7-4e49-aadb-480b6ff46a64%40googlegroups.com. >> >> > -- > You received this message because you are subscribed to the Google Groups > "sage-support" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sage-support/8efe0856-7376-447f-908e-6e9677d475ea%40googlegroups.com > <https://groups.google.com/d/msgid/sage-support/8efe0856-7376-447f-908e-6e9677d475ea%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/CAD0p0K5-U%3D5h3fKK4xT6A_ERteNy0HS3FRUbMp3h_VHUb-by8Q%40mail.gmail.com.
