A new routine [1] to check if a matrix is unitary checked to see if
one of the outputs of the singular value decomposition is unitary.
For a few configurations, it wasn't, so the doctest failed.

Sage's SVD wraps numpy, and numpy wraps LAPACK.  ("thinly" according
to a reply to my query on the numpy list [5].)

Configurations where the SVD is producing non-unitary matrices are two
older Mac's that built Sage with gcc 4.0.1 and gcc 4.2.1 as parts of
XCode (the 4.2.1 is on a 2007 MacBook Pro under Mac OS X 10.5.8 with
XCode 3.1.4, discussed in the middle of the 4.7.alpha5 sage-release
discussion [2]).

Failures are consistent for certain sized matrices in a somewhat
predictable pattern: 3 x 4, 4 x 5, 5 x 6, 5 x 7, 6 x 7, 6 x 8, 6 x 9,
7 x 8, 7 x 9, 8 x 9, ...  For these sizes the SVD always fails, for
other nearby sizes it seems to never fail.

The originating doctest was merged in 4.7.alpha4, so it seems the
failure is rare, and does not occur on newer Macs.

Lots of details on the Trac ticket [3].  I'm now out of my element on
this one. I don't know enough about the Mac OS, how we build ATLAS, or
how to test ATLAS with a Fortran or a C example.  I did find one
FORTRAN example, coincidentally it is a 3 x 4 [4].

[1]  http://trac.sagemath.org/sage_trac/ticket/10863
{2]  
http://groups.google.com/group/sage-release/browse_thread/thread/babfdde21838f409
[3]  http://trac.sagemath.org/sage_trac/ticket/11248
[4]  
http://software.intel.com/sites/products/documentation/hpc/mkl/lapack/mkl_lapack_examples/zgesdd_ex.f.htm

[5] Response from NumPy list:
The Numpy routine is a very thin wrapper of LAPACK's ZGESDD, and
probably cannot have any bugs of this kind, so the problem is most
likely with the LAPACK and BLAS libraries you use. You will probably
be able to reproduce the problem also with an equivalent Fortran/C
snippet calling LAPACK directly.

Problems like this in BLAS/LAPACK are somewhat difficult to track. You
could try switching to another BLAS library (or, if you use ATLAS,
compile it differently) and checking if the problem disappears.

-- 
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to