pub fn hermitian_exponential_first_column<T>(
matrix: &Matrix<T>,
exponent: Complex64,
hermitian_tol: f64,
) -> Result<Vec<Complex64>, HermitianEigenError>where
T: HermitianEigenScalar,Expand description
Compute the first column of exp(exponent * A) for a small Hermitian matrix.
Krylov exponential routines use this for the projected matrix action on the
first basis vector. The returned coefficients are complex even when A is
real because real-time evolution has complex phases.
§Arguments
-
matrix- Square Hermitian matrix in column-majorMatrixlayout. -
exponent- Scalar multiplier inexp(exponent * A). -
hermitian_tol- Relative tolerance for checkingA = A†; acceptedroundoff is symmetrized before eigensolving.
§Returns
The first column of the matrix exponential.
§Errors
Returns HermitianEigenError if Hermitian validation or eigensolving
fails.
§Examples
use num_complex::Complex64;
use tensor4all_tensorbackend::{hermitian_exponential_first_column, Matrix};
let matrix = Matrix::from_col_major_vec(2, 2, vec![1.0, 0.0, 0.0, 2.0]);
let column = hermitian_exponential_first_column(
&matrix,
Complex64::new(0.0, -0.5),
1.0e-12,
).unwrap();
let expected = Complex64::new(0.5_f64.cos(), -0.5_f64.sin());
assert!((column[0] - expected).norm() < 1.0e-12);
assert!(column[1].norm() < 1.0e-12);