#9011: the numpy SVD decomposition docstring is wrong
------------------------------+---------------------------------------------
   Reporter:  was             |       Owner:  jason, was
       Type:  defect          |      Status:  new       
   Priority:  minor           |   Milestone:  sage-4.6.2
  Component:  linear algebra  |    Keywords:            
     Author:                  |    Upstream:  N/A       
   Reviewer:                  |      Merged:            
Work_issues:                  |  
------------------------------+---------------------------------------------

Comment(by jason):

 Remember that multiplication of numpy arrays is *not* matrix
 multiplication.  Matrix multiplication is through np.dot().

 Here I've mirrored your example using the format in numpy docs:
 {{{
 sage: A = np.array([[2,0,0,0],[0,0,0,0]])
 sage: U,s,V=np.linalg.svd(A,full_matrices=False)
 sage: S=np.diag(s)
 sage: np.dot(U,np.dot(S,V))
 array([[ 2.,  0.,  0.,  0.],
        [ 0.,  0.,  0.,  0.]])


 }}}

 Note that by default, full_matrices is True, though, so you'd have to do
 something like the first example in the numpy docs:
 
http://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.svd.html#numpy.linalg.svd

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9011#comment:3>
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.

Reply via email to