Expand description
Krylov subspace methods for solving linear equations with abstract tensors.
This module provides iterative solvers that work with any type implementing TensorVectorSpace,
enabling their use in tensor network algorithms without requiring dense vector representations.
§Solvers
gmres: Generalized Minimal Residual Method (GMRES) for non-symmetric systemshermitian_lanczos_lowest_eigenpair: Matrix-free lowest eigenpair solver for Hermitian operators
§Future Extensions
- CG (Conjugate Gradient) for symmetric positive definite systems
- BiCGSTAB for non-symmetric systems with better convergence properties
§Example
use tensor4all_core::{
krylov::{gmres, GmresOptions},
DynIndex, TensorDynLen, TensorVectorSpace,
};
let i = DynIndex::new_dyn(2);
let rhs = TensorDynLen::from_dense(vec![i.clone()], vec![1.0, -1.0])?;
let initial_guess = TensorDynLen::from_dense(vec![i.clone()], vec![0.0, 0.0])?;
let apply_operator = |x: &TensorDynLen| Ok(x.clone());
let result = gmres(apply_operator, &rhs, &initial_guess, &GmresOptions::default())?;
assert!(result.converged);
assert!(result.solution.sub(&rhs)?.maxabs() < 1e-12);Structs§
- Gmres
Options - Options for GMRES solver.
- Gmres
Result - Result of GMRES solver.
- Hermitian
Krylov Expm Options - Options for
hermitian_krylov_expm_multiply. - Hermitian
Krylov Expm Result - Result of
hermitian_krylov_expm_multiply. - Hermitian
Lanczos Options - Options for
hermitian_lanczos_lowest_eigenpair. - Hermitian
Lanczos Result - Result of
hermitian_lanczos_lowest_eigenpair. - Restart
Gmres Options - Options for restarted GMRES with truncation.
- Restart
Gmres Result - Result of restarted GMRES solver.
Functions§
- gmres
- Solve
A x = busing GMRES (Generalized Minimal Residual Method). - gmres_
affine - Solve
(a0 I + a1 A) x = busing GMRES with relative residual tolerance. - gmres_
affine_ with_ absolute_ tolerance - Solve
(a0 I + a1 A) x = busing GMRES with an absolute residual tolerance. - gmres_
with_ absolute_ tolerance - Solve
A x = busing GMRES with an absolute residual tolerance. - gmres_
with_ total_ iteration_ limit - Solve
A x = busing GMRES while enforcing a total iteration limit. - gmres_
with_ truncation - Solve
A x = busing GMRES with optional truncation after each iteration. - hermitian_
krylov_ expm_ multiply - Apply
exp(exponent * A)to a vector using a matrix-free Hermitian Krylov method. - hermitian_
lanczos_ lowest_ eigenpair - Compute the lowest eigenpair of a Hermitian matrix-free operator.
- restart_
gmres_ with_ truncation - Solve
A x = busing restarted GMRES with truncation.