Conversation
These were only defined for `BlockTensorMap`/`BlockTensorMap` and `SparseBlockTensorMap`/`SparseBlockTensorMap` pairs, so a mixed pair fell through to TensorKit's generic `AbstractTensorMap` methods, which operate on the fused per-sector `BlockMatrix`es. That path throws a `BoundsError` whenever a coupled sector has an interior zero-length block, which is the normal situation for a `SumSpace` with heterogeneous summands. Replace the specializations by a single `AbstractBlockTensorMap` method each, branching on `issparse` only where the cases differ. Also drop the dense-only `axpy!`, `axpby!`, `dot` and `mul!`, which reimplement TensorKit generics that forward to this layer (the deleted `mul!` referenced `SparseArrayKit._zero!`, which is not a dependency of this package). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
Member
Author
|
Failures are unrelated and will be fixed elsewhere |
Merged
lkdvos
referenced
this pull request
Sep 11, 2026
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #74.
add!,scale!(y, x, α)andinnerwere only defined for dense/dense and sparse/sparse pairs; a mixed pair fell through to TensorKit's generic methods, which broadcast over the fused per-sectorBlockMatrixes and hit aBoundsErrorfor coupled sectors with an interior zero-length block.AbstractBlockTensorMapmethod each instead of the per-storage specializations, branching onissparseonly where neededaxpy!/axpby!/dot/mul!: they reimplement TensorKit generics that forward here (the deletedmul!calledSparseArrayKit._zero!, not a dependency)add!into a sparse destination from a dense source fills it in;dropzeros!afterwards if needed🤖 Generated with Claude Code