MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: Matrix Multiplication (with a twist)


Bruce,

Use NonCommutativeMultiply and Inner.

A = {{e, f}, {g, h}};
B = {{a, b}, {c, d}};

Inner[#1 ** #2 &, A, B]
{{e ** a + f ** c, e ** b + f ** d}, {g ** a + h ** c, g ** b + h ** d}}

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/


From: Bruce Colletti [mailto:vze269bv at verizon.net]
To: mathgroup at smc.vnet.net

For matrix A = {{e,f},{g,h}} and B = {{a,b},{c,d}}, Mathematica returns
their product

A.B = {{ae+cf,be+df},{ag+ch,bg+dh}}

However, I want to treat multiplication of numeric variables as
noncommutative in order to instead obtain the result

{{ea+fc, eb+fd},{ga+hc,gb+hd}}

How would this be done in v5.2?  Thanks.

Bruce



  • Prev by Date: Beginner--How to resolve a simple system of equation
  • Next by Date: Re: Matrix Multiplication (with a twist)
  • Previous by thread: Re: Matrix Multiplication (with a twist)
  • Next by thread: Re: Matrix Multiplication (with a twist)