Bug in Ssyev?

General CULA Dense (LAPACK & BLAS) support and troubleshooting. Use this forum if you are having a general problem or have encountered a bug.

Bug in Ssyev?

Postby twc254 » Thu Jul 29, 2010 11:41 am

I have a program which simply calculates the eigenvalues and vectors of a symmetric matrix. However, Ssyev fails to compute anything besides the zero eigenvalues and vectors when the diagonal is zero. Here is the program output:

input matrix
[[-3. 1. 0. 0. 1. 0.]
[ 1. -6. 1. 1. 1. 1.]
[ 0. 1. -3. 1. 0. 0.]
[ 0. 1. 1. -5. 1. 1.]
[ 1. 1. 0. 1. -5. 1.]
[ 0. 1. 0. 1. 1. -3.]]
numpy eigh:
(array([-6.97674799, -6.30277586, -5.29247952, -2.95058608, -2.69722438,
-0.78018647], dtype=float32),
array([[ 1.78536519e-01, 2.04908341e-01, 2.68109828e-01,
5.20512283e-01, 6.76766276e-01, -3.53989810e-01],
[ -9.14553046e-01, -1.49880108e-15, -6.90497085e-02,
8.43723789e-02, 1.38777878e-16, -3.89494717e-01],
[ 1.78536519e-01, -2.04908341e-01, 2.68109828e-01,
5.20512283e-01, -6.76766276e-01, -3.53989810e-01],
[ 2.04558358e-01, 6.76766276e-01, -5.45586646e-01,
-5.86517900e-02, -2.04908341e-01, -3.96296680e-01],
[ 2.04558358e-01, -6.76766276e-01, -5.45586646e-01,
-5.86517900e-02, 2.04908341e-01, -3.96296680e-01],
[ 1.27097920e-01, 6.10622664e-16, 5.06099582e-01,
-6.66434646e-01, 4.44089210e-16, -5.32516837e-01]], dtype=float32))
cula Ssyev:
(array([-6.97674751, -6.30277634, -5.29248095, -2.95058632, -2.69722438,
-0.78018647], dtype=float32),
array([[ -1.78536490e-01, 9.14552987e-01, -1.78536773e-01,
-2.04557836e-01, -2.04558387e-01, -1.27098024e-01],
[ -2.04908296e-01, 5.36441803e-07, 2.04908296e-01,
-6.76766455e-01, 6.76765978e-01, 1.75088644e-07],
[ -2.68109769e-01, 6.90494031e-02, -2.68109560e-01,
5.45586348e-01, 5.45587122e-01, -5.06099701e-01],
[ -5.20511925e-01, -8.43723640e-02, -5.20512521e-01,
5.86519651e-02, 5.86519651e-02, 6.66434824e-01],
[ -6.76766396e-01, -1.96741894e-08, 6.76766157e-01,
2.04908222e-01, -2.04908445e-01, 2.60886736e-07],
[ 3.53989899e-01, 3.89494747e-01, 3.53989869e-01,
3.96296620e-01, 3.96296769e-01, 5.32516778e-01]], dtype=float32))

input matrix
[[ 0. 0. 0. 0. 0. 0.]
[ 1. 0. 0. 0. 0. 0.]
[ 0. 1. 0. 0. 0. 0.]
[ 0. 1. 1. 0. 0. 0.]
[ 1. 1. 0. 1. 0. 0.]
[ 0. 1. 0. 1. 1. 0.]]
numpy eigh:
(array([-1.75153208, -1.61803401, -1. , 0.15891732, 0.61803401,
3.59261465], dtype=float32),
array([[ -4.18185174e-01, -3.71748030e-01, -1.94022082e-16,
5.00961542e-01, -6.01500928e-01, 2.72320926e-01],
[ 6.44454122e-01, 3.33066907e-16, -5.00000000e-01,
2.55939156e-01, -1.66533454e-16, 5.18819809e-01],
[ -4.18185174e-01, 3.71748030e-01, -4.95659117e-16,
5.00961542e-01, 6.01500928e-01, 2.72320926e-01],
[ 8.80105942e-02, -6.01500928e-01, 5.00000000e-01,
-1.76327690e-01, 3.71748030e-01, 4.59524393e-01],
[ 8.80105942e-02, 6.01500928e-01, 5.00000000e-01,
-1.76327690e-01, -3.71748030e-01, 4.59524393e-01],
[ -4.68432963e-01, -8.74300632e-16, -5.00000000e-01,
-6.08594537e-01, 6.66133815e-16, 4.00229007e-01]], dtype=float32))
cula Ssyev:
(array([ 0., 0., 0., 0., 0., 0.], dtype=float32),
array([[ 1., 0., 0., 0., 0., 0.],
[ 0., 1., 0., 0., 0., 0.],
[ 0., 0., 1., 0., 0., 0.],
[ 0., 0., 0., 1., 0., 0.],
[ 0., 0., 0., 0., 1., 0.],
[ 0., 0., 0., 0., 0., 1.]], dtype=float32))

I have also tried Ssyevx with the lower bound of zero for the eigenvalues and that did not work either...

Any suggestions?
twc254
 
Posts: 1
Joined: Tue Jul 27, 2010 6:24 am

Re: Bug in Ssyev?

Postby kyle » Fri Jul 30, 2010 12:19 pm

Your input matrix isn't actually symmetric in the 2nd example.

I'm guessing the Python wrapper passed the data into xSYEV as an upper symmetric matrix (UPLO = U) in which case a zero matrix was processed. For a zero matrix, the eigenvalues are zero and the vectors will be an identity matrix.

Try either transposing the matrix, making it really symmetric, or changing the Python wrapper to have UPLO = L and let us know what happens.
kyle
Administrator
 
Posts: 301
Joined: Fri Jun 12, 2009 7:47 pm

Re: Bug in Ssyev?

Postby kyle » Fri Aug 13, 2010 12:26 pm

Any update on this issue? Was the problem resolved?
kyle
Administrator
 
Posts: 301
Joined: Fri Jun 12, 2009 7:47 pm


Return to CULA Dense Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron