# Krylov subspace polynomial of one right hand side, applied to another

**URL:** <https://discourse.julialang.org/t/krylov-subspace-polynomial-of-one-right-hand-side-applied-to-another/50250>\
**Category:** Numerics\
**Created:** [November 16, 2020, 9:24pm UTC](https://discourse.julialang.org/t/krylov-subspace-polynomial-of-one-right-hand-side-applied-to-another/50250 "2020-11-16T21:24:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![raminammour](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/raminammour/32/13572_2.png) [@raminammour](https://discourse.julialang.org/u/raminammour)\
**Post date:** [November 16, 2020, 9:24pm UTC](https://discourse.julialang.org/t/krylov-subspace-polynomial-of-one-right-hand-side-applied-to-another/50250/1 "2020-11-16T21:24:17Z")

</div>

Hello,

A Krylov subspace method (gmres, cg, minres,…) approximates the solution of a linear system, Ax=b. The solution at iteration n is a polynomial in A, applied to the right hand side b: x\_n = P\_n(A,b) b. Note that P\_n depends on the rhs b.

Now I need to apply the _same_ polynomial to another vector b', i.e., I want x'\_n = P\_n(A,b) b'.

Do you know of code that can do that? Or an easy way to hack the available code for iterative solvers?

I looked at some codes (`IterativeSolvers`, `KrylovMethods`, …) but could not figure out an easy (read lazy) way 🙂

Any ideas?

Cheers!
