Skip to content

convert(::Type{TensorMap}, H::FiniteMPOHamiltonian) fails #255

@benjamints

Description

@benjamints

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions