Function Repository Resource:

# NearestKroneckerProductSum

Approximate a numerical matrix as sum of Kronecker products

Contributed by: Jan Mangaldan
 ResourceFunction["NearestKroneckerProductSum"][m,{p1,q1},{p2,q2},n] gives a decomposition of a numerical matrix m into a sum of n Kronecker products of matrices of dimensions p1×q1 and p2×q2. ResourceFunction["NearestKroneckerProductSum"][m,{p1,q1},{p2,q2},UpTo[n]] gives the decomposition for n Kronecker products, or as many as are available.

## Details

ResourceFunction["NearestKroneckerProductSum"] returns a list of pairs of matrices {{u1,v1},{u2,v2},}, each of dimensions p1×q1 and p2×q2, such that is minimized, where is KroneckerProduct[a,b] and is Norm[mat,"Frobenius"].
The lists {p1,q1} and {p2,q2} must be commensurate, and satisfy Dimensions[m]={p1p2,q1q2}.
ResourceFunction["NearestKroneckerProductSum"] takes the same options as SingularValueDecomposition.

## Examples

### Basic Examples (2)

Compute a Kronecker product approximation of a small matrix:

 In[1]:=
 Out[1]=

Form the approximant to the original matrix:

 In[2]:=
 Out[2]=

Using two terms gives a much better approximant:

 In[3]:=
 Out[3]=
 In[4]:=
 Out[4]=

The Frobenius norm of the remainder matrix is on the order of machine precision:

 In[5]:=
 Out[5]=

Define a 10×12 matrix:

 In[6]:=

Express the matrix as a sum of three Kronecker products of matrices of dimensions 5×3 and 2×4:

 In[7]:=
 Out[7]=

Check the difference between the original matrix and the sum of the Kronecker products:

 In[8]:=
 Out[8]=

### Scope (3)

A 10×12 matrix with approximate numerical values:

 In[9]:=
 Out[9]=

Express the matrix as a sum of up to seven Kronecker products of matrices of dimensions 2×3 and 5×4:

 In[10]:=
 Out[10]=

Check the difference between the original matrix and the sum of the Kronecker products:

 In[11]:=
 Out[11]=

An arbitrary-precision 10×12 matrix:

 In[12]:=
 Out[12]=

Express the matrix as a sum of up to seven Kronecker products of matrices of dimensions 2×3 and 5×4:

 In[13]:=
 Out[13]=

Check the difference between the original matrix and the sum of the Kronecker products:

 In[14]:=
 Out[14]=

Decompose a random complex-valued 10×12 matrix into a sum of two Kronecker products of matrices of dimensions 2×3 and 5×4:

 In[15]:=
 Out[15]=

### Possible Issues (4)

NearestKroneckerProductSum is left unevaluated for symbolic input:

 In[16]:=
 Out[16]=

NearestKroneckerProductSum is left unevaluated for exact input:

 In[17]:=
 Out[17]=

Numericize the input to get a result:

 In[18]:=
 Out[18]=

NearestKroneckerProductSum is left unevaluated if the specified dimensions are incommensurate:

 In[19]:=
 Out[19]=

The decomposition of a matrix into a sum of Kronecker products is not unique:

 In[20]:=
 In[21]:=
 Out[21]=

## Version History

• 1.0.0 – 25 January 2021