Skip to content

Commit

Permalink
Fix normalize! by putting replace! instead of inplace modification fo…
Browse files Browse the repository at this point in the history
…r NonCanonical
  • Loading branch information
jofrevalles committed Nov 21, 2024
1 parent f844ac0 commit a0b0267
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/MPS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ LinearAlgebra.normalize!(ψ::AbstractMPO, site) = normalize!(form(ψ), ψ; at=si
function LinearAlgebra.normalize!(::NonCanonical, ψ::AbstractMPO; at=Site(nsites(ψ) ÷ 2))
if at isa Site
tensor = tensors(ψ; at)
tensor ./= norm(ψ)
replace!(ψ, tensor => tensor ./ norm))
else
normalize!(mixed_canonize!(ψ, at))
end
Expand Down

0 comments on commit a0b0267

Please sign in to comment.