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

[BlockSparseArrays] Simplifications of blocks for blocksparse Adjoint and Transpose #1580

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

lkdvos
Copy link

@lkdvos lkdvos commented Nov 13, 2024

This PR excises SparseTransposeBlocks and SparseAdjointBlocks, and replaces them with the equivalent adjoint(blocks(a)) and transpose(blocks(a)).
This should not change any functionality, but reduces the complexity as the number of wrapper types decreases.

@lkdvos
Copy link
Author

lkdvos commented Nov 14, 2024

This should 🤞 now have all necessary imports and be based on the latest main

Comment on lines +209 to +215
a = dev(BlockSparseArray{elt}([1], [1, 1]))
@allowscalar a[1, 2] = 1
@test [@views(a[it]) for it in block_stored_indices(a)] isa Vector
ah = adjoint(a)
@test [@views(ah[it]) for it in block_stored_indices(ah)] isa Vector
at = transpose(a)
@test [@views(at[it]) for it in block_stored_indices(at)] isa Vector
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you make these tests a bit more comprehensive, i.e. maybe set some blocks and then check they are set correctly, check the types of the blocks, etc.?

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.

2 participants