From 6f035f8a97bfcbb85b426b4c8f75620ffa67647d Mon Sep 17 00:00:00 2001 From: Pablo San-Jose Date: Sat, 21 Oct 2023 15:25:52 +0200 Subject: [PATCH] adjust test, fix KrylovKit constructor --- src/solvers/eigen.jl | 4 ++-- test/test_bandstructure.jl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/solvers/eigen.jl b/src/solvers/eigen.jl index 16253825..99251781 100644 --- a/src/solvers/eigen.jl +++ b/src/solvers/eigen.jl @@ -67,14 +67,14 @@ is_thread_safe(::Arpack) = false #### KrylovKit ##### -struct KrylovKit{P,K} <: AbstractEigenSolver +struct KrylovKit{P<:Tuple,K<:NamedTuple} <: AbstractEigenSolver params::P kwargs::K end function KrylovKit(params...; kw...) ensureloaded(:KrylovKit) - return KrylovKit(params, kw) + return KrylovKit(params, NamedTuple(kw)) end function (solver::KrylovKit)(mat) diff --git a/test/test_bandstructure.jl b/test/test_bandstructure.jl index 0443f856..5cfeeada 100644 --- a/test/test_bandstructure.jl +++ b/test/test_bandstructure.jl @@ -59,11 +59,11 @@ end @test nsubbands(b) == 1 @test nsimplices(b) == 36 # teting thread safety - we should fall back to a single thread for hf::Function - Random.seed!(1) # to have ArnoldiMethod be deterministic hf((x,)) = Quantica.call!(hc, (x, -x)) m = subdiv(0,2π,40) + Random.seed!(1) # to have ArnoldiMethod be deterministic b = bands(hf, m, showprogress = false, solver = ES.ArnoldiMethod(nev = 18)) - @test nsubbands(b) == 1 + @test nsubbands(b) <= 2 # there is a random, platform-dependent component to this hp2 = LatticePresets.honeycomb() |> hamiltonian(hopping(-1), @hopping!((t; s) -> s*t)) hf2((s, x)) = Matrix(Quantica.call!(hp2, (x, x); s))