BSE solvers overview: Difference between revisions

From Lumen wiki
Jump to navigationJump to search
Davide (talk | contribs)
m updating solvers info
Davide (talk | contribs)
Improving info on solvers
Line 7: Line 7:


==Full diagonalization solver (-y d)==
==Full diagonalization solver (-y d)==
TODO: Update info on ldiago vs odiago, and mentions to scalapack and Elpa
Diagonalization of the full Hamiltonian can be done in serial, using the standard LAPACK library. Also, it is possible to do full diagonalization asking only for a subset of eigenvalues of eigenvectors.   
 
Diagonalization of the full Hamiltonian using the standard LAPACK library.   


This solver outputs the macroscopic dielectric function over a range of energies chosen by the user. It also calculates all exciton energies and composition in terms of electron-hole pairs. Upon user's choice, the latter is stored on disk for use in postprocessing for exciton analysis and plotting as seen in the tutorial '''[[How to analyse excitons - CECAM 2021 school|How to analyse excitons]]'''.  
This solver outputs the macroscopic dielectric function over a range of energies chosen by the user. It also calculates all exciton energies and composition in terms of electron-hole pairs. Upon user's choice, the latter is stored on disk for use in postprocessing for exciton analysis and plotting as seen in the tutorial '''[[How to analyse excitons - CECAM 2021 school|How to analyse excitons]]'''.  


Unfortunately, the computational cost of full diagonalization is cubic in the number of electron-hole pairs so this solver can be used for small system only (few light atoms per unit cell).  
The computational cost of full diagonalization is cubic in the number of electron-hole pairs so this solver can be used for small system only (few light atoms per unit cell). However, thanks to modern libraries like scalapack and ELPA, it is nowadays possible to fully diagonalize very large BSE matrices exploiting MPI and GPUs<ref name="Milev2025" />. In Lumen we have two working interfaces with Scalapack and one with ELPA.
   
   
You should have already carried out the  '''[[Bethe-Salpeter solver: diagonalization]]'''. If you wish, you can run again this part and then '''return to this tutorial'''
An example of a tutorial doing full diagonalization can be found here: '''[[Bethe-Salpeter solver: diagonalization]]'''


==Lanczos-Haydock solver (-y h)==
==Lanczos-Haydock solver (-y h)==
Subspace iterative [https://en.wikipedia.org/wiki/Lanczos_algorithm | Lanczos algorithm] which by-pass diagonalization with the Haydock approach<ref>R. Haydock, in
Subspace iterative [https://en.wikipedia.org/wiki/Lanczos_algorithm | Lanczos algorithm] which by-pass diagonalization with the Haydock approach<ref name="Haydock1980"/>.
''Solid State Phys.'', '''35''' 215 (1980) edited by H. Ehrenfest, F. Seitz, and D. Turnbull, Academic Press</ref>.


This solver outputs the macroscopic dielectric function over a range of energies chosen by the user. It can be applied to medium-large systems as it is substantially cheaper than the full diagonalization (quadratic with the number of electron-hole pairs). However, this approach ''does not provide'' the individual exciton energies and composition in terms of electron-hole pairs.
This solver outputs the macroscopic dielectric function over a range of energies chosen by the user. It can be applied to medium-large systems as it is substantially cheaper than the full diagonalization (quadratic with the number of electron-hole pairs). However, this approach ''does not provide'' the individual exciton energies and composition in terms of electron-hole pairs.


Follow the link to '''[[Bethe-Salpeter solver: Lanczos-Haydock]]''' then  '''return to this tutorial'''
An example of a tutorial using Haydock can be found here: '''[[Bethe-Salpeter solver: Lanczos-Haydock]]'''<br>
 
This solver is also compatible with the double-grid<ref name="Alliati2022" />, see tutorial: [[Fast convergence of dielectric constant with double grid]].
This solver is compatible with the double-grid, see tutorial: [[Fast convergence of dielectric constant with double grid]].


==SLEPc solver (-y s) ==
==SLEPc solver (-y s) ==
Subspace iterative algorithm using the [https://slepc.upv.es SLEPc library]<ref>V. Hernandez, J.E. Roman and V. Vidal in '' ACM Transactions on Mathematical Software'', '''31''' 315 (2005)</ref> (SLEPC solver).
Subspace iterative algorithm using the [https://slepc.upv.es SLEPc library]<ref name="Hernandez2005" /> (SLEPC solver).


This solver outputs the individual exciton energies and composition about an energy value chosen by the user. It can be applied to medium-large systems but does not provide the overall spectrum. This solver is typically used after obtaining the spectra from the Lanczos-Haydock solver to either analyze a specific peak or getting the energy and composition of a few low-lying excitons. It can be used for large-medium systems. The computational cost grows with the number of excitons one asks to compute.   
This solver outputs the individual exciton energies and composition about an energy value chosen by the user. It can be applied to medium-large systems but does not provide the overall spectrum. This solver is typically used after obtaining the spectra from the Lanczos-Haydock solver to either analyze a specific peak or getting the energy and composition of a few low-lying excitons. It can be used for large-medium systems. The computational cost grows with the number of excitons one asks to compute.   


'''Optional:'''
'''Important:'''
Advanced users can recompile Yambo with the ''--enable-slepc-linalg'' option if they hadn't done so.
To exploit the slepc solver, you need to link the code with Slepc and Petsc library.
If/Once you have a Yambo version compiled with the SLEPc, or you have the Virtual Machine or the Docker (with the yambo-gcc_openmp_petsc [[CECAM VIRTUAL 2021| container]]), follow the link to '''[[Bethe-Salpeter solver: SLEPC]]''' then  '''return to this tutorial'''
See here for more infoL [Install Lumen with external slepc and petsc libraries].
 
An example of tutorial using Slepc can be found here: '''[[Bethe-Salpeter solver: SLEPC]]'''


==ChASE solver (-y c) ==
==ChASE solver (-y c) ==
Line 41: Line 39:


==INVERSION solver (-y i) ==
==INVERSION solver (-y i) ==
This solver is not used anymore, it was used in an old implementation of the double-grid see Ref.<ref>David Kammerlander, Silvana Botti, Miguel A. L Marques, Andrea Marini, and Claudio Attaccalite, Phys. Rev. B 86, 125203 (2012) </ref>
The inversion solver was designed to invert the Dyson equation frequency by frequency. For each frequency the inversion (which can be done with Lapack) has roughly the same cost of a diagonalization. Needing to do so for every frequency, this solver easily becomes very expensive. It was designed to deal with frequency dependent kernel, and also extended with an old implementation of the double-grid see Ref.<ref name="Kammerland2012" />. However, it is not used much anymore.


==Summary==
==Summary==
Line 54: Line 52:


=References =
=References =
<references />
<references>
<ref name="Haydock1980">R. Haydock, ''Solid State Phys.'', '''35''' 215 (1980) edited by H. Ehrenfest, F. Seitz, and D. Turnbull, Academic Press</ref>
<ref name="Hernandez2005">V. Hernandez, J.E. Roman and V. Vidal in '' ACM Transactions on Mathematical Software'', '''31''' 315 (2005)</ref>
<ref name="Kammerland2012" >David Kammerlander, Silvana Botti, Miguel A. L Marques, Andrea Marini, and Claudio Attaccalite, Phys. Rev. B 86, 125203 (2012) </ref>
<ref name="Alliati2022">I.M. Alliati, D. Sangalli, M. Gruning, ''Double k-Grid Method for Solving the Bethe-Salpeter Equation via Lanczos Approaches'', [https://www.frontiersin.org/journals/chemistry/articles/10.3389/fchem.2021.763946/full Frontiers in Chemistry, '''9''', p.763946 (2022)]</ref>
<ref name="Milev2025">P. Milev, et al. TO FIX</ref>
</references>

Revision as of 12:35, 16 June 2026

This tutorial explores the options available in Yambo for the numerical solution of the Bethe-Salpeter equation. Before running this tutorial, you should have carried out the tutorial Calculating optical spectra including excitonic effects: a step-by-step guide. We will use the same example system (bulk hBN). The various options correspond to different numerical methods for solving (large) eigenvalue problems. The numerical methods are not covered in this tutorial and the interested user is directed to the references.

After completion of this tutorial, you are expected to recognize which solver to use depending on the system, computational load and desired output. Also, for each of the solver, you should be able to choose the values for the key input parameters.

Three main solvers are available in Yambo:

Full diagonalization solver (-y d)

Diagonalization of the full Hamiltonian can be done in serial, using the standard LAPACK library. Also, it is possible to do full diagonalization asking only for a subset of eigenvalues of eigenvectors.

This solver outputs the macroscopic dielectric function over a range of energies chosen by the user. It also calculates all exciton energies and composition in terms of electron-hole pairs. Upon user's choice, the latter is stored on disk for use in postprocessing for exciton analysis and plotting as seen in the tutorial How to analyse excitons.

The computational cost of full diagonalization is cubic in the number of electron-hole pairs so this solver can be used for small system only (few light atoms per unit cell). However, thanks to modern libraries like scalapack and ELPA, it is nowadays possible to fully diagonalize very large BSE matrices exploiting MPI and GPUs[1]. In Lumen we have two working interfaces with Scalapack and one with ELPA.

An example of a tutorial doing full diagonalization can be found here: Bethe-Salpeter solver: diagonalization

Lanczos-Haydock solver (-y h)

Subspace iterative | Lanczos algorithm which by-pass diagonalization with the Haydock approach[2].

This solver outputs the macroscopic dielectric function over a range of energies chosen by the user. It can be applied to medium-large systems as it is substantially cheaper than the full diagonalization (quadratic with the number of electron-hole pairs). However, this approach does not provide the individual exciton energies and composition in terms of electron-hole pairs.

An example of a tutorial using Haydock can be found here: Bethe-Salpeter solver: Lanczos-Haydock
This solver is also compatible with the double-grid[3], see tutorial: Fast convergence of dielectric constant with double grid.

SLEPc solver (-y s)

Subspace iterative algorithm using the SLEPc library[4] (SLEPC solver).

This solver outputs the individual exciton energies and composition about an energy value chosen by the user. It can be applied to medium-large systems but does not provide the overall spectrum. This solver is typically used after obtaining the spectra from the Lanczos-Haydock solver to either analyze a specific peak or getting the energy and composition of a few low-lying excitons. It can be used for large-medium systems. The computational cost grows with the number of excitons one asks to compute.

Important: To exploit the slepc solver, you need to link the code with Slepc and Petsc library. See here for more infoL [Install Lumen with external slepc and petsc libraries].

An example of tutorial using Slepc can be found here: Bethe-Salpeter solver: SLEPC

ChASE solver (-y c)

TO ADD INFO


INVERSION solver (-y i)

The inversion solver was designed to invert the Dyson equation frequency by frequency. For each frequency the inversion (which can be done with Lapack) has roughly the same cost of a diagonalization. Needing to do so for every frequency, this solver easily becomes very expensive. It was designed to deal with frequency dependent kernel, and also extended with an old implementation of the double-grid see Ref.[5]. However, it is not used much anymore.

Summary

To summarise, the output (dielectric function, exciton energies and composition) and cost of the three solvers are summarized in this table.

Yambo tutorial image


References

  1. P. Milev, et al. TO FIX
  2. R. Haydock, Solid State Phys., 35 215 (1980) edited by H. Ehrenfest, F. Seitz, and D. Turnbull, Academic Press
  3. I.M. Alliati, D. Sangalli, M. Gruning, Double k-Grid Method for Solving the Bethe-Salpeter Equation via Lanczos Approaches, Frontiers in Chemistry, 9, p.763946 (2022)
  4. V. Hernandez, J.E. Roman and V. Vidal in ACM Transactions on Mathematical Software, 31 315 (2005)
  5. David Kammerlander, Silvana Botti, Miguel A. L Marques, Andrea Marini, and Claudio Attaccalite, Phys. Rev. B 86, 125203 (2012)