Dear all,
I have calculated entanglement entropy of a fermionic system with onsite interaction and magnetic and potential fields. I have plotted the results of calculation EA (entanglement entropy in section A) as a function of LA (LA is a size of subsystem).
Why the plotted curve is not smooth? Is this might be a result of non-converged calculations to the ground state?
Here is example of code:
using ITensors
energy_array = Float64[]
energy1_array = Float64[]
energy2_array = Float64[]
energy_difference_array = Float64[]
psi_array = Float64[]
psi_array1 = Float64[]
es = Float64[]
for iteration in 1:500
N = 96
Npart = 96
t1 = 1.0
b=22
U = 1
h = 1.0
sites = siteinds("Electron", N; conserve_qns = true)
ampo = AutoMPO()
for f = 1:N-1
ampo += -t1, "Cdagup", f, "Cup", f+1
ampo += -t1, "Cdagup", f+1, "Cup", f
ampo += -t1, "Cdagdn", f, "Cdn", f+1
ampo += -t1, "Cdagdn", f+1, "Cdn", f
end
for i = 1:N
ampo += U, "Nupdn", i
end
# Magnetic field term
for i = 1:N
hz = 20 * rand() - 10 # [-1, 1]
println(hz)
ampo += hz, "Nup", i
ampo -= hz, "Ndn", i
end
# Potential field term
for i = 1:N
hE = rand() - 0.5 # [-0.5, 0.5]
println(hE)
ampo += hE, "Ntot", i
end
H = MPO(ampo, sites)
state = [isodd(n) ? "Up" : "Dn" for n = 1:N]
psi0 = randomMPS(sites, state)
@show flux(psi0)
sweeps = Sweeps(6)
maxdim!(sweeps, 50, 100, 200, 400, 800, 800)
cutoff!(sweeps, 1E-12)
@show sweeps
energy, psi = dmrg(H, psi0, sweeps)
psi1_init = randomMPS(sites, state)
energy1, psi1 = dmrg(H, [psi0], psi1_init, sweeps)
# Append energy values to arrays
push!(energy_array, energy)
push!(energy_array, energy1)
orthogonalize!(psi, b)
U,S,V = svd(psi[b], (linkind(psi, b-1), siteind(psi,b)))
SvN = 0.0
for n=1:dim(S, 1)
p = S[n,n]^2
SvN -= p * log(p)
end
push!(es, SvN)
orthogonalize!(psi1, b)
U,S,V = svd(psi1[b], (linkind(psi1, b-1), siteind(psi1,b)))
SvN = 0.0
for n=1:dim(S, 1)
p = S[n,n]^2
SvN -= p * log(p)
end
push!(es, SvN)
end
println("Energy Array: ", energy_array)
println(es)
Thank you in advance.
Faridun