Skip to content

Regression in find_groundstate with DMRG2 and FiniteMPOHamiltonian (v0.13.11) #425

@DaanVrancken

Description

@DaanVrancken

Description

After updating to MPSKit v0.13.11, running find_groundstate with DMRG2 on a finite system throws a MethodError. It appears that a Missing value is being passed into a TensorKit function during the construction of the 2-site Hamiltonian derivative. I used TensorKit v0.16.5 and MPSKitModels v0.4.6.

This code worked as expected in v0.13.10.

Reproducible Example

using MPSKit, TensorKit, MPSKitModels

# Model parameters
const t = 1.0
const U = 3.0
const mu = U / 2

# Construct Hamiltonian from Infinite MPO
H = hubbard_model(InfiniteChain(2); U, t, mu)
H_f = periodic_boundary_conditions(H, 12)

# Initialize State
Vspaces = fill(Vect[fℤ₂](0 => 10, 1 => 10), 11)
psi = FiniteMPS(physicalspace(H_f), Vspaces)

# Algorithm
alg = DMRG2(; 
    maxiter=1000, 
    trscheme=trunctol(; atol=10e-2), 
    tol=10e-5, 
    verbosity=2
)

# Throws MethodError: no method matching spacetype(::Type{Missing})
find_groundstate(psi, H_f, alg)

Stacktrace

ERROR: MethodError: no method matching spacetype(::Type{Missing})
This error has been manually thrown, explicitly, so the method may exist but be intentionally marked as unimplemented.

Stacktrace:
 [1] spacetype(::Type{Missing})
   @ TensorKit ...\src\spaces\vectorspaces.jl:398
 [2] sectortype(::Type{Missing})
   @ TensorKit ...\src\spaces\vectorspaces.jl:348
 [3] sectortype(x::Missing)
   @ TensorKit ...\src\spaces\vectorspaces.jl:347
 [4] prepare_operator!!(H::MPSKit.JordanMPO_AC2_Hamiltonian{...}, ...)
   @ MPSKit ...\src\algorithms\derivatives\hamiltonian_derivatives.jl:304
 [5] prepare_operator!!
   @ ...\src\algorithms\derivatives\derivatives.jl:232 [inlined]
 [6] AC2_hamiltonian(site::Int64, below::FiniteMPS, operator::FiniteMPOHamiltonian, ...)
   @ MPSKit ...\src\algorithms\derivatives\hamiltonian_derivatives.jl:195
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions