We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6457a21 commit e67918cCopy full SHA for e67918c
src/MPS.jl
@@ -776,5 +776,18 @@ function LinearAlgebra.normalize!(::Canonical, ψ::AbstractMPO; bond=nothing)
776
Γ ./= Z
777
end
778
779
+ # normalize the first and last Γ tensors
780
+ Γ = tensors(ψ; at=lane"1")
781
+ Λ = tensors(ψ; bond=(lane"1", lane"2"))
782
+ ρ = contract(Γ, Λ; dims=Symbol[])
783
+ Z = norm(ρ)
784
+ Γ ./= Z
785
+
786
+ Γ = tensors(ψ; at=Lane(nlanes(ψ)))
787
+ Λ = tensors(ψ; bond=(Lane(nlanes(ψ) - 1), Lane(nlanes(ψ))))
788
789
790
791
792
return ψ
793
0 commit comments