Function Repository Resource:

BidiagonalDecomposition

Source Notebook

Compute the bidiagonal decomposition of a numerical matrix

Contributed by: Jan Mangaldan

ResourceFunction["BidiagonalDecomposition"][m]

gives the bidiagonal decomposition for a numerical matrix m as a list of matrices {q,b,p}, where q and p are orthonormal matrices and b is an upper bidiagonal matrix.

Details

The bidiagonal decomposition of a matrix is often used as the first step in computing the singular value decomposition.
The matrix m may be rectangular.
The original matrix m is equal to q.b.ConjugateTranspose[p].
q and p are column orthonormal matrices, whose transposes can be considered as lists of orthonormal vectors.

Examples

Basic Examples (1) 

Compute the bidiagonal decomposition for a 3×2 numerical matrix:

In[1]:=
ResourceFunction[
 "BidiagonalDecomposition"][{{1., 2.}, {3., 4.}, {5., 6.}}]
Out[1]=
In[2]:=
MatrixForm /@ %
Out[2]=

Scope (2) 

m is a 3×4 matrix:

In[3]:=
m = \!\(\*
TagBox[
RowBox[{"(", "", GridBox[{
{"1", "2", "3", "4"},
{"1", "4", "9", "16"},
{"1", "8", "27", "64"}
},
GridBoxAlignment->{"Columns" -> {{Left}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}},
GridBoxSpacings->{"Columns" -> {
Offset[
           0.27999999999999997`], {
Offset[0.7]}, 
Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
Offset[0.2], {
Offset[0.4]}, 
Offset[0.2]}, "RowsIndexed" -> {}}], "", ")"}],
Function[BoxForm`e$, 
MatrixForm[BoxForm`e$]]]\);

Find the bidiagonal decomposition of m using machine-number arithmetic:

In[4]:=
ResourceFunction["BidiagonalDecomposition"][N[m]]
Out[4]=
In[5]:=
Map[MatrixForm, %]
Out[5]=

Find the bidiagonal decomposition of m using 24-digit precision arithmetic:

In[6]:=
ResourceFunction["BidiagonalDecomposition"][N[m, 24]]
Out[6]=

The bidiagonal decomposition of a random complex-valued 2×4 matrix:

In[7]:=
ResourceFunction["BidiagonalDecomposition"][
 RandomComplex[{0, 1 + I}, {2, 4}]]
Out[7]=

Properties and Relations (5) 

m is a random matrix with 3 columns:

In[8]:=
m = RandomReal[1, {4, 3}]
Out[8]=

Find the bidiagonal decomposition of m:

In[9]:=
{q, b, p} = ResourceFunction["BidiagonalDecomposition"][m]
Out[9]=

Verify that m is equal to q.b.ConjugateTranspose[p]:

In[10]:=
Chop[m - q . b . ConjugateTranspose[p]]
Out[10]=

Verify that q and p are unitary:

In[11]:=
Chop[ConjugateTranspose[q] . q - IdentityMatrix[4]]
Out[11]=
In[12]:=
Chop[ConjugateTranspose[p] . p - IdentityMatrix[3]]
Out[12]=

b has the same singular values as m:

In[13]:=
SingularValueList[b]
Out[13]=
In[14]:=
SingularValueList[m]
Out[14]=

Version History

  • 1.0.0 – 24 January 2022

Source Metadata

Related Resources

License Information