From 063ccbe7d22cfb47a750f3d5fa5bbec5e15651fa Mon Sep 17 00:00:00 2001 From: b-kloss Date: Fri, 3 Nov 2023 08:22:13 -0400 Subject: [PATCH] [ITensors] Fix performance bug in `svdMPO` involving unnecessarily large intermediate weight matrices (#1231) --- src/physics/autompo/opsum_to_mpo.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/physics/autompo/opsum_to_mpo.jl b/src/physics/autompo/opsum_to_mpo.jl index 1388fe91f9..892ac4a88f 100644 --- a/src/physics/autompo/opsum_to_mpo.jl +++ b/src/physics/autompo/opsum_to_mpo.jl @@ -16,7 +16,7 @@ function svdMPO(ValType::Type{<:Number}, os::OpSum{C}, sites; kwargs...)::MPO wh return (only(site(t[1])) <= n <= only(site(t[end]))) end - rightmaps = fill(Dict{Vector{Op},Int}(), N) + rightmaps = [Dict{Vector{Op},Int}() for _ in 1:N] for n in 1:N leftbond_coefs = MatElem{ValType}[]