gmres_with_truncation

Function gmres_with_truncation 

Source
pub fn gmres_with_truncation<T, F, Tr>(
    apply_a: F,
    b: &T,
    x0: &T,
    options: &GmresOptions,
    truncate: Tr,
) -> Result<GmresResult<T>>
where T: TensorLike, F: Fn(&T) -> Result<T>, Tr: Fn(&mut T) -> Result<()>,
Expand description

Solve A x = b using GMRES with optional truncation after each iteration.

This is an extension of gmres that allows truncating Krylov basis vectors to control bond dimension growth in tensor network representations.

§Type Parameters

  • T - A tensor type implementing TensorLike
  • F - A function that applies the linear operator: F(x) = A x
  • Tr - A function that truncates a tensor in-place: Tr(&mut x)

§Arguments

  • apply_a - Function that applies the linear operator A to a tensor
  • b - Right-hand side tensor
  • x0 - Initial guess
  • options - Solver options
  • truncate - Function that truncates a tensor to control bond dimension

§Note

Truncation is applied after each Gram-Schmidt orthogonalization step and after the final solution update. This helps control the bond dimension growth that would otherwise occur in MPS/MPO representations.