Ask Your Question
1

svd is here a sage command to reverse the SVD, that ia restore the original matrix?

asked 2017-12-05 06:58:15 +0100

meirsamel gravatar image

SVD matrix analysis

edit retag flag offensive close merge delete

Comments

You should not confuse title, body, keywords !

tmonteil gravatar imagetmonteil ( 2017-12-05 11:34:34 +0100 )edit

More precisely, would you consider editing your question as follows:

  • title: Reversing the SVD of a matrix
  • body: Is there a Sage command to reverse the SVD, that is, restore the original matrix?
  • keywords (tags): svd, matrix, analysis
slelievre gravatar imageslelievre ( 2017-12-06 09:05:18 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2017-12-05 11:32:41 +0100

tmonteil gravatar image

updated 2017-12-06 09:24:24 +0100

Just make the product !

See the documentation of SVD of complex matrices:

sage: m = random_matrix(CDF,3)
sage: m.SVD?

You will read:

OUTPUT:

* U, S, V -- immutable matrices such that A =
  U*S*V.conj().transpose() where U and V are orthogonal and S is
  zero off of the diagonal.

So:

sage: m
[  0.3310137301437883 + 0.5895210280973311*I 0.7988060507482333 + 0.001845004960518093*I     0.55953531271306 - 0.4157959932143387*I]
[ 0.31728704666930097 + 0.5252900028355088*I   -0.8037722831442571 + 0.748001134324078*I   0.7570395959647946 + 0.8725543726416196*I]
[  0.5889022178823824 + 0.8257326198637103*I -0.6730668617375402 - 0.17790861779943956*I  -0.5589487514702225 - 0.4466254251771886*I]

sage: U, S, V = m.SVD()

sage: U
[  -0.284121544687194 + 0.39939285686891435*I   0.09804396065119658 + 0.4371298831463562*I    0.5260128510587949 + 0.5313902721050954*I]
[ -0.47799684194289516 - 0.6394302833691484*I    0.0839847095503589 + 0.3326361102951883*I    0.3181936443645485 - 0.3790785184872727*I]
[  0.31925731509669564 - 0.1431188047985596*I    0.5908610195338464 + 0.5766176283510003*I -0.42684312329846164 + 0.11743972425625948*I]

sage: S
[ 2.014692905047209                0.0                0.0]
[               0.0 1.4672457517786448                0.0]
[               0.0                0.0 0.5578468204334117]

sage: V
[                         -0.1371487984082707                           0.8966597362597599                          0.42094123635698283]
[  -0.2530085556355167 + 0.6671921582633321*I -0.16346409265449802 - 0.18004222519028812*I    0.2657659576982525 + 0.6008943651067534*I]
[   -0.674728237753376 + 0.1295118025530403*I  -0.24594930656467023 + 0.2763594462509048*I   0.30406779436784737 - 0.5464848302324682*I]

sage: U*S*V.conjugate().transpose() == m
False

BUT, this is only because of numerical noise:

sage: (U*S*V.conjugate().transpose() - m).norm()
7.714272089062928e-16
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-12-05 06:58:15 +0100

Seen: 346 times

Last updated: Dec 06 '17