Re: Matrix Multiplication (with a twist)
- To: mathgroup at smc.vnet.net
- Subject: [mg68984] Re: [mg68951] Matrix Multiplication (with a twist)
- From: Adriano Pascoletti <pascolet at dimi.uniud.it>
- Date: Sat, 26 Aug 2006 02:04:19 -0400 (EDT)
- References: <200608250935.FAA09217@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
On 25 ago 2006, at 11:35, Bruce Colletti wrote: > 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 > In[1]:= A = {{e,f},{g,h}} ; B = {{a,b},{c,d}}; Inner[NonCommutativeMultiply, A, B, Plus] Out[2]= {{e**a+f**c,e**b+f**d},{g**a+h**c,g**b+h**d}} Adriano Pascoletti
- References:
- Matrix Multiplication (with a twist)
- From: Bruce Colletti <vze269bv@verizon.net>
- Matrix Multiplication (with a twist)