In issue #3 , a solver based on Woodbury matrix identity was given as a new solver feature for lineax.
Here I have made a first attempt at implementing it. It works slightly differently than the other base LinearOperators as it takes a LinearOperator as an argument (for A), with U, C and V as JAX arrays. This allows for the correct specialised solvers to be used for inverse(A) operations. E.g. A can be a DiagonalLinearOperator/TridiagonalLinearOperator/etc. - see test_Woodbury in test_operator.py
Things I am not certain of:
Is passing solvers and states around in the SolverState of Woodbury the best approach. It would seem to me to minimise re-initialising solvers for multiple RHS. However perhaps there is a neater solution.
I have not included a tag for Woodbury, it seems difficult to identify if matrices have this structure so it seems to me it should be left to the user. However, I am not sure if I have handled the operation-type linear operators (Add,Mul,Div,etc.) correctly in this instance.
I had to add a pyright ignore in _solve.py under _linear_solve_transpose for allow_struct, not sure why.
In issue #3 , a solver based on Woodbury matrix identity was given as a new solver feature for lineax.
Here I have made a first attempt at implementing it. It works slightly differently than the other base LinearOperators as it takes a LinearOperator as an argument (for A), with U, C and V as JAX arrays. This allows for the correct specialised solvers to be used for inverse(A) operations. E.g. A can be a DiagonalLinearOperator/TridiagonalLinearOperator/etc. - see test_Woodbury in test_operator.py
Things I am not certain of:
But it made me notice that materialise_zeros is from equinox 0.11.4 but pyproject.toml requires >=0.11.3. Does this require correcting?