Hi!
I am trying to implement single-site TDVP following this paper (Haegeman et al. (2016)). The algorithm is clearly described on page 8,Appendix B. First,I decided to go for only a single time step. My test system is
15-site Heisenberg model.
N = 15
cutoff = 1e-10
s = siteinds("S=1/2", N)
os = OpSum()
for j in 1:(N - 1)
os += 0.5, "S+", j, "S-", j + 1
os += 0.5, "S-", j, "S+", j + 1
os += "Sz", j, "Sz", j + 1
end
H = MPO(os, s)
ψ = productMPS(s, n -> isodd(n) ? "Up" : "Dn")
tf=4
dt=0.1 # delta t
num_time_steps = Int(tf/dt)
nsite=1
τ = 1im*dt
println(ψ)
Now, I have tried to implement first only for left-to-right swap. The code is below.
function measure_Sz(psi,n)
psi = ITensors.orthogonalize(psi,n)
sn = siteind(psi,n)
Sz = scalar(dag(prime(psi[n],"Site"))*op("Sz",sn)*psi[n])
return real(Sz)
end
#ψ = productMPS(s, n -> isodd(n) ? "Up" : "Dn")
println(ψ)
ITensors.orthogonalize!(ψ,1)
PH=ProjMPO(H)
position!(PH,ψ,1)
N=length(ψ)
ha=1 # For left-to-right swap
for n=1:N-1
# left-to-right sweep
ITensors.orthogonalize!(ψ,n)
#This brings the orthogonality center to site n?
println("Site : ",n," Current centre : ",ITensors.orthocenter(ψ))
set_nsite!(PH,1)
position!(PH,ψ,n)
phi1=ψ[n]
println("Before expo ",n)
phi1, info = exponentiate(PH, -τ/2, phi1; ishermitian=hermitian , tol=exp_tol, krylovdim=krylovdim)
info.converged==0 && throw("exponentiate did not converge")
ψ[n] = phi1
uinds = uniqueinds(phi1, ψ[n + 1])
U, S, V = svd(phi1, uinds)
ψ[n] = U
phi0 = S * V
if ha == 1
ITensors.setleftlim!(ψ, n)
elseif ha == 2
ITensors.setrightlim!(ψ, n)
end
set_nsite!(PH, 0)
ITensors.position!(PH, ψ, n+1)
phi0, info = exponentiate(PH, τ/2, phi0; ishermitian=hermitian , tol=exp_tol, krylovdim=krylovdim)
phi0 ./= norm(phi0)
ψ[n+1] = ψ[n+1] * phi0
if ha == 1
ITensors.setrightlim!(ψ, n + 2)
elseif ha == 2
ITensors.setleftlim!(ψ, n )
end
end
#Evolve A_C (N,t)
ITensors.orthogonalize!(ψ,N)
#This brings the orthogonality center to site n?
println("Site : ",N," Current centre : ",ITensors.orthocenter(ψ))
set_nsite!(PH,1)
position!(PH,ψ,N)
phi1=ψ[N]
println("Before expo ",N)
phi1, info = exponentiate(PH, -τ, phi1; ishermitian=hermitian , tol=exp_tol, krylovdim=krylovdim)
info.converged==0 && throw("exponentiate did not converge")
#Check if phi1 is normalised
(phi1 /= norm(phi1))
ψ[N] = phi1
println("Test")
ha=2 # right-to-left
As it turns out, this doesn’t ever increase the bond dimension off the MPS & the expectation values of Sz remains same as the initial one.
I know it is not the complete algo & we should also do the reverse swap. But shouldn’t just doing this step have some effect on bond dim/Sz (we are applying exponentiate here)?I guess I’m doing something wrong here but can’t figure out what I am missing.
I would really appreciate any suggestion.Thank you in advance.