Skip to content

Unexpected behavior for sector keyword argument in e.g. exact_diagonalization #260

@benjamints

Description

@benjamints

I am trying to implement a model with a product group structure, and I have run into a problem with exact_diagonalization() returning ArgumentError: invalid sector for valid sectors. In particular, if I convert the FiniteMPOHamiltonian into a TensorMap, then I get all sector as expected. See below code:

using MPSKit, TensorKit
import LinearAlgebra.eigvals

V = Rep[U₁×SU₂]((0, 0) => 1, (1, 1 / 2) => 1)
O = TensorMap(randn, Float64, V  V  V  V)
O = O + O'

N = 4
H = FiniteMPOHamiltonian(fill(V, N), (i, i + 1) => O for i = 1:N-1)

h = convert(TensorMap, H)

# Choose a sector
sectors = collect(blocksectors(h))
sec = sectors[4]

# Works
vals1 = eigvals(block(h, sec))
println(vals1)

# Fails
vals2, _ = exact_diagonalization(H; sector=sec)
println(vals2)

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