Hi ,when I’m trying to apply MPO to an MPS by using “apply”, the program would report MethodError. In order to locate the problem, I test it with a simple program but error too. My Itensor version is ITensors v0.2.16
using ITensors
sites = siteinds("S=1/2", 4)
psi0 = randomMPS(sites)
ampo = AutoMPO()
for j=1:4
add!(ampo, "Sz", j)
end
H = MPO(ampo, sites)
psi1 = apply(H, psi0)
Here’s the output
MethodError: no method matching product(::MPO, ::MPS) You may have intended to import Base.product Closest candidates are: product(!Matched::ITensors.LazyApply.Applied{typeof(prod),Tuple{Array{ITensor,1}}}, ::Any; kwargs...) at [/home/yuyihan/.julia/packages/ITensors/5sSxp/src/Ops/ops_itensor.jl:112]
product(!Matched::ITensor, ::ITensors.AbstractMPS) at [/home/yuyihan/.julia/packages/ITensors/5sSxp/src/mps/abstractmps.jl:1829]
product(!Matched::ITensor, ::ITensors.AbstractMPS, !Matched::Any; move_sites_back, apply_dag, kwargs...) at [/home/yuyihan/.julia/packages/ITensors/5sSxp/src/mps/abstractmps.jl:1829]
... Stacktrace: [1] top-level scope at [/home/yuyihan/itensor_HaveAtry/haveatry.ipynb:15]