alternative to scipy.linalg.eig
scipy.linalg.eig is useful for diagonalising a 3x3 matrix to find eigenvalues and eigenvectors. Does anybody know if there is code in CCTBX which can also do this? Rob -- This email has been checked for viruses by AVG. https://www.avg.com
scitbx.linalg.eigensystem?
from scitbx.array_family import flex from scitbx.linalg import eigensystem m = flex.double((-2, -4, 2, -2, 1, 2, 4, 2, 5)) m.reshape(flex.grid(3,3)) es = eigensystem.real_symmetric(m) list(es.values()) [6.999999999999998, 2.0, -5.0] list(es.vectors()) [0.36514837167011327, 0.18257418583505025, 0.9128709291752769, -0.4472135954999558, 0.8944271909999169, 5.177854513745429e-15, 0.816496580927726, 0.4082482904638631, -0.40824829046386296]
Dr Richard Gildea
Data Analysis Scientist
Tel: +441235 77 8078
Diamond Light Source Ltd.
Diamond House
Harwell Science & Innovation Campus
Didcot
Oxfordshire
OX11 0DE
________________________________
From: [email protected]
Hi Rob, sure, for examples in Python have a look at mmtbx/tls/analysis.py and search for eigen. Also here: regression/tls/tst_get_t_scheme.py . For examples in C++ see mmtbx/tls/tls.h and bulk_solvent/bulk_solvent.h . Pavel On 12/10/20 06:57, Robert Oeffner wrote:
scipy.linalg.eig is useful for diagonalising a 3x3 matrix to find eigenvalues and eigenvectors. Does anybody know if there is code in CCTBX which can also do this?
Rob
participants (3)
-
Gildea, Richard (DLSLtd,RAL,LSCI)
-
Pavel Afonine
-
Robert Oeffner