11using ITensors
22using ITensorInfiniteMPS
33
4- include (
5- joinpath (
6- pkgdir (ITensorInfiniteMPS), " examples " , " vumps " , " src " , " vumps_subspace_expansion.jl "
7- ),
8- )
4+ base_path = joinpath ( pkgdir (ITensorInfiniteMPS), " examples " , " vumps " , " src " )
5+ src_files = [ " vumps_subspace_expansion.jl " , " entropy.jl " ]
6+ for f in src_files
7+ include ( joinpath (base_path, f))
8+ end
99
1010# #############################################################################
1111# VUMPS parameters
@@ -105,7 +105,7 @@ maxdims =
105105# # setcutoff!(sweeps, cutoff)
106106
107107println (" \n Run DMRG on $Nfinite sites" )
108- energy_finite_total, ψfinite = dmrg (Hfinite, ψfinite; nsweeps, maxdims, cutoff)
108+ energy_finite_total, ψfinite = dmrg (Hfinite, ψfinite; nsweeps, maxdim = maxdims, cutoff)
109109println (" \n Energy density" )
110110@show energy_finite_total / Nfinite
111111
@@ -125,6 +125,9 @@ corr_finite = correlation_matrix(
125125 ψfinite, " Cdagup" , " Cup" ; sites= Int (Nfinite / 2 ): Int (Nfinite / 2 + 9 )
126126)
127127
128+ S_finite = [entropy (ψfinite, b) for b in (Nfinite ÷ 2 ): (Nfinite ÷ 2 + N - 1 )]
129+ S_infinite = [entropy (ψ, b) for b in 1 : N]
130+
128131println (" \n Results from VUMPS" )
129132@show energy_infinite
130133@show energy_exact
@@ -133,6 +136,7 @@ println("\nResults from VUMPS")
133136@show Nup .+ Ndn
134137@show Sz
135138@show corr_infinite
139+ @show S_infinite
136140
137141println (" \n Results from DMRG" )
138142@show energy_finite
@@ -141,5 +145,6 @@ println("\nResults from DMRG")
141145@show Nup_finite .+ Ndn_finite
142146@show Sz_finite
143147@show corr_finite
148+ @show S_finite
144149
145150nothing
0 commit comments