Skip to content

Commit

Permalink
Change normalization to all lambdas for Canonical form
Browse files Browse the repository at this point in the history
  • Loading branch information
jofrevalles committed Nov 21, 2024
1 parent c9cf7d7 commit 7232631
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/MPS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7232631

Please sign in to comment.