Hi Guillermo,

https://metacpan.org/pod/PDL::LinearAlgebra#meigen says it uses 
https://metacpan.org/pod/PDL::LinearAlgebra::Real#geev. That obviously uses the 
relevant LAPACK function. The double-precision version, dgeev, is documented at 
https://www.netlib.org/lapack/explore-html/d9/d8e/group__double_g_eeigen_ga66e19253344358f5dee1e60502b9e96f.html
 and says it does indeed normalise the eigenvectors. If that is not the final 
result, then it looks like my _eigen_extract function isn’t working right 
(which is unfortunate but fixable).

Could you please make a smaller (ideally 2x2 or 3x3) example data with expected 
results, so I can use that to fix this?

None of the docs linked above mention sorting the eigenvalues, and I don’t 
believe the wrappers change that, so I believe if you want them sorted then 
you’d have to do that yourself. As usual, I have to caveat I am not either a 
linear-algebra nor LAPACK expert, so if you or anyone know better concerning 
these points, please speak up :-)

Best regards,
Ed

From: Guillermo P. Ortiz<mailto:gor...@exa.unne.edu.ar>
Sent: 05 July 2022 19:34
To: 
pdl-general@lists.sourceforge.net<mailto:pdl-general@lists.sourceforge.net>; 
pdl-de...@lists.sourceforge.net<mailto:pdl-de...@lists.sourceforge.net>
Subject: [Pdl-devel] meigen sort criteria for eigenvalue and eigenvectors.

Dear PDL developers,

Trying to use meigen() for eigenvalue problem with matrix 4x4 without
threading for now, I realize that eigenvalues seems did not have any
ordered output, is not it?

In the first example below the second eigenvalue is larger than the first

===========
Matrix:

[
 [                   0                    1                    0                
    0]
 [    1.19256986494742                    0 -0.00449505340171719                
    0]
 [                   0                    0                    0                
   -1]
 [ 0.00449505340171719                    0    -1.20412391559198                
    0]
]

Eigenvalue:

[1.09134187427168 1.09802854880944 -1.09134187427168 -1.09802854880944]

Right Eigenvector (tranposed matrix)

[
 [ 0.638990630564561  0.697357232402369  0.219312399660024  -0.23934480529599]
 [ 0.218583370045276  0.240010780604692 -0.636866523154502  0.699297624204653]
 [-0.638990630564568  0.697357232402378 -0.219312399660001 -0.239344805295965]
 [-0.218583370045231  0.240010780604642  0.636866523154517   0.69929762420467]
]

In the second example, neither, and also the eigenvectors seem not be normalized
Matrix:

[
 [                    0                     1                     0             
        0]
 [     1.18623905553229                     0 -3.55105833627078e-10             
        0]
 [                    0                     0                     0             
       -1]
 [ 3.55105833627078e-10                     0     -1.21150887543497             
        0]
]

[1.08914602121676 -1.08914602121676 1.10068563878838 -1.10068563878838]

[
 [    0.676318357570712     0.736609448223992  9.50400893585054e-09 
-1.03512535180901e-08]
 [   -0.676318357570712     0.736609448223992 -9.50400893585071e-09 
-1.03512535180903e-08]
 [ 9.44955412328998e-09  1.04009885164588e-08    -0.672443278155145     
0.740148659165145]
 [-9.44955412328967e-09  1.04009885164584e-08     0.672443278155145     
0.740148659165145]
]

Thank you in advance.
Regards

--


Dr. Guillermo P. Ortiz
Electromagnetismo Aplicado
Dto. Física, Facultad de Ciencias Exactas
Universidad Nacional del Nordeste
Avda Libertad 5460, W3404AAS Corrientes,
Argentina.
(+54) 379-4424678 interno 4613
gortiz at unne edu ar

_______________________________________________
pdl-general mailing list
pdl-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-general

Reply via email to