MathGroup Archive 1999

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

Search the Archive

Re: Kronecker product of matrices


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.

This appeared in the Mathematica Journal a long while ago.  The key is
to use the LinearAlgebra`MatrixManipulation` package.

Notebook[{
Cell[BoxData[
    \(TraditionalForm\`<< LinearAlgebra`MatrixManipulation`\)],
"Input"],

Cell[BoxData[
    \(TraditionalForm\`\((a_?SquareMatrixQ)\)\[CircleTimes]\((b_?
            SquareMatrixQ)\) := BlockMatrix[Outer[Times, a, b]]\)],
"Input"],

Cell[BoxData[
    \(TraditionalForm\`\((a_?SquareMatrixQ)\)\[CirclePlus]\((b_?
            SquareMatrixQ)\) := 
      BlockMatrix[
        Outer[Times, a, IdentityMatrix[Length[b]]] + 
          Outer[Times, IdentityMatrix[Length[a]], b]]\)], "Input"],

Cell["For example,", "Text"],

Cell[BoxData[
    \(TraditionalForm\`\[ScriptCapitalA] = 
      Table[a\_\(i, j\), {i, 2}, {j, 2}]\)], "Input"],

Cell[BoxData[
    \(TraditionalForm\`\[ScriptCapitalB] = 
      Table[b\_\(i, j\), {i, 3}, {j, 3}]\)], "Input"],

Cell[BoxData[
   
\(TraditionalForm\`\[ScriptCapitalA]\[CircleTimes]\[ScriptCapitalB]\)],
\
"Input"],

Cell[BoxData[
   
\(TraditionalForm\`\[ScriptCapitalA]\[CirclePlus]\[ScriptCapitalB]\)], \
"Input"]
}
]

____________________________________________________________________ 
Paul Abbott                                   Phone: +61-8-9380-2734
Department of Physics                           Fax: +61-8-9380-1014
The University of Western Australia           
Nedlands WA  6907                     mailto:paul at physics.uwa.edu.au 
AUSTRALIA                            http://physics.uwa.edu.au/~paul

            God IS a weakly left-handed dice player
____________________________________________________________________


  • Prev by Date: Re: [Q] Implementing identities as rules
  • Next by Date: Re: trouble with greek letter output to EPS
  • Previous by thread: Re: Kronecker product of matrices
  • Next by thread: out of memory reading large(?) file (Q:)