2

Are there formulas for the singular values of a real matrix in low dimension, i.e. for a $2 \times 2$ matrix or a $2 \times 3$ matrix?

Any comment is welcome.

Zouba
  • 2,164

1 Answers1

2

While there surely are a handful of formulas which would fit this question (e.g. here, here or here), they should all be based on the following nice "closed" form: Given any complex $2\times 2$ matrix $A$ its singular values are $$ \boxed{\frac{ \sqrt{ \|A\|_2^2+2|\det(A)| }\pm\sqrt{ \|A\|_2^2-2|\det(A)| } }2}\tag{1} $$ where $\|A\|_2^2=a_{11}^2+a_{12}^2+a_{21}^2+a_{22}^2$ is the (square of the) Frobenius norm of $A$. One can see this as follows:

If $A=U\Sigma V$ is any singular value decomposition of $A$, that is, $U,V\in\mathbb C^{2\times 2}$ are unitary and $\Sigma=\operatorname{diag}(s_1,s_2)$ with $s_1,s_2$ the singular values of $A$, then $$ \|A\|_2^2=\|U\Sigma V\|_2^2=\|\Sigma\|_2^2=s_1^2+s_2^2 $$ and $$ |\det(A)|=|\det(U\Sigma V)|=|\det(U)||\det(\Sigma)||\det(V)|=|\det(\Sigma)|=s_1s_2\,. $$ Here we used that the Frobenius norm is unitarily equivalent and that all unitary matrices have eigenvalues on the unit circle (so the absolute value of their determinant is $1$). Now all that is left is to re-write $s_1\pm s_2$ as $$ \sqrt{(s_1\pm s_2)^2}=\sqrt{s_1^2+s_2^2\pm 2s_1s_2}=\sqrt{\|A\|_2^2\pm 2|\det(A)|} $$ and take their sum (resp. difference) to get $2s_1,2s_2$ which reproduces (1). This has two immediate consequences:

  • The trace norm of $A$ gets a nice "closed" form: $$ \|A\|_1^2=(s_1+s_2)^2=(\sqrt{ \|A\|_2^2+2|\det(A)| })^2= \|A\|_2^2+2|\det(A)| $$
  • If $A$ is a $2\times 3$ complex matrix then (1) implies the, admittedly not as elegant, formula $$ \frac{ \sqrt{ \|A\|_2^2+2\sqrt{|\det(AA^*)|} }\pm\sqrt{ \|A\|_2^2-2\sqrt{|\det(AA^*)|} } }2\tag{2} $$ for its singular values. This follows from the fact that given any complex matrix $A$ its singular values coïncide with the singular values of $\sqrt{AA^*},\sqrt{A^*A}$ (readily verified, again by means of the singular value decomposition). If $A\in\mathbb C^{3\times 2}$ then (2) holds, but with $A^*A$ instead of $AA^*$.
Frederik vom Ende
  • 5,187
  • 1
  • 11
  • 39
  • This is all mathematically correct, but beware using it for computation; there are some problems. E.g. $|A|2^2-2 \det(A)$ may catastrophically cancel, sometimes even producing a slightly negative answer which blows up when its square root is subsequently taken (and that actually happens in the reference code of your first link). It looks like this may be mitigated somewhat by rearranging that subexpression as $(a{11}-a_{22})^2 + (a_{12}-a_{21})^2$ which is guaranteed positive, but, even then, extracting the singular values from their sum and difference isn't going to be very accurate. – Don Hatch Jun 28 '24 at 17:51
  • Also for the 2x3 case, one might be tempted to say "just take the square roots of the singular values of $A A^$. But that would be a terrible thing to do computationally, e.g. if $A=[[1,0,0],[1,10^{-4},0]]$ then in single precision $A A^ = [[1,1],[1,1]]$ and so the smaller singular value is already lost. Your method doesn't do that exactly, but if we inspect what it does do for this test matrix A, we see that the smaller singular value does indeed get lost. – Don Hatch Jun 28 '24 at 18:11