Re: Kronecker product of matrices
- To: mathgroup at smc.vnet.net
- Subject: [mg18672] Re: [mg18429] Kronecker product of matrices
- From: Paul Abbott <paul at physics.uwa.edu.au>
- Date: Thu, 15 Jul 1999 01:45:56 -0400
- Organization: University of Western Australia
- References: <7m15ln$po0@smc.vnet.net>
- 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.
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
____________________________________________________________________