Skip to content

Commit b7e48ca

Browse files
authored
Merge pull request #2 from yuiyuiui/WaitForReview
check tab
2 parents c247151 + 007d9ae commit b7e48ca

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

Project.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
88
PackageExtensionCompat = "65ce6f38-6b18-4e1d-a461-8949797d7930"
99
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
1010
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
11-
TestExtras = "5ed8adda-3752-4e41-b88a-e8b09835ee3a"
11+
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
1212
VectorInterface = "409d34a3-91d5-4945-b6ec-7529ddf182d8"
1313

1414
[weakdeps]
@@ -27,6 +27,7 @@ Logging = "1"
2727
PackageExtensionCompat = "1"
2828
Printf = "1"
2929
Random = "1"
30+
SparseArrays = "1.11.0"
3031
Test = "1"
3132
TestExtras = "0.2,0.3"
3233
VectorInterface = "0.5"

src/KrylovKit.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export initialize, initialize!, expand!, shrink!
3737
export ClassicalGramSchmidt, ClassicalGramSchmidt2, ClassicalGramSchmidtIR
3838
export ModifiedGramSchmidt, ModifiedGramSchmidt2, ModifiedGramSchmidtIR
3939
export LanczosIterator, ArnoldiIterator, GKLIterator
40-
export CG, GMRES, BiCGStab, Lanczos, BlockLanczos, Arnoldi, GKL, GolubYe, LSMR
40+
export CG, GMRES, BiCGStab, Lanczos, Arnoldi, GKL, GolubYe, LSMR
4141
export KrylovDefaults, EigSorter
4242
export RecursiveVec, InnerProductVec
4343

src/algorithms.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,6 @@ function Lanczos(;
124124
orth::Orthogonalizer=KrylovDefaults.orth,
125125
eager::Bool=false,
126126
verbosity::Int=KrylovDefaults.verbosity[])
127-
if block_size >1
128-
orth = ModifiedGramSchmidt2()
129-
krylovdim = typemax(Int64)
130-
end
131127
return Lanczos(block_size, orth, krylovdim, maxiter, tol, eager, verbosity)
132128
end
133129

src/eigsolve/lanczos.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,12 @@ function block_lanczos_reortho(A, x₀::AbstractMatrix{S}, howmany::Int, which::
230230
_res(fact, A, howmany, tol, block_size)
231231
end
232232

233+
if (fact.k * block_size > alg.krylovdim)
234+
@warn "The real Krylov dimension is $(fact.k * block_size), which is larger than the maximum allowed dimension $(alg.krylovdim)."
235+
# In this version we don't shrink the factorization because it might cause issues, different from the ordinary Lanczos.
236+
# Why it happens remains to be investigated.
237+
end
238+
233239
if (num_converged < howmany) && verbosity >= WARN_LEVEL
234240
@warn """Block Lanczos eigsolve stopped without full convergence after $(fact.k) iterations:
235241
* $num_converged eigenvalues converged

0 commit comments

Comments
 (0)