You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[General]: Use np.linalg.eigh instead of np.linalg.eig for symmetric matrices #439
CodeEntropy uses np.linalg.eig on matrices that are always symmetric: the moment of inertia tensors used for principal axes, and the force/torque covariance matrices. eig is the general-purpose solver, and for symmetric input it is the wrong tool. In particular, for (near-)degenerate eigenvalues it does not guarantee orthogonal eigenvectors, so the "principal axes" can be skewed, and the result can differ between machines and LAPACK builds.
Proposal: use np.linalg.eigh wherever the input is symmetric, including in place of MDAnalysis's principal_axes() (which also uses eig in 2.10) until we depend on a version that uses eigh.
changed the title [-][General]: Use np.linalg.eigh instead of np.linalg.eig for symmetric matrices[/-][+][General]: Use `np.linalg.eigh` instead of `np.linalg.eig` for symmetric matrices[/+]on Oct 7, 2026
Activity
[-][General]: Use np.linalg.eigh instead of np.linalg.eig for symmetric matrices[/-][+][General]: Use `np.linalg.eigh` instead of `np.linalg.eig` for symmetric matrices[/+]