-
Notifications
You must be signed in to change notification settings - Fork 45
Closed
Description
Using the Heisenberg Hamiltonian from the test/setup.jl the function convert(::Type{TensorMap}, H::FiniteMPOHamiltonian) fails with AssertionError: iscyclicpermutation(p), see example below:
using MPSKit, TensorKit
function heisenberg_XXX(::Type{SU2Irrep}; spin=1, L=Inf)
h = ones(ComplexF64, SU2Space(spin => 1)^2 ← SU2Space(spin => 1)^2)
for (c, b) in blocks(h)
S = (dim(c) - 1) / 2
b .= S * (S + 1) / 2 - spin * (spin + 1)
end
scale!(h, 4)
if L == Inf
lattice = PeriodicArray([space(h, 1)])
return InfiniteMPOHamiltonian(lattice, (i, i + 1) => h for i in 1:1)
else
lattice = fill(space(h, 1), L)
return FiniteMPOHamiltonian(lattice, (i, i + 1) => h for i in 1:(L - 1))
end
end
H = heisenberg_XXX(SU2Irrep; L=4)
h = convert(TensorMap, H)Metadata
Metadata
Assignees
Labels
No labels