Module krylov

Module krylov 

Source
Expand description

Krylov subspace methods for solving linear equations with abstract tensors.

This module provides iterative solvers that work with any type implementing TensorLike, enabling their use in tensor network algorithms without requiring dense vector representations.

§Solvers

  • gmres: Generalized Minimal Residual Method (GMRES) for non-symmetric systems

§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};

// Define a linear operator as a closure
let apply_operator = |x: &T| -> Result<T> {
    // Apply your linear operator to x
    operator.apply(x)
};

let result = gmres(&apply_operator, &rhs, &initial_guess, &GmresOptions::default())?;

Structs§

GmresOptions
Options for GMRES solver.
GmresResult
Result of GMRES solver.
RestartGmresOptions
Options for restarted GMRES with truncation.
RestartGmresResult
Result of restarted GMRES solver.

Functions§

gmres
Solve A x = b using GMRES (Generalized Minimal Residual Method).
gmres_with_truncation
Solve A x = b using GMRES with optional truncation after each iteration.
restart_gmres_with_truncation
Solve A x = b using restarted GMRES with truncation.