#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: |
------------------------------+---------------------------------------------
Changes (by rbeezer):
* cc: jason (added)
Comment:
This still looks wrong for a rectangular matrix, just based on the
dimensions of the matrices. The .H is an improvement, though. I couldn't
find anything any better in the NumPy docs online.
u and v are returned as square (by default) and `np.diag()` is going to
be square, when it really needs to have the same dimensions as the
original matrix.
To wit, in Sage 4.6.2.alpha2:
{{{
sage: A = np.array([[2,0,0,0],[0,0,0,0]])
sage: ans = np.linalg.svd(A)
sage: ans[0]*np.diag(ans[1])*ans[2]
ValueError Traceback (most recent call
last)
/home/sage/sage-4.6.2.alpha2/<ipython console> in <module>()
ValueError: shape mismatch: objects cannot be broadcast to a single shape
}}}
Jason - can you send this upstream easily?
Rob
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9011#comment:2>
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.