# Why SVD cannot recover the original matrix and suffer from numerical instability? [closed]

I have a matrix in mathematica that looks like

$$m= \left( \begin{array}{cccc} -i & 0 & 1 & 0 \\ 0 & -i & 0 & -1 \\ 1 & 0 & -i & 0 \\ 0 & -1 & 0 & -1. i \\ \end{array} \right)$$

Note the last element I explicitly use a numerical value of $$i$$. Now if I use SVD without dropping singular values, I should be able to recover the original matrix:

{U, W, V} = SingularValueDecomposition[m]
U.W.Transpose[V]


The result however is $$\left( \begin{array}{cccc} 0.\, +1. i & 0 & 1. & 0 \\ 0 & 0.\, -1. i & 0 & 1. \\ -1. & 0 & 0.\, -1. i & 0 \\ 0 & -0.6+0.8 i & 0 & 0.8\, +0.6 i \\ \end{array} \right)$$

If I replace the $$1.i$$ with the accurate symbol of $$i$$ there is no problem with recovering the matrix.

What is the reason behind it? Observation shows the matrix $$m$$ has a non-zero determinant and a close-to-one condition number. I would like to know the properties of such matrix that has issue.

• (1) Best to post full code. (2) Also should check the documentation-- there is no actual issue here. – Daniel Lichtblau Jan 10 '19 at 22:34

The reason is that you have to use ConjugateTranspose instead of Transpose:

m = {
{-I, 0, 1, 0},
{0, -I, 0, -1},
{1, 0, -I, 0},
{0, -1, 0, -1. I}
};
{U, W, V} = SingularValueDecomposition[m];
Max[Abs[U.W.ConjugateTranspose[V] - m]]


4.74287*10^-16

• Thanks a lot! I was fooled by the numerical accuracy stuff and did not think about the complex values. – Peter Zhang Jan 10 '19 at 22:52