pub fn gmres_with_truncation<T, F, Tr>(
apply_a: F,
b: &T,
x0: &T,
options: &GmresOptions,
truncate: Tr,
) -> Result<GmresResult<T>>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 implementingTensorLikeF- A function that applies the linear operator:F(x) = A xTr- A function that truncates a tensor in-place:Tr(&mut x)
§Arguments
apply_a- Function that applies the linear operator A to a tensorb- Right-hand side tensorx0- Initial guessoptions- Solver optionstruncate- 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.