You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vectorz's svd returns a full singular-value decomposition, while the Clatrix core.matrix svd returns some kind of reduced singular-value decomposition. That means that the shapes of :U and :V* matrices can differ between the two versions of svd. The raw Clatrix interface allows you to get the full SVD with optional keyword arguments (:type :full). Maybe the optional arguments should be added to the core.matrix Clatrix wrapper? Or should Vectorz return a reduced representation? (I can't figure out where the core.matrix wrapper for Clatrix lives.)
I gather that it's OK for the U and V* matrices to be negated--i.e. the vectorz versions are -1 times the clatrix versions.
Given that there are various reduced representations that people use for SVD, perhaps the docstring for svd in core.matrix should explicitly specify the dimensions of the :U and :V* matrices, i.e. that the first is m x m and that the second is n x n, and not only that they are unitary. (This is helpful if you know you need to do something with svd but don't really know much about singular-value decompositions. Then you go to learn about them, and find out that there are different return values that you could get... and have to figure out that unitary implies square, and reduced representations are not necessarily square, so therefore svd must not be returning a reduced representation. Explicit dimensions short-cuts that reasoning a bit. :-) Related to #321.
The text was updated successfully, but these errors were encountered:
mars0i
changed the title
Vectorz, Clatrix svd are incompatible
Vectorz's, Clatrix's svd return incompatible results
Aug 8, 2017
I agree that results should be consistent, and the core.matrix docstring should describe the dimensions as you suggest. Probably Clatrix should return the full SVD by default.
Vectorz's
svd
returns a full singular-value decomposition, while the Clatrix core.matrixsvd
returns some kind of reduced singular-value decomposition. That means that the shapes of:U
and:V*
matrices can differ between the two versions ofsvd
. The raw Clatrix interface allows you to get the full SVD with optional keyword arguments (:type :full
). Maybe the optional arguments should be added to the core.matrix Clatrix wrapper? Or should Vectorz return a reduced representation? (I can't figure out where the core.matrix wrapper for Clatrix lives.)I gather that it's OK for the U and V* matrices to be negated--i.e. the vectorz versions are -1 times the clatrix versions.
Given that there are various reduced representations that people use for SVD, perhaps the docstring for
svd
in core.matrix should explicitly specify the dimensions of the:U
and:V*
matrices, i.e. that the first is m x m and that the second is n x n, and not only that they are unitary. (This is helpful if you know you need to do something withsvd
but don't really know much about singular-value decompositions. Then you go to learn about them, and find out that there are different return values that you could get... and have to figure out that unitary implies square, and reduced representations are not necessarily square, so thereforesvd
must not be returning a reduced representation. Explicit dimensions short-cuts that reasoning a bit. :-) Related to #321.The text was updated successfully, but these errors were encountered: