Open patrick-kidger opened 1 year ago
This depends on the kind of operator you have. A tridiagonal linear operator, for example, can get the diagonal without further materialization!
However it's a classic (sad) fact in autodifferentiation that accessing the diagonal of a Jacobian requires computing the whole Jacobian.
You'll probably need to find a different approach for your problem.
Sorry I couldn't be more help!
Hey, I'm using a Newton-GMRES-algorithm for implicitly solving large ODEs, based on Diffrax/Optimistix/Lineax – a pretty awesome set of libraries!
Right now I'm trying to figure out, how to create a Jacobi-preconditioner (or a more advanced one) for matrix-free computations. Using lx.diagonal(...) materializes the Jacobian and therefore is not possible for a vector of length ~500,000. Do you have any idea how to solve this problem?