# Revision history [back]

Why not just use the following?

sorted(A.eigenvectors_left(),reverse=True)[0][1]


Here A.eigenvectors_left() returns a list of pairs (ev, EVS), where ev is an eigenvalue and EVS is the list of associated eigenvectors. Output seems to be sorted, but just in case we wrap the output inside a call to sorted (in reverse order).

The proposed code does not work since

A -3.732050807568878*E


is invertible (determinant very close to zero). Note that 3.732050807568878 is just an approximation to the eigenvalue, not the actual value.

Why not just use the following?

sorted(A.eigenvectors_left(),reverse=True)[0][1]


Here A.eigenvectors_left() returns a list of pairs triples (ev, EVS)EVS,n), where ev is an eigenvalue and eigenvalue, EVS is the list of associated eigenvectors. eigenvectors, and n is the algebraic multiplicity of ev. Output seems to be sorted, but just in case we wrap the output inside a call to sorted (in reverse order).

In your example this outputs:

[
(1.000000000000000?, 1.000000000000000?, 0.732050807568877?, 0.267949192431123?,
0.732050807568877?, 0.267949192431123?)
]


The proposed code does not work since

A -3.732050807568878*E


is invertible (determinant very close to zero). Note that 3.732050807568878 is just an approximation to the eigenvalue, not the actual value.