Hello all,
Leo Butler was helpful earlier in showing how to add custom rules to
Maxima. I don't know how to do several more advanced rules. I was
wondering if anyone was interested in helping me start developing a
package that would more or less encapsulate many of the rules in the
Matrix Cookbook. I am not sure how best to go about it (tellsimp /
match declare or actually writing some Lisp functions). Regardless I'm
new to adding functionality to Maxima (and I've never used lisp, but I
suppose I could learn). Below I provide several example rules that I
would need to know how to incorporate in order to write this package.
I don't know how to tell maxima how write rules that extend to N
variables. For example:
(A_1 . A_2 ... A_n)^^-1 = A_n^^-1 ... A_2^^-1 . A_1^^-1
Also, there are some recursive rules (a recursive rule for just 2
elements could work for the above problem), which may work well using
tellsimp, but I don't know. For instance the matrix-calculus chain
rule:
partial( g(U) ) / partial(X_ij) = Trace( transpose(partial g(U) /
partial U) . partial U / partial X_ij),
this may need to be applied multiple times for different g(U) and U.
Some of the rules use indexed notation:
partial ( transpose(X) . B . X ) / partial (X_ij) = transpose(X) . B .
single_entry_matrix(i,j) +?single_entry_matrix(j,i) . B . X,
where the?single_entry_matrix size is determined by the expression (in
this case, it is the same size as?transpose(X) . B . X)
Is there some way to define a variable as a row or column vector? It
would be useful for expressions like:
partial transpose( b ) . transpose(X) . X . c / partial X = X( b .
transpose(c) + c . transpose(b) ),
specifically I need to know that b and c are column vectors for the
above identity to work.
How can I tell Maxima to "Rotate" matrices inside a trace?
Tr( A . B . C . single_entry_matrix(i, j) . D . E) = Tr( D . E . A . B
. C . single_entry_matrix(i, j) ) = the ith, jth index of ( D . E . A
. B . C )
Thanks in advance for any advice. I know this is a very ambitious
undertaking since the first two chapters contain about 100 identities.
I suspect at least some can be re-derived using the chain rule and
some of the basic rules. Again, I am not sure how best to go about
building a package to really help me out.