pub fn is_matrix_su2(m: &CMatrix2, epsilon: f64) -> bool
Expand description

Return wether the input matrix is SU(2) up to epsilon.

Example


assert!(is_matrix_su2(&random_su2(&mut rng), 4_f64 * f64::EPSILON));
assert!(!is_matrix_su2(&CMatrix2::zeros(), 4_f64 * f64::EPSILON));
assert!(!is_matrix_su2(
    &(random_su2(&mut rng) * Complex::new(0.5_f64, 1.7_f64)),
    4_f64 * f64::EPSILON
));