ITensor / ITensor/BlockSparseArrays.jl
[ENHANCEMENT] `Base.map!` needs refactor
Open
Nobody has claimed this yet.
enhancement
- Dominant language
- Julia
- Stars
- 3
- Forks
- 3
- Avg merge
- 14m
- Merged PRs (30d)
- 3
Description
#src/blocksparsearrayinterface/map.jl
@interface interface::AbstractBlockSparseArrayInterface function Base.map!(
f, a_dest::AbstractArray, a_srcs::AbstractArray...
)
Base.map! is not compatible with the design of KroneckerMatrix.
- line 27, indexing a
SparseArraysBase.SparseMatrixDOK{KroneckerMatrixfails as it tries to callBase.similar(::Type{KroneckerMatrix{...}}, dims::Tuple{Int,Int})which cannot be defined (there is not enough information in type + size to init aKroneckerMatrix). - line 39, it calls
iszeroon aSubArray{Float64, 2, KroneckerMatrix}.iszerois defined for aKroneckerMatrix, but the wrapper type prevents the dispatch and the fall back option errors ongetindex
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/blocksparsearrayinterface/map.jl and inspect the Base.map! interface around lines 27 and 39. Reproduce the failures involving SparseMatrixDOK{KroneckerMatrix}, Base.similar, and iszero on a SubArray. Done means Base.map! works with KroneckerMatrix without requiring unavailable type-and-size initialization or failing through the wrapper type.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100