Skip to main content

schur

Function schur 

Source
pub fn schur<B: Backend, T: LinalgScalar>(
    x: &Array<B, T>,
    compute_schur_vectors: bool,
) -> (Array<B, T>, Option<Array<B, T>>)
Expand description

The Schur decomposition x = z t z^H of each square matrix, as lax.linalg.schur (LAPACK’s gees, without sorting): t, upper quasi-triangular for real matrices (with standardized 2 x 2 blocks for the complex conjugate eigenvalues) and upper triangular for complex ones, and, with compute_schur_vectors, the orthogonal (unitary) z. Not differentiable, as in JAX.

§Examples

use ruxla_core::{Array, Native, lax};

let a = Array::<Native, f64>::from_vec(vec![2.0, 1.0, 0.0, 3.0], [2, 2]);
let (t, _) = lax::linalg::schur(&a, false);
assert_eq!(t.to_vec(), [2.0, 1.0, 0.0, 3.0]);

§Panics

Panics if x is not a batch of square matrices.