Ask Your Question

neha's profile - activity

2021-10-20 12:36:04 +0200 received badge  Nice Question (source)
2021-08-14 18:45:46 +0200 received badge  Famous Question (source)
2019-02-11 05:17:31 +0200 received badge  Notable Question (source)
2017-12-06 22:19:41 +0200 received badge  Popular Question (source)
2016-04-14 15:18:14 +0200 commented answer Evaluating a polynomial on a matrices

Thank you so much! I got it now. I was able to see it displayed after the question. (I removed it later so that my question was still coherent.) Thanks again for your help!

2016-04-14 15:10:43 +0200 received badge  Editor (source)
2016-04-14 09:05:41 +0200 received badge  Scholar (source)
2016-04-14 09:01:12 +0200 answered a question Evaluating a polynomial on a matrices

M=ModularSymbols(23,2,1) T2=M.T(2).matrix() var ('x') I=identity_matrix(3) f=(x*I-T2).det() f

2016-04-14 08:43:47 +0200 commented answer Evaluating a polynomial on a matrices

@slelievre: Sorry for the delayed response. Thank you, your detailed example helped and I was able to get the code to work! I am unable to insert the code, though. I mean...the commands don't appear like how your example does (with "sage: " appearing before each command). I copy-pasted a few lines from the worksheet I am using on sagemath cloud, selected the lines and clicked on the code icon, but it just appears as a series of commands one after the other, not even in separate lines. :( Sorry to bother you again, but what am I doing wrong?

2016-04-12 10:52:18 +0200 commented answer Evaluating a polynomial on a matrices

Thanks. But I think my problem persists because of the way I am evaluating it. I separated out the irreducible factors of the characteristic polynomial using factor_list(). After that, I am able to evaluate the factors over integers successfully, but an error message is displayed if I try evaluating over matrices.

This is the error message (the last line...): "TypeError: no canonical coercion from Full MatrixSpace of 3 by 3 dense matrices over Rational Field to Symbolic Ring"

Could you please help me with this? Also, how do you copy paste a segment of code here, like the way you showed me an example?

2016-04-12 09:00:51 +0200 received badge  Student (source)
2016-04-12 08:57:07 +0200 asked a question Evaluating a polynomial on a matrices

Hi, I would like to evaluate a polynomial f(x) with coefficients as integers by letting x to be a matrix T. How do I do this on sage? The context is this: I have a matrix A. sage can tell me the characteristic polynomial of A. It will even factorize it for me, say, as f_1(x)f_2(x)f_3(x). I know how to extract each irreducible factor. Is there a way that I can use f_i(x) to evaluate it on a matrix, using sage? (other than manually writing out the polynomial with x replaced by the matrix I wish to evaluate on)

I am new to sage so apologies if this is a silly question.