Eigenvalues of matrix with entries in polynomial ring

i like this post (click again to cancel)
1
i dont like this post (click again to cancel)

Hi!

I just wrote some code on the sage-combinat queue which computes a matrix with entries in a polynomial ring R = PolynomialRing(QQ, 'x', n)

sage: P = Poset(([1,2,3,4], [[1,3],[1,4],[2,3]]), linear_extension = True)
sage: L = P.linear_extensions()
sage: M = L.markov_chain_transition_matrix(labeling = 'source')
sage: M
[-x0 - x1 - x2            x3       x0 + x3             0             0]
[      x1 + x2 -x0 - x1 - x3             0            x1             0]
[            0            x1      -x0 - x3             0            x1]
[            0            x0             0 -x0 - x1 - x2       x0 + x3]
[           x0             0             0       x0 + x2 -x0 - x1 - x3]
sage: M.eigenvalues()
---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)

/Applications/sage-5.0.beta7/devel/sage-combinat/sage/combinat/posets/<ipython console> in <module>()

/Applications/sage-5.0.beta7/local/lib/python2.7/site-packages/sage/matrix/matrix2.so in sage.matrix.matrix2.Matrix.eigenvalues (sage/matrix/matrix2.c:26415)()

/Applications/sage-5.0.beta7/local/lib/python2.7/site-packages/sage/matrix/matrix2.so in sage.matrix.matrix2.Matrix.fcp (sage/matrix/matrix2.c:11089)()

/Applications/sage-5.0.beta7/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_element.so in sage.rings.polynomial.polynomial_element.Polynomial.factor (sage/rings/polynomial/polynomial_element.c:22655)()

NotImplementedError:

Is it possible to compute this some other way or is this just not yet implemented (which would surprise me!).

Thanks,

Anne

asked Mar 16 '12

Anne Schilling gravatar image Anne Schilling
31 1 3 5

updated Mar 16 '12

kcrisman gravatar image kcrisman
7812 20 78 170

Just for future reference, this site uses markdown for markup, so indenting everything four spaces makes it look like code (or highlighting and using the "code" button).

kcrisman (Mar 16 '12)

2 Answers:

i like this answer (click again to cancel)
2
i dont like this answer (click again to cancel)

Could you change the ring to SR as a workaround?

sage: R = PolynomialRing(QQ, 'x', 2)
sage: x = R.gens()
sage: M = matrix([[x[0],x[1]],[x[1],x[0]]])
sage: M.eigenvalues()
---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)
[...]
sage: M.change_ring(SR)
[x0 x1]
[x1 x0]
sage: M.change_ring(SR).eigenvalues()
[x0 - x1, x0 + x1]
link

posted Mar 16 '12

DSM gravatar image DSM flag of Canada
4892 12 65 105

Thank you! That works! Am I allowed to use this in sage source code?

Anne Schilling (Mar 18 '12)

If by that you mean for stuff getting committed to mainline, I'm not sure. Seems a little hacky, and it feels like there should be a way to do it while staying purely in some polynomial ring.

DSM (Mar 18 '12)
i like this answer (click again to cancel)
0
i dont like this answer (click again to cancel)

Here is an easier example with the question:

sage: R = PolynomialRing(QQ, 'x', 2)
sage: x = R.gens()
sage: M = matrix([[x[0],x[1]],[x[1],x[0]]])
sage: M.eigenvalues()
---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)

/Applications/sage-5.0.beta7/devel/sage-combinat/sage/combinat/posets/<ipython console> in <module>()

/Applications/sage-5.0.beta7/local/lib/python2.7/site-packages/sage/matrix   /matrix2.so in sage.matrix.matrix2.Matrix.eigenvalues (sage/matrix/matrix2.c:26415)()

/Applications/sage-5.0.beta7/local/lib/python2.7/site-packages/sage/matrix/matrix2.so in sage.matrix.matrix2.Matrix.fcp (sage/matrix/matrix2.c:11089)()

/Applications/sage-5.0.beta7/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_element.so in      sage.rings.polynomial.polynomial_element.Polynomial.factor (sage/rings/polynomial/polynomial_element.c:22655)()

NotImplementedError:
link

posted Mar 16 '12

Anne Schilling gravatar image Anne Schilling
31 1 3 5

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
Login/Signup to Post

Question tools

Tags:

Stats:

Asked: Mar 16 '12

Seen: 114 times

Last updated: Mar 16 '12

powered by ASKBOT version 0.7.22
Copyright Sage, 2010. Some rights reserved under creative commons license.