Hi, I am working on Julia 1.8.2 and trying to run the code example on the webpage DMRG Examples · ITensors.jl
using ITensors
let
N = 100
sites = siteinds("S=1",N)
os = OpSum()
for j=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,sites)
nsweeps = 5 # number of sweeps is 5
maxdim = [10,20,100,100,200] # gradually increase states kept
cutoff = [1E-10] # desired truncation error
psi0 = randomMPS(sites,2)
energy,psi = dmrg(H,psi0; nsweeps, maxdim, cutoff)
return
end
But it gives an error saying that
ERROR: MethodError: no method matching sort(::Tuple{Index{Int64}, Index{Int64}}; by::typeof(plev))
And the Stacktrace is
Stacktrace:
[1] permute(M::MPO, #unused#::Tuple{typeof(linkind), typeof(siteinds), typeof(linkind)})
@ ITensors F:\Julia-1.8.2\packages\packages\ITensors\hLDmL\src\mps\dmrg.jl:13
[2] #dmrg#1051
@ F:\Julia-1.8.2\packages\packages\ITensors\hLDmL\src\mps\dmrg.jl:25 [inlined]
[3] dmrg
@ F:\Julia-1.8.2\packages\packages\ITensors\hLDmL\src\mps\dmrg.jl:20 [inlined]
[4] #dmrg#1057
@ F:\Julia-1.8.2\packages\packages\ITensors\hLDmL\src\mps\dmrg.jl:375 [inlined]
[5] top-level scope
@ .\Untitled-1:21
I succeeded in running this piece of code previously but it doesn’t work today. Updating Julia to latest version doesn’t help. How may I solve this problem?
Thanks!