# How to pass a matrix free preconditioner to IterativeSolver of KrylovKit?

**URL:** https://discourse.julialang.org/t/how-to-pass-a-matrix-free-preconditioner-to-iterativesolver-of-krylovkit/63315
**Category:** General Usage
**Tags:** package
**Created:** [June 21, 2021, 4:37pm UTC](https://discourse.julialang.org/t/how-to-pass-a-matrix-free-preconditioner-to-iterativesolver-of-krylovkit/63315 "2021-06-21T16:37:52Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### Author: ![erny123](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erny123/32/52255_2.png) [@erny123](https://discourse.julialang.org/u/erny123)
#### Post date: [February 14, 2024, 8:04pm UTC](https://discourse.julialang.org/t/how-to-pass-a-matrix-free-preconditioner-to-iterativesolver-of-krylovkit/63315/7 "2024-02-14T20:04:54Z")

</div>

Only thing I would add is that some methods of IterativeSolvers.jl require you to also define the following in-place `ldiv!`:

`LinearAlgebra.ldiv!(P::MyPreconditioner, X) = X.= P.fun(X) #or whatever solver you choose`

---

_[View the full topic](https://discourse.julialang.org/t/how-to-pass-a-matrix-free-preconditioner-to-iterativesolver-of-krylovkit/63315)._
