-
Notifications
You must be signed in to change notification settings - Fork 45
Closed as not planned
Description
I tried to multiply an InfiniteMPOHamiltonian with a InfiniteMPS, as I recalled this was possible in [email protected] (this being the relevant code for v0.11.6). However, it seems this isn't supported in v0.12. What does exist, is the multiplication of a FiniteMPOHamiltonian with a FiniteMPS (relevant code here).
A MWE:
julia> using TensorKit, MPSKit, MPSKitModels
julia> sp = SU2Space(1=>1,1//2=>1)
julia> h = TensorMap(rand, ComplexF64, sp^2 ← sp^2)
julia> H = @mpoham sum(h{i,j} for (i,j) in nearest_neighbours(InfiniteChain(1)))
julia> init = InfiniteMPS([sp],[sp])
julia> H*init
ERROR: MethodError: no method matching *(::InfiniteMPOHamiltonian{BlockTensorKit.SparseBlockTensorMap{…}}, ::InfiniteMPS{TensorMap{…}, TensorMap{…}})
julia> Hfin = @mpoham sum(h{i,j} for (i,j) in nearest_neighbours(FiniteChain(4)))
julia> init_fin = FiniteMPS(4, sp, sp)
julia> Hfin * init_fin # no errorConverting first to InfiniteMPO also errors:
julia> InfiniteMPO(H)*init
ERROR: MethodError: no method matching fuser(::Type{…}, ::GradedSpace{…}, ::BlockTensorKit.SumSpace{…})What does work is to first convert the InfiniteMPOHamiltonian to a MPSKit.DenseMPO, and then perform the multiplication. I would think something like
Base.*(H::InfiniteMPOHamiltonian, mps::InfiniteMPS) = convert(DenseMPO, H) * mpssimilar to v0.11.x should suffice, unless this isn't the wanted behavior of this multiplication.
Extra info:
Julia Version 1.10.1
MPSKit v0.12.6
MPSKitModels v0.4.1
TensorKit v0.14.5
Metadata
Metadata
Assignees
Labels
No labels