Eigenvalues of the dielectric matrix

We compute a few eigenvalues of the dielectric matrix ($q=0$, $ω=0$) iteratively.

using DFTK
using Plots
using KrylovKit
using Printf

# Calculation parameters
kgrid = [1, 1, 1]
Ecut = 5

# Silicon lattice
a = 10.26
lattice = a / 2 .* [[0 1 1.]; [1 0 1.]; [1 1 0.]]
Si = ElementPsp(:Si, psp=load_psp("hgh/lda/Si-q4"))
atoms     = [Si, Si]
positions = [ones(3)/8, -ones(3)/8]

# Compute the dielectric operator without symmetries
model = model_LDA(lattice, atoms, positions, symmetries=false)
basis = PlaneWaveBasis(model; Ecut, kgrid)
scfres = self_consistent_field(basis, tol=1e-14);
n     Energy            log10(ΔE)   log10(Δρ)   Diag
---   ---------------   ---------   ---------   ----
  1   -7.234275091134                   -0.50    8.0
  2   -7.250254603011       -1.80       -1.40    1.0
  3   -7.251227627018       -3.01       -2.01    4.0
  4   -7.251105494085   +   -3.91       -1.96    4.0
  5   -7.251327108114       -3.65       -2.61    3.0
  6   -7.251337926497       -4.97       -3.10    3.0
  7   -7.251338783687       -6.07       -4.12    1.0
  8   -7.251338792803       -8.04       -4.19    5.0
  9   -7.251338798346       -8.26       -4.75    3.0
 10   -7.251338798584       -9.62       -5.02    1.0
 11   -7.251338798701       -9.93       -5.88    2.0
 12   -7.251338798704      -11.46       -6.14    3.0
 13   -7.251338798704      -12.60       -6.50    2.0
 14   -7.251338798705      -13.07       -6.88    3.0
 15   -7.251338798705      -13.94       -7.42    2.0
 16   -7.251338798705      -15.05       -7.97    2.0

Applying $ε^† ≔ (1- χ_0 K)$

function eps_fun(δρ)
    δV = apply_kernel(basis, δρ; ρ=scfres.ρ)
    χ0δV = apply_χ0(scfres, δV)
    δρ - χ0δV
end;

… eagerly diagonalizes the subspace matrix at each iteration

