Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1999
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1999

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

Search the Archive

RE: Kronecker product of matrices

  • To: mathgroup at smc.vnet.net
  • Subject: [mg18502] RE: [mg18429] Kronecker product of matrices
  • From: "Ersek, Ted R" <ErsekTR at navair.navy.mil>
  • Date: Wed, 7 Jul 1999 23:08:53 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

Kostas Oikonomou  wrote:
------------------------
 
Is there a simple way to make Outer[Times,A,B] produce the Kronecker
product of A and B?  What I mean is that if A is nxn and B mxm, Outer
produces a block form, instead of a plain (mn)x(mn) matrix.
 
-------------------------

The concept of KroneckerProduct was used in a course I took on Kalman
Filtes.  In that course  it was defined as follows:

  Given matrices A and B 
  KroneckerProduct[A,B] is the tensor 
  produced by multiplying each element 
  of (A) by the matrix (B).

If this is the definition you need the oneliner below will do it.  I don't
see how it can be done with Outer.
 
 
In[1]:=
KroneckerProduct[a_?MatrixQ,b_?MatrixQ]:=Map[# b&, a, {-1}]

Now for a small example.
----------------------------

In[2]:=
a={{a11,a12},{a21,a22}};
b={{b11,b12},{b21,b22}};

In[4]:=
KroneckerProduct[a,b]

Out[4]=
{{
  {{a11 b11,a11 b12},{a11 b21,a11 b22}},
  {{a12 b11,a12 b12},{a12 b21,a12 b22}}},
  {{{a21 b11,a21 b12},{a21 b21,a21 b22}},
  {{a22 b11,a22 b12},{a22 b21,a22 b22}}
}}


-------------
Regards,
Ted Ersek


  • Prev by Date: how decrease computation time?
  • Next by Date: trouble with printing
  • Previous by thread: Kronecker product of matrices
  • Next by thread: Re: Kronecker product of matrices