MathGroup Archive 2005

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

Search the Archive

Kronecker Product with SparseArray

  • To: mathgroup at smc.vnet.net
  • Subject: [mg62108] Kronecker Product with SparseArray
  • From: Cyrus F Hirjibehedin <hirjibe at us.ibm.com>
  • Date: Fri, 11 Nov 2005 02:52:39 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

To Mathgroup:

I'm trying to implement a function in Mathematica 5.2 to take the 
Kronecker Product of two large sparse matrices.  The simplest suggested 
way to do this seems to be

  BlockMatrix[Outer[Times, X, Y]]

where X and Y are two matrices.  The BlockMatrix is necessary because 
Outer produces a matrix of matrices, rather than a matrix of elements, and 
this is not compatible with functions like Eigenvalues or Eigensystem.

What I would like to do is pass in X and Y as SparseArray types and have 
the result produce a SparseArray type that I can pass to functions like 
Eigenvalues or Eigensystem.  Right now, I'm doing this with

  SparseArray[BlockMatrix[Outer[Times, X, Y]]]

where X and Y are SparseArray types.  The problem is that I run out of 
memory when trying to compute large matrices.  I think the problem is that 
when BlockMatrix tries to "flatten" the results of Outer it first 
generates the full dense matrix representation, which is too big either 
for it or for SparseArray to handle.

Does anyone know how to turn the results of Outer[Times,X,Y]] into an 
object that is a SparseArray type that can be passed to things like 
Eigenvalues or Eigensystem?

  or

Does anyone know of a different way to directly compute the Kronecker 
Product of two matrices represented as SparseArray types and have the 
output be a SparseArray type that can be passed to Eigenvalues without 
generating an intermediate dense matrix representation?

Any advice would be greatly appreciated.

Sincerely,

Cyrus
 
--

Cyrus F. Hirjibehedin
hirjibe at us.ibm.com


  • Prev by Date: Re: Re: integer solution
  • Next by Date: Timing runs for the last part of my previous post
  • Previous by thread: Re: FileNamesin a loop..
  • Next by thread: Re: Kronecker Product with SparseArray