On Jun 21, 9:59 pm, Rob Beezer <[email protected]> wrote: > I think I have one more big push left in me as I try to tidy up linear > algebra in Sage to make it even more useful for students studying the > subject for the first time. Eigen-stuff is on my radar. Some > behaviors that I find problematic, most vexing first. > > 1. Eigenspaces > > sage: A = matrix(QQ, [[0,-1,0,0],[1,0,0,0],[0,0,0,-1],[0,0,1,0]]) > sage: A.eigenspaces_right() > [ > (a0, Vector space of degree 4 and dimension 2 over Number Field in a0 > with defining polynomial x^2 + 1 > User basis matrix: > [ 1 -a0 0 0] > [ 0 0 1 -a0]) > ] > > It is real impressive that we can do computations in QQbar and get > Galois conjugates and all, but there is no possible way to explain > this to a student who is fresh out of calculus. what about sage: A = matrix(QQbar, [[0,-1,0,0],[1,0,0,0],[0,0,0,-1],[0,0,1,0]]) sage: A.eigenspaces_right() [ (1*I, Vector space of degree 4 and dimension 2 over Algebraic Field User basis matrix: [ 1 -1*I 0 0] [ 0 0 1 -1*I]), (-1*I, Vector space of degree 4 and dimension 2 over Algebraic Field User basis matrix: [ 1 1*I 0 0] [ 0 0 1 1*I]) ]
isn't it what you need? > I would like to > retain getting eigenspaces as "true" vector spaces, since I think this > is a real strength of Sage. But I'd rather have the textual versions > of the QQbar elements, like the output for eigenvectors: > > sage: A.eigenvectors_right() > [(-1*I, [(1, 1*I, 0, 0), (0, 0, 1, 1*I)], 2), (1*I, [(1, -1*I, 0, 0), > (0, 0, 1, -1*I)], 2)] > > Question: is it important to only get a limited number of non- > isomorphic eigenspaces back? Most of that information seems available > to me from the factored characteristic polynomial, easily obtainable > with the fcp() method. use QQbar > > sage: A.fcp() > (x^2 + 1)^2 > > Thoughts or reactions to returning an eigenspace per eigenvalue, with > QQbar elements as entries of basis vectors, etc? see above (just use QQbar to begin with) > > 2. Eigenspaces for matrices over RDF/CDF > > These eigenspaces come back as dimension 1, always. The method was > adjusted to match the format of returned values for exact matrices > (and I was a party to that). With more experience with the floating > point matrix class, I've come to the conclusion this is a really bad > idea, bordering on criminal. how is this more criminal than the same information in eigenmatrices? > So, I'd propose raising a NotImplemented > exception for an eigenspace request, since all the information > presently returned for eigenspaces can be found with the existing > eigenmatrix commands. Reactions? > > 3. Algebraically Closed Fields > > We return eigenvalues outside the base field, by default, only for the > rationals. Not sure I'm suggesting anything here, it just seems odd > that we do this in the one case, just because we can? surely this is doable over finite fields, too. > > 4. Sorting Eigenvalues > > Easy and natural to sort eigenvalues over RDF and QQ. Messier in > other cases. Docstrings say things like: > > The eigenspaces are returned sorted by the corresponding > characteristic polynomials, where polynomials are sorted in > dictionary order starting with constant terms. > > But I do not quite see that implemented unless it comes from deep in > the factorization of the characteristic polynomial somehow. In any > event, trying to get a consistent approach to the sort order looks > like a big job with the existing code. Maybe somebody has some > thoughts about this. there is no natural way to order elements of an unorderable field, IMHO... > > Thanks in advance for thoughts, affirmative or dissident. > > Rob Dima -- To post to this group, send an email to [email protected] To unsubscribe from this group, send an email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org
