Ask Your Question

maurizio's profile - activity

2023-07-15 03:53:17 +0200 received badge  Famous Question (source)
2023-05-22 07:40:03 +0200 received badge  Notable Question (source)
2021-11-29 11:06:49 +0200 received badge  Popular Question (source)
2019-02-01 10:19:47 +0200 received badge  Nice Question (source)
2019-01-31 22:24:13 +0200 received badge  Student (source)
2019-01-31 21:30:24 +0200 commented answer Factorize characteristic polynomial in SR base ring

Awesome thanks. @nbruin if you don't mind, I was missing the possibility for this command: SR('x'). This tells Sage basically to use the unknown x within the SR field? Or how should I interpret it? 'Cause it is not completely immediate for me that I am using a base ring class as a method, unless I think of it as a short way to instantiate a variable of that class (something like : in C++ class definers).

2019-01-31 21:26:18 +0200 received badge  Scholar (source)
2019-01-31 18:52:23 +0200 asked a question Factorize characteristic polynomial in SR base ring

I am total newbie to SAGE so this question might be trivial. How can I factorize the characteristic polynomial obtained by a symbolic matrix in SAGE 8.6? Is there a workaround the fact that factor() is not defined on the base ring SR which is the one inherited from the symbolic matrix?

For example I have in a SAGE/Jupyter notebook something like:

a,b,c = var('a','b','c')
M = Matrix(SR,3,3)
M[0] = [a, -b, 0]
M[1] = [c, a+b, 0]
M[2] = [0, 0, 1]
e = M.eigenvalues()
f = M.charpoly()
factor(f)

The last instruction raises a NotImplementedError as expected from the fact that factor is not defined on SR... In my real problem I am computing characteristic polynomials of large (8x8) symbolic matrices and I would like to get at glance all the factors, so as to quickly isolate negative real roots and instead easily discuss conditions for existence and sign of symbolic ones.