yambo-code / yambo

This is the official GPL repository of the yambo code
http://www.yambo-code.eu/
GNU General Public License v2.0
91 stars 35 forks source link

Slepc stshell #80

Open blmelp opened 2 months ago

blmelp commented 2 months ago

Implementation of the Schur complement in SLEPc using a spectral transformation of type STSHELL. To use it one must change the solver type BSS_slepc_approach=="KS-sinvert"

sangallidavide commented 2 months ago

Introduction

In yambo (so far) we control the matrix format, the approach, and the preconditioning

The matrix format sets different algorithms.

BSSSlepcMatrixFormat="explicit"     # shell|explicit|explicit-debug

Instead the approach and the Preconditioning

BSSSlepcApproach="Kyrlov-Schur"  # "Krylov-Schur","Generalized-Davidson","Jacobi-Davidson"
BSSSlepcPrecondition="none"         # none|preonly+jacobi|bcgs+jacobi

set

epskind
kspkind
pckind

Also there are cross checks between these and accordingly is set the values of stkind. Specifically, only when the preconditioning is on (not allowed in Shell format), also stkind is defined.

In practice we have

BSSSlepcApproach=epskind
BSSSlepcPrecondition=kspkind+spkind

With the new change, if I understand, e.g. KS-invert, the stkind is also defined without preconditioning. The new login would be something like

BSSSlepcApproach=epskind+stkind
BSSSlepcPrecondition=kspkind+spkind

with options

BSSSlepcApproach="KS"  # "Krylov-Schur" (or "KS"),
                         "Generalized-Davidson" (or "GD"),
                         "Jacobi-Davidson" (or "JD") 
             and the new "Krylov-Schur+Shift-Invert" (or "KS+SI")

Questions:

1) Is the interpretation correct? 2) I guess few more cross checks would be needed. For example: 2.a) when would KS+SI be allowed, e.g. with which matrix formats? 2.b) would KS+SI be compatible also with Preconditioning?

Final minor comment. In a Fortran source file, it should be sufficient to include an header file once (unless the header contains son specific code). So, I think it is not needed to have repeated lines such as #include <slepc/finclude/slepceps.h>