# [petsc-users] Computing Krylov decompositions with PETSc/SLEPc

Jose E. Roman jroman at dsic.upv.es
Fri Jul 6 09:18:27 CDT 2018

```SLEPc's default eigensolver 'krylovschur' does this kind of computation repeatedly, in an outer loop (the restarts) until eigenvalues are converged. If you call EPSSolve() with -eps_max_it 1 to avoid any restarts then you will get something similar to what you want. The computed basis can be retrieved with EPSGetBV(). However, this is not the intended usage, and hence it is not documented. You will have to look at the source code and see what is being computed.

What do you need this for?

Jose

> El 6 jul 2018, a las 16:00, Gard Spreemann <gard.spreemann at epfl.ch> escribió:
>
> Hello list,
>
> It is my (naive) understanding that a lot of the eigenproblem solvers
> in SLEPc and linear solvers in PETSc use Krylov subspace methods
> internally. However, I can't seem to find any functionality in
> either library that exposes these underlying methods.
>
> Specifically, I'm looking for something that takes
>
> - a sparse symmetric real NxN matrix A (or a function for computing
>   matrix-vector products with A)
>
> - a real vector x of size N
>
> - a (typically small) integer M<=N
>
> and returns an orthonormal basis v_1,…,v_M for
>
> span(x, Ax, A^2x, …, A^{M-1}x)
>
> so that V^T A V is tridiagonal, where V is the matrix with v_1,…,v_M
> as columns.
>
> Am I overlooking something, misunderstanding something, or something
> else? Any help is greatly appreciated (even if it involves pointing me
> to a different library).
>
> I'm sorry if the question is ill-posed, I am not well-versed in
> numerical linear algebra.
>
>