Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block Diagonal Operator #1578

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

MargaretDuff
Copy link
Member

Describe your changes

Takes in a main diagonal, a list of operators, and, optionally, other diagonals and creates an BlockDiagonalOperator that subclasses the operator class.

Describe any testing you have performed

Please add any demo scripts to CIL-Demos/misc/

Link relevant issues

Closes #1568

Checklist when you are ready to request a review

  • I have performed a self-review of my code
  • I have added docstrings in line with the guidance in the developer guide
  • I have implemented unit tests that cover any new or modified functionality
  • CHANGELOG.md has been updated with any functionality change
  • Request review from all relevant developers
  • Change pull request label to 'Waiting for review'

Contribution Notes

Please read and adhere to the developer guide and local patterns and conventions.

  • The content of this Pull Request (the Contribution) is intentionally submitted for inclusion in CIL (the Work) under the terms and conditions of the Apache-2.0 License.
  • I confirm that the contribution does not violate any intellectual property rights of third parties

@MargaretDuff MargaretDuff linked an issue Nov 21, 2023 that may be closed by this pull request
@MargaretDuff
Copy link
Member Author

Some open questions:

  • This BlockDiagonalOperator is an Operator but not a BlockOperator because it doesn't have the full list of operators needed for the BlockOperator. I wonder if this will be a problem?
  • I haven't worked out how to calculate the norm efficiently. I think for the case of a single main diagonal block operator it is straightforward but not with off diagonals.
  • I haven't given the option for non-square block matrices or for the main diagonal not to be defined, because then there is an issue with not knowing the full domain and range geometry for your operator.
  • I need to write some more unit tests!

@MargaretDuff MargaretDuff self-assigned this Nov 21, 2023
@MargaretDuff
Copy link
Member Author

@jakobsj You mentioned that you had thought about this before - any thoughts?

@paskino
Copy link
Contributor

paskino commented Feb 8, 2024

I think this could also be handled by BlockOperator by not calling direct or adjoint of the ZeroOperator on direct or adjoint respectively.

For instance this

prod += self.get_item(row,
col).direct(x_b.get_item(col))

could be substituted by

op = self.get_item(row, col)
if not isinstance(op, ZeroOperator):
    prod += op.direct(x_b.get_item(col))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add in a BlockDiagonalOperator
2 participants