TomographicImaging / CIL

A versatile python framework for tomographic imaging
https://tomographicimaging.github.io/CIL/
Apache License 2.0
98 stars 45 forks source link

Add in a BlockDiagonalOperator #1568

Open MargaretDuff opened 1 year ago

MargaretDuff commented 1 year ago

See e.g. Tommi's user showcase: https://github.com/TomographicImaging/CIL-User-Showcase/blob/main/004_STEMPO-DynamicCT/stempo2d_v2_1.ipynb

Would want it to be implemented efficiently, e.g. without ZeroOperators

MargaretDuff commented 1 year ago

I had a think about this one. It is relatively easy to create a square BlockOperator with a list of operators on the diagonal.

However, if we are considering block diagonal operators with the off-diagonals being non-zero then we only have geometries defined if there is at least one operator defined per each row and column. Thus I have had a play with implementing a BlockDiagonalOperator that by default takes in a main diagonal but the user could optionally give a list of offsets and a list of lists of operators, including the main diagonal. There is an issue calculating norms in this case.

Initial implementation is here https://github.com/MargaretDuff/CIL-margaret/blob/blockdiagonaloperator/Wrappers/Python/cil/optimisation/operators/DiagonalOperator.py

It feels like we want to implement some sort of sparse notation for BlockOperators??