eigsolve(eps_fun, randn(size(scfres.ρ)), 5, :LM; eager=true, verbosity=3);
[ Info: Arnoldi iteration step 1: normres = 0.1088909287508022
[ Info: Arnoldi iteration step 2: normres = 0.4622677256731491
[ Info: Arnoldi iteration step 3: normres = 0.6344964963288876
[ Info: Arnoldi iteration step 4: normres = 0.2484327531148385
[ Info: Arnoldi iteration step 5: normres = 0.5051296480451756
[ Info: Arnoldi schursolve in iter 1, krylovdim = 5: 0 values converged, normres = (9.14e-03, 8.03e-02, 4.00e-01, 2.96e-01, 2.60e-02)
[ Info: Arnoldi iteration step 6: normres = 0.3020026957672988
[ Info: Arnoldi schursolve in iter 1, krylovdim = 6: 0 values converged, normres = (2.36e-03, 1.36e-01, 2.36e-01, 9.48e-02, 5.74e-02)
[ Info: Arnoldi iteration step 7: normres = 0.09238661542894576
[ Info: Arnoldi schursolve in iter 1, krylovdim = 7: 0 values converged, normres = (1.09e-04, 1.48e-02, 1.71e-02, 5.20e-02, 6.50e-02)
[ Info: Arnoldi iteration step 8: normres = 0.12315295405474072
[ Info: Arnoldi schursolve in iter 1, krylovdim = 8: 0 values converged, normres = (5.80e-06, 1.29e-03, 1.66e-03, 2.06e-02, 4.48e-02)
[ Info: Arnoldi iteration step 9: normres = 0.07979277675141828
[ Info: Arnoldi schursolve in iter 1, krylovdim = 9: 0 values converged, normres = (2.02e-07, 7.46e-05, 1.07e-04, 6.29e-03, 3.16e-02)
[ Info: Arnoldi iteration step 10: normres = 0.0765074693633526
[ Info: Arnoldi schursolve in iter 1, krylovdim = 10: 0 values converged, normres = (6.70e-09, 4.07e-06, 6.47e-06, 1.61e-03, 1.80e-02)
[ Info: Arnoldi iteration step 11: normres = 0.0687033920140782
[ Info: Arnoldi schursolve in iter 1, krylovdim = 11: 0 values converged, normres = (2.00e-10, 2.01e-07, 3.55e-07, 3.87e-04, 9.89e-03)
[ Info: Arnoldi iteration step 12: normres = 0.07393887059694824
[ Info: Arnoldi schursolve in iter 1, krylovdim = 12: 0 values converged, normres = (6.26e-12, 1.02e-08, 2.00e-08, 8.02e-05, 3.73e-03)
[ Info: Arnoldi iteration step 13: normres = 0.06296925296766595
[ Info: Arnoldi schursolve in iter 1, krylovdim = 13: 1 values converged, normres = (1.70e-13, 4.54e-10, 9.87e-10, 1.61e-05, 1.53e-03)
[ Info: Arnoldi iteration step 14: normres = 0.5912084168009372
[ Info: Arnoldi schursolve in iter 1, krylovdim = 14: 1 values converged, normres = (7.85e-14, 7.28e-10, 2.55e-09, 5.83e-01, 1.28e-02)
[ Info: Arnoldi iteration step 15: normres = 0.14899811794523393
[ Info: Arnoldi schursolve in iter 1, krylovdim = 15: 1 values converged, normres = (6.15e-15, 2.85e-10, 6.73e-02, 1.22e-04, 1.32e-05)
[ Info: Arnoldi iteration step 16: normres = 0.23619420356225265
[ Info: Arnoldi schursolve in iter 1, krylovdim = 16: 1 values converged, normres = (1.46e-15, 1.62e-09, 1.67e-01, 1.92e-03, 1.65e-01)
[ Info: Arnoldi iteration step 17: normres = 0.037192045213714074
[ Info: Arnoldi schursolve in iter 1, krylovdim = 17: 1 values converged, normres = (2.34e-17, 7.34e-04, 4.71e-03, 3.83e-07, 3.77e-03)
[ Info: Arnoldi iteration step 18: normres = 0.025055097611234624
[ Info: Arnoldi schursolve in iter 1, krylovdim = 18: 1 values converged, normres = (2.43e-19, 3.86e-05, 6.95e-05, 5.43e-07, 6.93e-05)
[ Info: Arnoldi iteration step 19: normres = 0.23693829922224996
[ Info: Arnoldi schursolve in iter 1, krylovdim = 19: 1 values converged, normres = (2.55e-20, 1.72e-08, 1.39e-05, 1.70e-06, 1.34e-05)
[ Info: Arnoldi iteration step 20: normres = 0.032172221746589146
[ Info: Arnoldi schursolve in iter 1, krylovdim = 20: 1 values converged, normres = (3.82e-22, 1.04e-07, 3.48e-07, 3.84e-07, 1.10e-07)
[ Info: Arnoldi iteration step 21: normres = 0.029675034006998967
[ Info: Arnoldi schursolve in iter 1, krylovdim = 21: 1 values converged, normres = (4.70e-24, 5.87e-09, 4.13e-09, 4.41e-09, 7.50e-09)
[ Info: Arnoldi iteration step 22: normres = 0.05811971014225709
[ Info: Arnoldi schursolve in iter 1, krylovdim = 22: 1 values converged, normres = (1.13e-25, 2.03e-10, 1.85e-10, 1.94e-10, 3.11e-10)
[ Info: Arnoldi iteration step 23: normres = 0.3902899874790266
[ Info: Arnoldi schursolve in iter 1, krylovdim = 23: 1 values converged, normres = (3.81e-26, 3.11e-10, 3.00e-10, 7.12e-10, 1.11e-09)
[ Info: Arnoldi iteration step 24: normres = 0.013742471001254223
[ Info: Arnoldi schursolve in iter 1, krylovdim = 24: 1 values converged, normres = (2.36e-28, 5.06e-12, 4.63e-12, 2.26e-09, 3.59e-09)
[ Info: Arnoldi iteration step 25: normres = 0.04738440153394147
[ Info: Arnoldi schursolve in iter 1, krylovdim = 25: 3 values converged, normres = (4.61e-30, 1.58e-13, 1.44e-13, 1.33e-04, 3.53e-06)
[ Info: Arnoldi iteration step 26: normres = 0.0648865388573854
[ Info: Arnoldi schursolve in iter 1, krylovdim = 26: 3 values converged, normres = (1.35e-31, 7.81e-15, 7.14e-15, 5.08e-09, 6.13e-09)
[ Info: Arnoldi iteration step 27: normres = 0.03441543350378667
[ Info: Arnoldi schursolve in iter 1, krylovdim = 27: 3 values converged, normres = (1.92e-33, 1.78e-16, 1.63e-16, 1.02e-07, 1.62e-08)
[ Info: Arnoldi iteration step 28: normres = 0.0844702507580163
[ Info: Arnoldi schursolve in iter 1, krylovdim = 28: 3 values converged, normres = (7.09e-35, 1.09e-17, 9.95e-18, 1.03e-08, 2.26e-09)
[ Info: Arnoldi iteration step 29: normres = 0.019352825588841296
[ Info: Arnoldi schursolve in iter 1, krylovdim = 29: 3 values converged, normres = (5.74e-37, 1.42e-19, 1.30e-19, 6.99e-11, 1.57e-10)
[ Info: Arnoldi iteration step 30: normres = 0.16330505545163565
[ Info: Arnoldi schursolve in iter 1, krylovdim = 30: 3 values converged, normres = (4.00e-38, 1.62e-20, 1.48e-20, 8.62e-12, 1.98e-11)
[ Info: Arnoldi schursolve in iter 2, krylovdim = 19: 3 values converged, normres = (4.00e-38, 1.62e-20, 1.48e-20, 8.62e-12, 1.98e-11)
[ Info: Arnoldi iteration step 20: normres = 0.08938105809182119
[ Info: Arnoldi schursolve in iter 2, krylovdim = 20: 4 values converged, normres = (1.72e-39, 1.24e-21, 1.13e-21, 7.52e-13, 1.72e-12)
[ Info: Arnoldi iteration step 21: normres = 0.06829902695123656
┌ Info: Arnoldi eigsolve finished after 2 iterations:
│ *  6 eigenvalues converged
│ *  norm of residuals = (5.056310093337879e-41, 5.992720771812469e-23, 7.741819366270888e-23, 4.046856047113563e-14, 8.302334393388834e-14, 3.241018397175864e-14)
└ *  number of operations = 32