I'd say the characteristic polynomial is usually defined to be det( xI-M ); this is certainly the convention in graph theory.
Chris On Jun 15, 7:21 am, Minh Nguyen <nguyenmi...@gmail.com> wrote: > Hi folks, > > In trying to improve the documentation and doctests of the database of > common graphs [1], I come across what I think is rather inconsistent > or perhaps wrong. First, I created the bull graph using the built-in > graph generator. Then I computed the characteristic polynomial of the > bull graph using the built-in characteristic polynomial method: > > [mv...@sage ~]$ sage > ---------------------------------------------------------------------- > | Sage Version 4.4.3, Release Date: 2010-06-04 | > | Type notebook() for the GUI, and license() for information. | > ---------------------------------------------------------------------- > sage: B = graphs.BullGraph() > sage: B.characteristic_polynomial() > x^5 - 5*x^3 - 2*x^2 + 3*x > sage: M = B.adjacency_matrix(); M > [0 1 1 0 0] > [1 0 1 1 0] > [1 1 0 0 1] > [0 1 0 0 0] > [0 0 1 0 0] > sage: M.characteristic_polynomial() > x^5 - 5*x^3 - 2*x^2 + 3*x > > I then computed the characteristic polynomial from the definition > det(M - xI), where M is a square matrix, x a variable, and I the > identity matrix of dimensions the same as M: > > sage: Id = identity_matrix(ZZ, 5); Id > [1 0 0 0 0] > [0 1 0 0 0] > [0 0 1 0 0] > [0 0 0 1 0] > [0 0 0 0 1] > sage: D = M - x*Id > sage: D.determinant() > -x^5 + 5*x^3 + 2*x^2 - 3*x > > As you can see, these two characteristic polynomials differ in only > their signs. One can be obtained from the other by multiplying through > by -1. What I would like to know is: Is there some reason for this > inconsistency? Or are the two characteristic polynomials above > "essentially" the same? > > [1]http://www.sagemath.org/doc/reference/sage/graphs/graph_generators.html > > -- > Regards > Minh Van Nguyen -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org