Function Repository Resource:

PolarDecomposition

Source Notebook

Compute the polar decomposition of a matrix

Contributed by: Jan Mangaldan

ResourceFunction["PolarDecomposition"][m]

yields the polar decomposition for a numerical matrix m. The result is a list {q,s}, where q is a column orthonormal matrix and s is a Hermitian positive semidefinite matrix.

Details

The original matrix m is equal to q.s.

Examples

Basic Examples (1) 

Compute the polar decomposition for a 4×3 matrix:

In[1]:=
ResourceFunction["PolarDecomposition"][( {
   {1., 2., 3.},
   {1., 5., 6.},
   {1., 8., 9.},
   {1., 11., 12.}
  } )]
Out[1]=

Scope (2) 

Compute the polar decomposition of a complex matrix:

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

A matrix with entries having 20-digit precision:

The polar decomposition is computed using the full 20-digit precision of the input:

In[3]:=
ResourceFunction["PolarDecomposition"][m]
Out[3]=

Properties and Relations (2) 

A random 5×4 matrix m:

Compute its polar decomposition:

In[4]:=
{q, s} = ResourceFunction["PolarDecomposition"][m]
Out[4]=

The columns of q are orthonormal:

In[5]:=
ConjugateTranspose[q] . q // Chop
Out[5]=

The matrix s is Hermitian positive semidefinite:

In[6]:=
HermitianMatrixQ[s] && PositiveSemidefiniteMatrixQ[s]
Out[6]=

The matrix s is equal to MatrixPower[ConjugateTranspose[m].m,1/2]:

In[7]:=
MatrixPower[ConjugateTranspose[m] . m, 1/2] - s // Chop
Out[7]=

m is equal to q.s:

In[8]:=
q . s - m // Chop
Out[8]=

If the matrix m is Hermitian positive semidefinite, then q is equal to the identity matrix, and s is equal to m:

In[9]:=
ResourceFunction["PolarDecomposition"][N[HilbertMatrix[3]]] // Chop
Out[9]=
In[10]:=
Last[%] - N[HilbertMatrix[3]] // Chop
Out[10]=

Possible Issues (1) 

PolarDecomposition only works with approximate numerical matrices:

In[11]:=
ResourceFunction[
 "PolarDecomposition"][{{27, 48, 81}, {-6, 0, 0}, {1, 0, 3}}]
Out[11]=
In[12]:=
ResourceFunction["PolarDecomposition"][
 N[{{27, 48, 81}, {-6, 0, 0}, {1, 0, 3}}]]
Out[12]=

Version History

  • 1.0.0 – 17 May 2021

Related Resources

License Information