Description
Is your feature request related to a problem? Please describe.
While in-place contraction A .= B .* C
is implemented for dense tensors, it seems to be missing for symmetric tensors. Using code from a manual as an example, we can construct
using ITensors
i = Index([QN(0) => 2, QN(1) => 3], "i")
j = Index([QN(0) => 2, QN(1) => 3], "j")
A = randomITensor(i, dag(j))
C = combiner(i, dag(j); tags = "c", dir = dir(i))
A * C # works
D = A * C # works
D .= A .* C # does not work
D = randomITensor(inds(A*C))
D .= A .* C # does not work
D .+= A .* C # does not work either
Here is an error I get in my use case:
MethodError: no method matching contract!(::NDTensors.BlockSparseTensor{Float64, 2, Tuple{Index{Vector{Pair{QN, Int64}}}, Index{Vector{Pair{QN, Int64}}}}, NDTensors.BlockSparse{Float64, Vector{Float64}, 2}}, ::Tuple{Int64, Int64}, ::NDTensors.BlockSparseTensor{Float64, 2, Tuple{Index{Vector{Pair{QN, Int64}}}, Index{Vector{Pair{QN, Int64}}}}, NDTensors.BlockSparse{Float64, Vector{Float64}, 2}}, ::Tuple{Int64, Int64}, ::NDTensors.BlockSparseTensor{Float64, 2, Tuple{Index{Vector{Pair{QN, Int64}}}, Index{Vector{Pair{QN, Int64}}}}, NDTensors.BlockSparse{Float64, Vector{Float64}, 2}}, ::Tuple{Int64, Int64})
Describe the solution you'd like
Support of in-place contractions A .= B .* C
and A .+= B .* C
for symmetric (block--sparse) tensors.