Hi Id like to write a package that can do "pure"/"abstract" matrix expressions such as in the following examples
To keep things simple, in the examples below, let A, B, C... be matrices; k be a scalar "*" be matrix or scalar multiplication, "^-1" and "^T" and "^n" be matrix inverse, transpose and power sage: (A * B)^2 A * B * A * B sage: (A * B)^-1 B^-1 * A^-1 sage: assume(A = B^-1) sage: A * B I # this is the identity matrix sage: A * (B+ C) A * B + A * C sage: (A * B + A * C).factor() A * (B+ C) sage: k * (B+ C) k * B + k * C # Note: Assume I probably did a few things first, like sage: var('k,N'); A = abstractmatrix(N, N); B = abstractmatrix(N, N); C = abstractmatrix(N, N) # this is so sage knows what kind of objects "*" and "+" are acting on and so I cant add/multiply nonconforming matrices This isnt a full specification - there are many issues not addressed and note we are considering "pure matrix" expressions only (i.e. no matrix components). Also the matrix size "N" is arbitrary - doesnt ever need to be assigned a value. I can think of two ways of doing this and just asking for peoples gut feeling which direction I should go in to implement this within Sage. Possibility 1) We consider this a noncommutative algebra and look at GAP (are there other possiblilities?) Possibility 2) Consider these matrix expressions as symbol expressions and use pattern matching with rewrite rules to transform expressions such as those shown above (python has regular expression capabilities and I expect something can be done using maxima or pynac - is there anything else? Lisp maybe?) I expect this will be wanted by some people. Some guidance will hopefully realize it sooner. BTW Its ok if the solution involves python, C++ or Lisp Thanks -- 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 To unsubscribe, reply using "remove me" as the subject.