From 72326311eecbad47cf60b50b86b9adfe2d4bb5ce Mon Sep 17 00:00:00 2001 From: jofrevalles Date: Thu, 21 Nov 2024 16:24:21 +0100 Subject: [PATCH] Change normalization to all lambdas for Canonical form --- src/MPS.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/MPS.jl b/src/MPS.jl index 854d9292..21c67feb 100644 --- a/src/MPS.jl +++ b/src/MPS.jl @@ -560,9 +560,11 @@ end function LinearAlgebra.normalize!(config::Canonical, ψ::AbstractMPO; at=nothing) if isnothing(at) # Normalize all λ tensors + normalizer = (norm(ψ))^(1/(nsites(ψ)-1)) + for i in 1:(nsites(ψ) - 1) λ = tensors(ψ; between=(Site(i), Site(i + 1))) - replace!(ψ, λ => λ ./ norm(ψ)) + replace!(ψ, λ => λ ./ normalizer) end else λ = tensors(ψ; between=at)