# Weird error regarding unsupported keyword arguments with KrylovKit eigsolve

**URL:** <https://discourse.julialang.org/t/weird-error-regarding-unsupported-keyword-arguments-with-krylovkit-eigsolve/91069>\
**Category:** Numerics\
**Tags:** question\
**Created:** [December 1, 2022, 1:00am UTC](https://discourse.julialang.org/t/weird-error-regarding-unsupported-keyword-arguments-with-krylovkit-eigsolve/91069 "2022-12-01T01:00:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![GregVernon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gregvernon/32/5611_2.png) [@GregVernon](https://discourse.julialang.org/u/GregVernon)\
**Post date:** [December 1, 2022, 1:00am UTC](https://discourse.julialang.org/t/weird-error-regarding-unsupported-keyword-arguments-with-krylovkit-eigsolve/91069/1 "2022-12-01T01:00:44Z")

</div>

I’m trying to compute the condition number for sparse (stiffness) matrices coming from finite element analyses. I’ve included a download link for one such matrix below. Here’s a script that should read the (PETSc) stiffness matrix:

```julia
import PETScBinaryIO

K = PETScBinaryIO.readpetsc( "cf_stiffness.dat" )
# 41232×41232 SparseArrays.SparseMatrixCSC{Float64, Int32} with 10362492 stored entries:

```

I’m trying to use `KrylovKit.eigsolve()` to compute min and max eigenvalues (as condition number is the ratio of the two). The [documentation](https://jutho.github.io/KrylovKit.jl/stable/man/eig/#KrylovKit.eigsolve) for `eigsolve` provides the syntax:

```julia
eigsolve(f, n::Int, [howmany = 1, which = :LM, T = Float64]; kwargs...)

```

But if I try the following I get an error: `got unsupported keyword arguments "howmany", "which"`

```julia
julia> e,v = KrylovKit.eigsolve( K, 1, howmany=1, which=:LM )
ERROR: MethodError: no method matching eigselector(::SparseArrays.SparseMatrixCSC{Float64, Int32}, ::Type{Float64}; howmany=1, which=:LM)
Closest candidates are:
  eigselector(::AbstractMatrix{T} where T, ::Type; issymmetric, ishermitian, krylovdim, maxiter, tol, orth, eager, verbosity) at /home/gvernon2/.julia/packages/KrylovKit/diNbc/src/eigsolve/eigsolve.jl:237 got unsupported keyword arguments "howmany", "which"
  eigselector(::Any, ::Type; issymmetric, ishermitian, krylovdim, maxiter, tol, orth, eager, verbosity) at /home/gvernon2/.julia/packages/KrylovKit/diNbc/src/eigsolve/eigsolve.jl:205 got unsupported keyword arguments "howmany", "which"
Stacktrace:
 [1] kwerr(::NamedTuple{(:howmany, :which), Tuple{Int64, Symbol}}, ::Function, ::SparseArrays.SparseMatrixCSC{Float64, Int32}, ::Type)
   @ Base ./error.jl:157
 [2] eigsolve(f::SparseArrays.SparseMatrixCSC{Float64, Int32}, x₀::Vector{Float64}, howmany::Int64, which::Symbol; kwargs::Base.Iterators.Pairs{Symbol, Any, Tuple{Symbol, Symbol}, NamedTuple{(:howmany, :which), Tuple{Int64, Symbol}}})
   @ KrylovKit ~/.julia/packages/KrylovKit/diNbc/src/eigsolve/eigsolve.jl:184
 [3] eigsolve(A::SparseArrays.SparseMatrixCSC{Float64, Int32}, howmany::Int64, which::Symbol, T::Type; kwargs::Base.Iterators.Pairs{Symbol, Any, Tuple{Symbol, Symbol}, NamedTuple{(:howmany, :which), Tuple{Int64, Symbol}}})
   @ KrylovKit ~/.julia/packages/KrylovKit/diNbc/src/eigsolve/eigsolve.jl:176
 [4] top-level scope
   @ REPL[31]:1

```

I assume I’m misinterpreting the documentation?  
[Download link for Matrix data (120MB )](http://transfer.coreform.com/get/osvgq/cf_stiffness.dat)

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [December 1, 2022, 3:57am UTC](https://discourse.julialang.org/t/weird-error-regarding-unsupported-keyword-arguments-with-krylovkit-eigsolve/91069/2 "2022-12-01T03:57:15Z")

</div>

> [@GregVernon](#):
>
> `KrylovKit`

They are not keyword arguments: [https://github.com/Jutho/KrylovKit.jl/blob/5833922454e34ed09ce8d42a9cae46ceab3ea398/src/eigsolve/eigsolve.jl#L170](https://github.com/Jutho/KrylovKit.jl/blob/5833922454e34ed09ce8d42a9cae46ceab3ea398/src/eigsolve/eigsolve.jl#L170)

---

<div class="post-metadata">

**Author:** ![GregVernon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gregvernon/32/5611_2.png) [@GregVernon](https://discourse.julialang.org/u/GregVernon)\
**Post date:** [December 1, 2022, 2:38pm UTC](https://discourse.julialang.org/t/weird-error-regarding-unsupported-keyword-arguments-with-krylovkit-eigsolve/91069/3 "2022-12-01T14:38:24Z")

</div>

Oh that’s embarrassing 😂. I’ve been doing too much Python recently…
