The LAPACK forum has moved to https://github.com/Reference-LAPACK/lapack/discussions.

ZGEEV

Open discussion regarding features, bugs, issues, vendors, etc.

ZGEEV

Postby wjiang » Sat Aug 02, 2008 1:54 am

Hi,all

I tried to find eigenvalues and corresponding right eigenvectors of a 6*6 complex matrix N by calling ZGEEV:

complex*16 VL(1,1),W(6),WORK(12),VR(6,6),N(6,6)
double precision RWORK(12)
integer INFO
call ZGEEV('N','V',6,N,6,W,VL,1,VR,6,WORK,12,RWORK,INFO)

where N is given as:
0 0 -1.0000 11.2925 0 0
0 0 0 0 11.2925 0
-0.8689 0 0 0 0 2.7768
-0.0883 0 0 0 0 -0.8689
0 -0.0886 0 0 0 0
0 0 -0.0000 -1.0000 0 0

By comparing to MATLAB results, I find they have the same eigenvalues:
(0.827795809145797,0.561029498654622) (0.827795809145796,-0.561029498654621)
(-0.827795809145796,0.561029498654621) (-0.827795809145797,-0.561029498654621)
(0.000000000000000E+000,1.00000000000000) (0.000000000000000E+000,-1.00000000000000)

But eigenvectors corresponding to the first 4 eigenvalues are different from MATLAB results. For instance,
eigenvectors corresponding to eigenvalue (0.827795809145797,0.561029498654622) is
(0.704640771061093,0.000000000000000E+000)
(6.218855923686732E-017,3.259088567913728E-017)
(-0.651922051030298,0.267425233704713)
(-6.076911530853660E-003,5.868947865396994E-002)
(0.000000000000000E+000,0.000000000000000E+000)
(-2.789608688774744E-002,-5.199223110023134E-002)
while result obtained by MATLAB is
-0.6519 - 0.2674i
0.0000 + 0.0000i
0.7046
0.0279 - 0.0520i
-0.0000 + 0.0000i
0.0061 + 0.0587i

Could you give me some help on this
wjiang
 
Posts: 4
Joined: Thu Jul 31, 2008 11:19 pm

Re: ZGEEV

Postby thombos » Sat Aug 02, 2008 11:45 pm

I believe you have the same issue as in the thread 4 below "Problems with ZGEEV", so check that one out.
thombos
 
Posts: 30
Joined: Mon Nov 26, 2007 8:41 pm

Re: ZGEEV

Postby wjiang » Mon Aug 04, 2008 1:41 am

I have rechecked this problem and found that it was just because of the precision of data of N matrix.

The following are the test program and output:

complex*16 N(6,6),VL(1,1),W(6),WORK(12),VR(6,6),NN(6,6)
double precision RWORK(12)
integer INFO

N = 0
N(1,3) = -1
N(1,4) = 11.2925
N(2,5) = 11.2925
N(3,1) = -0.8689
N(3,6) = 2.7768
N(4,1) = -8.83E-002
N(4,6) = -0.8689
N(5,2) = -8.86E-002
N(6,4) = -1.0

call ZGEEV('N','V',6,N,6,W,VL,1,VR,6,WORK,12,RWORK,INFO)
write(*,*)'First eigenvalue of N:',W(1)
write(*,*)'First eigenvector of N:',VR(1:6,1)

N = 0
NN(1,3) = -1
NN(1,4) = 11.2924753707945
NN(2,5) = 11.2924753707945
NN(3,1) = -0.868852459016394
NN(3,6) = 2.77683820593307
NN(4,1) = -8.826420060682277E-002
NN(4,6) = -0.868852459016394
NN(5,2) = -8.855454337197682E-002
NN(6,4) = -1.0

call ZGEEV('N','V',6,NN,6,W,VL,1,VR,6,WORK,12,RWORK,INFO)
write(*,*)'First eigenvalue of NN:',W(1)
write(*,*)'First eigenvector of NN:',VR(1:6,1)

end


Results:
First eigenvalue of N: (0.827775768554166,0.561138662012733)
First eigenvector of N: (-0.651880946717105,-0.267481615264589)
(-3.011798947449755E-017,-3.583661121821219E-017)
(0.704655611379773,0.000000000000000E+000)
(2.790689709167863E-002,-5.200003558841573E-002)
(0.000000000000000E+000,0.000000000000000E+000)
(6.078034310503031E-003,5.869876528594362E-002)

First eigenvalue of NN: (0.827795809145797,0.561029498654621)
First eigenvector of NN: (0.704640771061093,0.000000000000000E+000)
(2.072951974562241E-017,1.086362855971240E-017)
(-0.651922051030298,0.267425233704713)
(-6.076911530853698E-003,5.868947865396983E-002)
(0.000000000000000E+000,0.000000000000000E+000)
(-2.789608688774738E-002,-5.199223110023127E-002)


Can anyone help me to explain why the precision of elements in N matrix can affect the eigenvector result so much? Thanks.
wjiang
 
Posts: 4
Joined: Thu Jul 31, 2008 11:19 pm

Re: ZGEEV

Postby admin » Mon Aug 04, 2008 1:41 pm

An eigenvector associated to an eigenvalue with multiplicity equal to one is uniquely defined up to multiplication by a constant. LAPACK imposes the eigenvectors to have 1-norm, this reduces the choice for the constant, but still there are still some choices (and so some non-uniqueness). In the real case, this means that your eigenvector is either v or -v (easy). In the complex case, this means that your eigenvector is of the form e^(i.theta) . v . This is a little bit less obvious to see with human eyes in general. In your case,
you have
Code: Select all
v1_N = v1_NN * [ -0.9252 + 0.3796i ] 


{ Note: this is a problem of unicity of eigenvector as in post: http://icl.cs.utk.edu/lapack-forum/viewtopic.php?f=2&t=752. Users expect us some kind of unicity where we can not guarantee it. You always have to think: "What is unique?". For eigenvalue computation, what is unique is the eigenspace. In post 752 (mentionned by Thomas), the non-unicity comes from a multiple eigenvlaue (and so what is unique is a subpsace of dimension 2, and we only provide a basis for it). In this post, the non-unicity is also present with a simple eigenvalue (and so what is unique is a subspace of dimension 1, but it has 2 unit vectors that spans it in the real case, and a lot in the complex case). }
admin
Site Admin
 
Posts: 616
Joined: Wed Dec 08, 2004 7:07 pm


Return to User Discussion

Who is online

Users browsing this forum: No registered users and 8 guests