Matrix operations on character matrix element?

Terry Reedy tjreedy at udel.edu
Wed Apr 1 20:12:30 EDT 2009


olusina eric wrote:
> I hope somebody will be able to help me here.
> I am trying to solve some physical problems that will require the 
> generation of some function in terms of some parameters. These functions 
> are derived from matrix operation on “characters”. Are there ways 
> numpy/scipy perform matrix operations on characters?
> 
> For example A =  matrix([[a, b,c],[d,e,f],[1,2,3]])  
> 
>                           B = matrix([[g,h,4],[I,j,5],[k,l,6]])

A to l are identifiers, not characters, and must be bound to objects for 
the above to make any sense.  Did you mean 'a' to 'l'?

> Is it possible to perform operations like A*B or A+B
> 
> And most especially: linalg.solve(A,eye(3,3))

If you mean, operate on symbols to do symbolic computation, the same way 
one might with paper and pencil, the simple answer is no.  Numpy is not 
a computer algebra system.

Computer algebra requires that one define classes such as Symbol, with 
all the usual arithmetic operations.  I am not sure whether numpy 
algorithms can work on arrays of instances of user-defined classes such 
as this.

tjr




More information about the Python-list mailing list