Skip to main content

funm

Function funm 

Source
pub fn funm<T: Scalar, S: Data<Elem = T>>(
    a: &ArrayBase<S, Ix2>,
    f: impl Fn(Complex<f64>) -> Complex<f64>,
) -> Result<(Array2<Complex<f64>>, f64)>
Expand description

f(A) for a scalar function f (SciPy’s funm), by the Schur-Parlett method: with the complex Schur form A = Z T Zᴴ, F = f(T) is upper triangular with F_ii = f(T_ii), and the commutation T F = F T determines the rest, superdiagonal by superdiagonal: F_ij = (T_ij (F_jj − F_ii) + Σ_{i<k<j} (T_ik F_kj − F_ik T_kj)) / (T_jj − T_ii). Returns (Z F Zᴴ, error estimate); the estimate is large when eigenvalues nearly coincide, where this recurrence divides by small differences.