sonium wrote: > Hi, I have problems calculating the eigenvectors of a symbolic matrix. > I tried: > > a,b = var('a'),var('b') > M = matrix(SR,4,4,((a, 0, 0, 0), (0,-a,0,0), (0,0,a,0), (0,0,0,-a))) > M.eigenvectors_right() > > what results in: > AttributeError: 'SymbolicArithmetic' object has no attribute 'degree' >
This comes from us not having a special implementation of the eigen functions for symbolic matrices (i.e., using maxima). For now, you can do: sage: a,b = var('a'),var('b') sage: M = matrix(SR,4,4,((a, 0, 0, 0), (0,-a,0,0), (0,0,a,0), (0,0,0,-a))) sage: M._maxima_().eigenvectors().sage() [[[-a, a], [2, 2]], [0, 1, 0, 0], [0, 0, 0, 1], [1, 0, 0, 0], [0, 0, 1, 0]] See http://maxima.sourceforge.net/docs/manual/en/maxima_25.html#Item_003a-eigenvectors to understand the output of the command. The specific error you received came from there not being a .degree() method for a symbolic polynomial. > and > > P.<a,b> = PolynomialRing(QQ) > M = matrix(P,4,4,((a, 0, 0, 0), (0,-a,0,0), (0,0,a,0), (0,0,0,-a))) > M.eigenvectros_right() > > what gives: > > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File "/home/sage/sagenb/sage_notebook/worksheets/sonium/1/code/ > 26.py", line 6, in <module> > M.eigenvectors_right() > File "/home/sage/sage_install/sage-a/local/lib/python2.5/site- > packages/SQLAlchemy-0.4.6-py2.5.egg/", line 1, in <module> > > File "matrix2.pyx", line 3054, in > sage.matrix.matrix2.Matrix.eigenvectors_right (sage/matrix/matrix2.c: > 18020) > File "matrix2.pyx", line 3000, in > sage.matrix.matrix2.Matrix.eigenvectors_left (sage/matrix/matrix2.c: > 17523) > File "matrix2.pyx", line 2755, in > sage.matrix.matrix2.Matrix.eigenspaces_left (sage/matrix/matrix2.c: > 16250) > File "matrix2.pyx", line 1058, in sage.matrix.matrix2.Matrix.fcp > (sage/matrix/matrix2.c:7456) > File "polynomial_element.pyx", line 2288, in > sage.rings.polynomial.polynomial_element.Polynomial.factor (sage/rings/ > polynomial/polynomial_element.c:18681) > NotImplementedError I'm not sure what is going on here... Thanks, Jason --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---