A flexible version of the QMR algorithm is presented which allows for the u
se of a different preconditioner at each step of the algorithm. In particul
ar, inexact solutions of the preconditioned equations are allowed, as well
as the use of an (inner) iterative method as a preconditioner. Several theo
rems are presented relating the norm of the residual of the new method with
the norm of the residual of other methods, including QMR and flexible GMRE
S (FGMRES). In addition, numerical experiments are presented which illustra
te the convergence of flexible QMR (FQMR), and show that in certain cases F
QMR can produce approximations with lower residual norms than QMR.