#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 slabbe):
> (I keep thinking I can go and try something, and then realize it
probably won't fail on my machine.)
:)
> The other thing to do would be try a 3 x 4 in pure numpy so there is no
Sage involved, then I would say it is a numpy + compiler problem, though I
guess Sage could be building something wrong.
Here it is.
Pasted:
{{{
import numpy
import scipy.linalg
A = numpy.array( [[1 - 1j, -3j, -2 + 1j, -2 + 3j],
[ 1 - 1j, -2 + 1j, 1 + 4j, 2 + 1j],
[-2 + 4j, 2 - 1j, 8 - 4j, 3 - 2j]])
U, S, VH = scipy.linalg.svd(A)
VH
numpy.dot(VH, VH.conj().T)
}}}
Obtained:
{{{
slabbe@pol ~/Documents/Projets/11248 $ sage -python
Python 2.6.4 (r264:75706, Mar 7 2011, 10:43:40)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> import numpy
>>> import scipy.linalg
>>> A = numpy.array( [[1 - 1j, -3j, -2 + 1j, -2 + 3j],
... [ 1 - 1j, -2 + 1j, 1 + 4j, 2 + 1j],
... [-2 + 4j, 2 - 1j, 8 - 4j, 3 - 2j]])
>>> U, S, VH = scipy.linalg.svd(A)
>>> VH
array([[-0.24117245+0.26396396j, 0.19140641+0.08267184j,
0.76910439-0.2828064j , 0.30223564-0.25659388j],
[-0.14415028+0.25977119j, 0.22860092-0.71406845j,
0.13962359+0.01965114j, -0.16011713+0.55142459j],
[ 0.44760366-0.70135903j, -0.02761036-0.17046482j,
0.45504603-0.15137939j, -0.20818489+0.06784049j],
[ 0.00000000+0.j , 0.00000000+0.j ,
0.00000000+0.j , 0.00000000+0.j ]])
>>> numpy.dot(VH, VH.conj().T)
array([[ 1.00000000e+00 -1.38777878e-17j,
8.32667268e-17 +6.24500451e-17j,
1.38777878e-17 +5.55111512e-17j,
0.00000000e+00 +0.00000000e+00j],
[ 8.32667268e-17 -5.55111512e-17j,
1.00000000e+00 +1.38777878e-17j,
5.55111512e-17 +1.11022302e-16j,
0.00000000e+00 +0.00000000e+00j],
[ 1.38777878e-17 -5.89805982e-17j,
5.55111512e-17 -1.14491749e-16j,
1.00000000e+00 +1.56125113e-17j,
0.00000000e+00 +0.00000000e+00j],
[ 0.00000000e+00 +0.00000000e+00j,
0.00000000e+00 +0.00000000e+00j,
0.00000000e+00 +0.00000000e+00j,
0.00000000e+00 +0.00000000e+00j]])
>>>
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11248#comment:10>
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.