probnum icon indicating copy to clipboard operation
probnum copied to clipboard

Have `statespace.Preconditioner` subclasses implement `LinearOperator` and remove `statespace.Preconditioner`

Open JonathanWenger opened this issue 3 years ago • 1 comments

In a Nutshell

The statespace module has a general abstract class Preconditioner which implements a inverse method. This duplicates functionality of LinearOperator with different method naming.

In Detail

Coordinate change transformations in state-space models used as preconditioners have their own abstract class in statespace. This class only implements __call__ and inverse and does not inherit from LinearOperator, which has .inv(). Preconditioners will be used more widely in the library and if they warrant a common base class should be handled as LinearOperators.

ToDo

  • [x] Determine what function the Preconditioner class serves and whether it has any functionality beyond LinearOperator
  • [ ] Make statespace.Preconditioner subclasses inherit from LinearOperator
  • [ ] Remove statespace.Preconditioner

JonathanWenger avatar Jun 30 '21 09:06 JonathanWenger

Regarding the first point: they only implement coordinate changes. The LinearOperator interface should suffice. If preconditioner-operators (or coordinate-change operators) are to be used more widely in probnum, we can move it to linops.

pnkraemer avatar Jul 05 '21 07:07 pnkraemer