On Tue, Nov 17, 2009 at 09:23:40PM +0100, Francois Maltey wrote: > This calculus is maple-right but is user-discourteous. > > M = matrix ([[a,b],[c,d]]) > 0*M = 0 with maple, and all other systems answer matrix([[0,0],[0,0]]) > > Even if you explain that for maple syntax, it's normal to get 0*A = 0 > because the right way is "evalm(0*M)", I repeat : "everyone thinks that > 0*M = matrix 0, not number 0". This 0*XYZ=0 rule isn't fine. > Only(?) an object language (as python) can treat this "multi-sens" of zero.
I'm not sure I understand this paragraph. Mathematically, 0*M is always the zero matrix and never the number 0. So it seems to me that maple screws up if it returns the number 0. In Sage: sage: var("a b c d") (a, b, c, d) sage: M = matrix([[a,b],[c,d]]) sage: 0*M [0 0] [0 0] > I have an other question : how can you easily verify this theorem in > sage ? > > M = matrix([[a,b],[c,d]]) # or an nxn matrix with any parameters... > P = det (M - x*matrix ONE) # Call Cayley-Hamilton therem in France > eval (P with x=M) answers matrix([[0,0],[0,0]]). Here is one way, I don't know if there's an easier one: sage: var("a b c d") (a, b, c, d) sage: M = matrix([[a,b],[c,d]]) sage: I = M.parent()(1) sage: P = lambda x: det(M - x*I) sage: P(M) 0 > > The two first methods I don't find in sage was : > > 1/ Sum as sum(q^k, k=0..N)=(1-q^(n+1))/(1-q) and sum(x^k/k!, k=0..+oo)=e^x This is in the works presently, wrapping Maxima's symbolic summation. It's ticket 3587, and might make it into sage-4.3: http://trac.sagemath.org/sage_trac/ticket/3587 > 2/ kernel over matrix is right, but I don't find the maple intbasis and > sumbasis which build a basis for F cap G and F+G where the F and G > subspaces are described by a list of vectors. > You have to work with the objects in Sage (which in my opinion is good because students are forced to think about subspaces rather than lists of vectors): sage: V = VectorSpace(QQ, 5) sage: F = V.subspace([(0,1,2,3,4), (1,2,3,4,6), (0,1,0,1,0)]) sage: G = V.subspace([(1, 1, 0, 0, 0), (0, 1, 1, 2, 2), (5, 4, 3, 2, 1)]) sage: I = F.intersection(G) sage: I.basis() [ (1, 0, -1, -2, -2), (0, 1, 1, 2, 2) ] sage: S = F + G sage: S.basis() [ (1, 0, 0, -1, 0), (0, 1, 0, 1, 0), (0, 0, 1, 1, 0), (0, 0, 0, 0, 1) ] Best, Alex -- Alex Ghitza -- Lecturer in Mathematics -- The University of Melbourne -- Australia -- http://www.ms.unimelb.edu.au/~aghitza/ -- 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 URL: http://www.sagemath.org