[Numpy-discussion] Zero row in SVD's unitary matrix on some Mac's

Jason Grout jason-sage at creativetrax.com
Tue Apr 26 12:36:19 EDT 2011

On 4/26/11 11:22 AM, Jason Grout wrote:
> On 4/26/11 11:12 AM, Jason Grout wrote:
>> On 4/26/11 11:07 AM, Jason Grout wrote:
>>> And indeed, I get a 0 row as the last row of the V**H matrix
>> I just double-checked things one last time and saw that I actually
>> hadn't changed the first argument of zgesdd to "A" in the program that I
>> actually ran.  So with this change, I get a nonzero last row of the V**H
>> matrix from the C call to zgesdd.  So everything is consistent between
>> the C call to zgesdd and the numpy svd call.
>> So now my remaining question is: if the Lapack docs only say that V**H
>> is the full n-by-n matrix if M>=N, why is numpy returning it even if M<N?
> One more post talking to myself...
> I notice that the zgesvd routine docs guarantee that the V returned is
> unitary, regardless of the size of A.  So this might be another argument
> for calling zgesvd instead of zgesdd.

Okay, just one more data point.  Our people that are seeing the problem 
with numpy returning a non-unitary V also see a non-unitary V being 
returned by the test C call to zgesdd.  In other words, it really 
appears that zgesdd follows the Lapack docs, and if rows<columns, the 
returned V is not necessarily unitary, but may contain a zero row.  This 
makes numpy's assumptions in using zgesdd false.

You can see this report at 



More information about the NumPy-Discussion mailing list