Skip to content

Commit

Permalink
adjust test, fix KrylovKit constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
pablosanjose committed Oct 21, 2023
1 parent e60f750 commit 6f035f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/solvers/eigen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions test/test_bandstructure.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 6f035f8

Please sign in to comment.