Skip to content

Commit

Permalink
Populate ITensor with zeros if empty after contracting with ProjTTN.
Browse files Browse the repository at this point in the history
  • Loading branch information
Benedikt Kloss committed Jan 25, 2024
1 parent 56fcb93 commit 1ef03c5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/treetensornetworks/projttns/abstractprojttn.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ function contract(P::AbstractProjTTN, v::ITensor)::ITensor
for it in itensor_map
Hv *= it
end
if isempty(Hv)
Hv = similar(v)
Hv .= 0
end
return Hv
end

Expand Down

0 comments on commit 1ef03c5

Please sign in to comment.