Hello,
I am not very familiar with directly implementing the iDMRG method. Just for the simplest Heisenberg chain,H = J \sum_i \vec{S}_i \cdot \vec{S}_{i+1},would it be possible for you to provide a sample Julia script for iDMRG?
Thank you very much.
Or I’d like to ask: what exactly is wrong with this iDMRG code I tried to write?
using ITensors
using ITensorMPS
using ITensorInfiniteMPS
function main()
initstate(n) = isodd(n) ? “Up” : “Dn”
s = infsiteinds(“S=1/2”, 2; initstate=initstate, conserve_qns=false)
ampo = OpSum()
for j in 1:2
ampo += 0.5, “S+”, j, “S-”, j + 1
ampo += 0.5, “S-”, j, “S+”, j + 1
ampo += 1.0, “Sz”, j, “Sz”, j + 1
end
H = MPO(ampo, s)
psi0 = InfMPS(s, [“Up”, “Dn”])
nsweeps = 20
maxdim = [10, 20, 50, 100, 200, 400]
cutoff = 1e-10
energy, psi = idmrg(H, psi0; nsweeps=nsweeps, maxdim=maxdim, cutoff=cutoff)
println(“energy = $energy”)
end
if abspath(PROGRAM_FILE) == @FILE
main()
println(“Done”)
end
I am not familiar with ITensorInfiniteMPS or MPS algorithms which work in the thermodynamic limit more generally. However, my intuition is that you should modify the Heisenberg example found here: https://github.com/ITensor/ITensorInfiniteMPS.jl/blob/main/examples/vumps/vumps_heisenberg.jl
There are a number of differences between that example and your code, most prominently there does not appear to be an implementation of infinite-DMRG in ITensorInfiniteMPS, but if VUMPS is acceptable then you’re in luck. See this thread for a discussion: https://itensor.discourse.group/t/implementing-idrmg/168