-
Notifications
You must be signed in to change notification settings - Fork 125
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] Simplify and test adjoint(::BlockSparseMatrix)
#1573
Conversation
I forgot that was a reason why I was concerned about pushing the wrapper further down but I agree the current design still preserves that information. Definitely something to think carefully about. |
I think it would be strange for |
I think the type of what Alternatively, I think these lines are not correct, I think if you want to have the |
Indeed I previously proposed a similar change. I understand that extra logic would be needed for the |
I agree that to some extent it is an implementation detail, though I'm sure you know these kind of abstractions are "leaky", i.e. inevitably someone will write code like Another hesitation I have about doing this right now is that I do want So for now I think we should hold off on this and just work through the current and future issues that come up when using Probably you have seen, but the design I have been working with is that when you call
I wasn't aware of julia> using ArrayLayouts
julia> MemoryLayout(randn(4, 4))
DenseColumnMajor()
julia> MemoryLayout(randn(4, 4)')
ArrayLayouts.DenseRowMajor()
julia> MemoryLayout(randn(4))
DenseColumnMajor()
julia> MemoryLayout(randn(4)')
DualLayout{ArrayLayouts.DenseRowMajor}() (I really had not thought about |
I noticed you use that in certain places, but I think you could just use EDIT: We just need to make sure that whatever gets output by |
adjoint(::BlockSparseMatrix)
adjoint(::BlockSparseMatrix)
After discussion, let me close this PR as "not planned", with the goal of ensuring that the wrapper types work. |
Sounds good. We can keep this design in mind if the wrapper type becomes too complicated to work with. |
This PR simplifies both
adjoint(::BlockSparseMatrix)
andtranspose(::BlockSparseMatrix)
.This was discussed in #1572, but was already previously mentioned by @ogauthe as well:
ITensor/BlockSparseArrays.jl#2
Regarding your comment there about the vector types, keep in mind that I (for now) only intercepted the matrix case. I can investigate if we can make this work for
Vector
as well, keeping in mind that theAdjoint
wrapper information is still there, it is just not the outer wrapper.