#11248: SVD matrix decomposition may return a non-invertible "unitary" matrix
------------------------------+---------------------------------------------
Reporter: rbeezer | Owner: jason, was
Type: defect | Status: new
Priority: major | Milestone: sage-4.7
Component: linear algebra | Keywords:
Work_issues: | Upstream: N/A
Reviewer: | Author:
Merged: | Dependencies:
------------------------------+---------------------------------------------
Comment(by kcrisman):
Numpy:
{{{
Dasher-03:~/Desktop/sage-4.7.alpha5 student$ ./sage -python
Python 2.6.4 (r264:75706, Apr 20 2011, 11:28:06)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> I=1j
>>> import numpy
>>> a=numpy.asarray([( -5.40+ I* 7.40), ( 6.00+ I* 6.38), ( 9.91+ I*
0.16), ( -5.28+ I* -4.16), ( 1.09+ I* 1.55), ( 2.60+ I* 0.07), (
3.98+ I* -5.26), ( 2.03+ I* 1.11), ( 9.88+ I* 1.91), ( 4.92+ I*
6.31), ( -2.11+ I* 7.39), ( -9.81+ I* -8.98)],dtype=complex).reshape(3,4)
>>> numpy.linalg.svd(a)
(array([[ 0.54742764+0.j , 0.76302168+0.j , -0.34368721+0.j
],
[-0.03507684-0.15148438j, 0.27097680-0.22637514j,
0.54572628-0.74386208j],
[ 0.81299016+0.12325614j, -0.52311095-0.13956616j,
0.13357577-0.1135282j ]]), array([ 21.75519279, 16.59545017,
3.97327576]), array([[ 0.23160531+0.20669796j, 0.36590896+0.3864613j ,
0.24259328+0.32833854j, -0.56133932-0.37233547j],
[-0.57911906+0.40329699j, 0.10921398+0.17242422j,
0.59673801-0.27492812j, 0.15998810+0.05510835j],
[ 0.60420072+0.12337134j, -0.18988750+0.29722068j,
0.39210635+0.19697635j, 0.45451433+0.31015037j],
[ 0.00000000+0.j , 0.00000000+0.j ,
0.00000000+0.j , -0.00000000+0.j ]]))
}}}
Old program:
{{{
Dasher-03:~/Desktop student$ ./test_zgesdd ZGESDD Example Program Results
Original Matrix
( -5.40, 7.40) ( 6.00, 6.38) ( 9.91, 0.16) ( -5.28, -4.16)
( 1.09, 1.55) ( 2.60, 0.07) ( 3.98, -5.26) ( 2.03, 1.11)
( 9.88, 1.91) ( 4.92, 6.31) ( -2.11, 7.39) ( -9.81, -8.98)
Singular values
21.76 16.60 3.97
Left singular vectors (stored columnwise)
( 0.55, 0.00) ( 0.76, 0.00) ( -0.34, 0.00)
( -0.04, -0.15) ( 0.27, -0.23) ( 0.55, -0.74)
( 0.81, 0.12) ( -0.52, -0.14) ( 0.13, -0.11)
Right singular vectors (stored rowwise)
( 0.23, 0.21) ( 0.37, 0.39) ( 0.24, 0.33) ( -0.56, -0.37)
( -0.58, 0.40) ( 0.11, 0.17) ( 0.60, -0.27) ( 0.16, 0.06)
( 0.60, 0.12) ( -0.19, 0.30) ( 0.39, 0.20) ( 0.45, 0.31)
( 0.00, -0.00) ( -2.00, -0.00) ( 0.00, -0.00) ( 0.00, 0.00)
}}}
Program using 'A':
{{{
Dasher-03:~/Desktop student$ ./test_zgesdd1 ZGESDD Example Program
Results
Original Matrix
( -5.40, 7.40) ( 6.00, 6.38) ( 9.91, 0.16) ( -5.28, -4.16)
( 1.09, 1.55) ( 2.60, 0.07) ( 3.98, -5.26) ( 2.03, 1.11)
( 9.88, 1.91) ( 4.92, 6.31) ( -2.11, 7.39) ( -9.81, -8.98)
Singular values
21.76 16.60 3.97
Left singular vectors (stored columnwise)
( 0.55, 0.00) ( 0.76, 0.00) ( -0.34, 0.00)
( -0.04, -0.15) ( 0.27, -0.23) ( 0.55, -0.74)
( 0.81, 0.12) ( -0.52, -0.14) ( 0.13, -0.11)
Right singular vectors (stored rowwise)
( 0.23, 0.21) ( 0.37, 0.39) ( 0.24, 0.33) ( -0.56, -0.37)
( -0.58, 0.40) ( 0.11, 0.17) ( 0.60, -0.27) ( 0.16, 0.06)
( 0.60, 0.12) ( -0.19, 0.30) ( 0.39, 0.20) ( 0.45, 0.31)
( 0.00, 0.00) ( 0.00, 0.00) ( 0.00, 0.00) ( -0.00, 0.00)
}}}
I see a single change in the last row, but of course that's enough.
By the way, does that mean there a bug in the thing at the Intel site?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11248#comment:25>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.