[PYTHON] [Numpy, scipy] Wie berechnet man die Quadratwurzel einer Elmeet-Matrix mit halbregelmäßigem Wert?
import numpy as np
import scipy.linalg as LA
def sqrtmh(A):
vals, vecs = LA.eigh(A)
return vecs @ np.diag(np.sqrt(vals)) @ vecs.T.conjugate()
Referenz
- [Quadratwurzel der Matrix](https://ja.wikipedia.org/wiki/%E8%A1%8C%E5%88%97%E3%81%AE%E5%B9%B3%E6%96%B9% E6% A0% B9)
- [Matrixqualifikation](https://ja.wikipedia.org/wiki/%E8%A1%8C%E5%88%97%E3%81%AE%E5%AE%9A%E5%80%A4 % E6% 80% A7)