diff --git a/src/treetensornetworks/projttns/abstractprojttn.jl b/src/treetensornetworks/projttns/abstractprojttn.jl index 9f6da826..09966f08 100644 --- a/src/treetensornetworks/projttns/abstractprojttn.jl +++ b/src/treetensornetworks/projttns/abstractprojttn.jl @@ -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