fix bug where triang would give a diagonalisable matrix

This commit is contained in:
Lukasz M 2022-09-06 16:01:46 +02:00
parent 9075fc3c8d
commit 32a8bd9dc6

View File

@ -139,7 +139,7 @@ def practice(t) :
c = a.LUdecompositionFF()[3] c = a.LUdecompositionFF()[3]
croots = {k: k for k in sp.roots(c.charpoly()) if k not in sp.roots(c.charpoly(), filter='Z')} croots = {k: k for k in sp.roots(c.charpoly()) if k not in sp.roots(c.charpoly(), filter='Z')}
# make sure only integer roots and c is not diagonalisable # make sure only integer roots and c is not diagonalisable
if not (len(croots) != 0 and c.is_diagonalizable) : if not (len(croots) != 0 or c.is_diagonalizable()) :
a = c a = c
pmat = pascalmat(rowcol) pmat = pascalmat(rowcol)
# multiply by a pascal matrix to get a similar matrix with nice numbers # multiply by a pascal matrix to get a similar matrix with nice numbers