Method error when broadcast and sum of matrices
Open
Nobody has claimed this yet.
documentation
- Dominant language
- Julia
- Stars
- 668
- Forks
- 30
- PR merge metrics
- No merged PRs in 30d
Description
I want to broadcast a vector of matrix, with summation inside. Here are codes:
julia> using Tullio
julia> x=range(start=-1,length=10,stop=1);
julia> e=rand(10);
julia> @tullio _[n]:=inv([x[n] -1.0;-1.0 x[n]-e[k]]);
ERROR: MethodError: no method matching zero(::Type{Matrix{Float64}})
How could I solve this?
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 by reproducing the Julia snippet with Tullio and trace how the broadcasted matrix expression is reduced, focusing on the zero(Matrix) MethodError. Done means the shown expression can broadcast the vector of matrices and perform the summation without that error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100