Hi Everyone,
I am trying to construct an infinite MPO to then construct a VUMPS. I construct a model with custom operators with a bosonic local hilbert space. When I try doing the infinite sum for the MPO, I get the following error, “MethodError: no method matching translatecell(::ITensorInfiniteMPS.var”#_shift_cell#176"{Int64}, ::Scaled{ComplexF64, Prod{Op}}, ::Int64) ". I’ll include my code below. I suspect the problem is arising from my use of custom local operators since I try using a toy model on the same hilbert space that just uses the built in bosonic operators in itensor and I don’t run into any issues.
My model where phi = \frac{1}{\sqrt{2}} (a^\dagger + a) and cpi2 has matrix elements of the square of cpi =\frac{i}{\sqrt{2}} (a^\dagger - a)
function ITensorInfiniteMPS.unit_cell_terms(::Model"Realphi4")
opsum = OpSum()
opsum += 0.5, "cpi2",1
opsum += 0.5*(1+m2), "phi",1,"phi",1
opsum += 0.5, "phi",2,"phi",2
opsum += -1, "phi",1,"phi",2
opsum += ld/24 ,"phi",1,"phi",1,"phi",1,"phi",1
return opsum
end
My attempt to create an infinite MPO that gives me the mentioned error. This should be runnable if you have the model, which I will include below if the error wants to be reproducible.
using ITensors
using ITensorInfiniteMPS
include(
joinpath(
pkgdir(ITensorInfiniteMPS), "examples", "vumps", "src", "vumps_subspace_expansion.jl"
),
)
m2= 10
ld =1
maxdim = 100 # Maximum bond dimension
cutoff = 1e-8 # Singular value cutoff when increasing the bond dimension
max_vumps_iters = 100 # Maximum number of iterations of the VUMPS algorithm at each bond dimension
vumps_tol = 1e-6
conserve_qns = false
outer_iters = 8 # Number of times to increase the bond dimension
N = 10 # Number of sites in the unit cell
initstate(n) = isodd(n) ? "1" : "2"
s = infsiteinds("Boson", N; dim=8, conserve_qns, initstate)
ψ = InfMPS(s, initstate)
model = Model("Realphi4")
#model = Model("bosontoy")
# Form the Hamiltonian
H = InfiniteSum{MPO}(model, s)
These are the necessary local operator definitions:
using ITensors
function ITensors.op(::OpName"phi",::SiteType"Boson", d::Int )
mat = zeros(d,d)
for i in 0:d-1
for j in 0:d-1
mat[i+1 ,j+1] = (1/ sqrt(2))*( (i-1==j)*sqrt(j+1)+ (i==j-1)*sqrt(i+1) )
end
end
mat[d,d]+= -d/2
return mat
end
function ITensors.op(::OpName"cpi2",::SiteType"Boson", d::Int )
mat = zeros(ComplexF64,d,d)
for i in 0:d-1
for j in 0:d-1
mat[i+1 ,j+1] = (1/2)*( -(i-1==j+1)*sqrt((j+1)*(j+2))+ (i==j)*(2*i+1)- (i+1==j-1)*sqrt((i+1)*(i+2)))
end
end
mat[d,d]+= -d/2
return mat
end
Any help with this would be greatly appreciated. Thank you!
Best,
Jake Montgomery