3.34 Interface to LibRPA
LibRPA (https://srlive1201.github.io/LibRPA) provides low-scaling implementations of Green’s-function-based many-body perturbation theory based on the local resolution-of-identity (LRI) approximation. At present, it supports direct RPA correlation energies and one-shot GW quasi-particle calculations. In FHI-aims, LibRPA can be used in two ways: (i) through a file-based workflow, in which FHI-aims writes input files for the LibRPA driver, and (ii) through an in-program API, in which FHI-aims delegates the MBPT calculation directly to the LibRPA library.
At present, the FHI-aims–LibRPA interface is available only for periodic calculations. Accordingly, lattice_vector must be specified in geometry.in and k_grid in control.in. Finite systems can still be treated by placing them in a sufficiently large simulation cell.
File-based workflow: output librpa
The file-based interface is enabled by the tag output librpa in control.in. It is relevant when FHI-aims is used to prepare input for LibRPA calculations, currently in particular for
-
•
total_energy_method rpa, and
-
•
qpe_calc gw_expt.
When this tag is present, FHI-aims writes the data required by the LibRPA driver, including the structure, Brillouin-zone sampling, Kohn-Sham eigenvalues and eigenvectors, Coulomb matrices, and, for GW calculations, the exchange-correlation matrix elements and dielectric-function data. Additional files are written when options such as mommat or exx_postscf are requested. For periodic GW calculations along a band path, output band should also be specified so that the necessary band-path data are exported.
Examples
Example control.in for generating LibRPA input for an RPA calculation:
xc pbe relativistic atomic_zora scalar occupation_type gaussian 0.001 basis_threshold 1.e-5 total_energy_method rpa k_grid 3 3 3 output librpa # [insert species data below]
Example control.in for generating LibRPA input for a G0W0 calculation:
xc pbe relativistic atomic_zora scalar occupation_type gaussian 0.001 basis_threshold 1.e-5 qpe_calc gw_expt frequency_points 16 anacon_type 1 k_grid 3 3 3 output band 0.00000 0.00000 0.00000 0.50000 0.00000 0.50000 13 G X output librpa # [insert species data below]
For GW calculations, freq_grid_type must be set to minimax, so that the dielectric function is written on the imaginary-frequency grid expected by LibRPA. This is required, in particular, for the finite-size correction implemented in LibRPA. Use of the minimax grid additionally requires FHI-aims to be built with GreenX support, controlled by the CMake option USE_GREENX.
In-program workflow: mbpt_backend librpa
LibRPA can also be called directly through its API from within FHI-aims. In this mode, FHI-aims passes the required data to LibRPA in memory and retrieves the computed quantities within the same run. This avoids intermediate disk files and allows LibRPA to serve as an alternative MBPT backend inside FHI-aims.
The API-based interface is currently experimental. In particular, band-structure calculations through this workflow are not yet reliable and are therefore currently disabled in FHI-aims. For GW band-structure calculations, please use the file-based interface discussed above.
Building FHI-aims with LibRPA
To use the LibRPA API backend, FHI-aims must be compiled and linked against LibRPA. Two build modes are available:
-
•
USE_LIBRPA: build and link the bundled LibRPA library shipped with FHI-aims.
-
•
USE_EXTERNAL_LIBRPA: link against an externally built LibRPA installation.
To build the bundled LibRPA library, enable USE_LIBRPA in the CMake initial cache.
To use an external LibRPA build instead, enable USE_EXTERNAL_LIBRPA and provide the LibRPA build directory through EXTERNAL_LIBRPA_BUILD_DIR, e.g.
set(USE_EXTERNAL_LIBRPA ON CACHE BOOL "" FORCE)
set(EXTERNAL_LIBRPA_BUILD_DIR "$ENV{HOME}/LibRPA/build" CACHE STRING "" FORCE)
In both cases, the LibRPA Fortran bindings must be available. Please refer to the LibRPA documentation (https://srlive1201.github.io/LibRPA) for build details.
Running MBPT with the LibRPA backend
To delegate an MBPT calculation to LibRPA, use the standard MBPT-related input in control.in and additionally set mbpt_backend to librpa. For example, a one-shot GW calculation reads:
xc pbe relativistic atomic_zora scalar occupation_type gaussian 0.001 basis_threshold 1.e-5 qpe_calc gw_expt frequency_points 16 anacon_type 1 k_grid 3 3 3 output gw_regular_kgrid output k_eigenvalue 27 mbpt_backend librpa # [insert species data below]
With this setting, FHI-aims performs the MBPT calculation through LibRPA. The main output of quasi-particle energies are written in the same format as in the native FHI-aims implementation, so existing post-processing workflows can be reused.
Keywords specific to the LibRPA backend
The following keywords are relevant when mbpt_backend is set to librpa.
Tag: mbpt_backend(control.in)
Usage: mbpt_backend str
Purpose: Select the backend used for many-body perturbation theory calculations.
str: native or librpa; default is native.
-
•
native: use the MBPT implementation built into FHI-aims.
-
•
librpa: use the LibRPA backend described in Sec. 3.34.
Tag: librpa_thres_chi0(control.in)
Usage: librpa_thres_chi0 [C:<value> G:<value>]
Purpose: Set screening thresholds for atom-pair-block quantities used in the evaluation of the non-interacting response function in LibRPA.
This keyword is active only when mbpt_backend is librpa.
All thresholds default to 0.0.
Options:
-
•
C: threshold for real-space RI coefficients.
-
•
G: threshold for real-space Green’s functions.
In practice, a setting such as
librpa_thres_chi0 C:1e-3
can substantially reduce the cost of the evaluation, but the user should always verify that the chosen thresholds are sufficiently accurate for the system under study.
Tag: librpa_thres_nlex(control.in)
Usage: librpa_thres_nlex [C:<value> D:<value> V:<value>]
Purpose: Set screening thresholds for atom-pair-block quantities used in the evaluation of the non-local exchange operator in LibRPA.
This keyword is active only when mbpt_backend is librpa.
All thresholds default to 0.0.
Options:
-
•
C: threshold for real-space RI coefficients.
-
•
D: threshold for real-space density matrices.
-
•
V: threshold for real-space Coulomb matrices.
Tag: librpa_thres_sigc(control.in)
Usage: librpa_thres_sigc [C:<value> G:<value> W:<value>]
Purpose: Set screening thresholds for atom-pair-block quantities used in the evaluation of the correlation self-energy in LibRPA.
This keyword is active only when mbpt_backend is librpa.
All thresholds default to 0.0.
Options:
-
•
C: threshold for real-space RI coefficients.
-
•
G: threshold for the real-space Green’s function.
-
•
W: threshold for the correlation part of the real-space screened Coulomb interaction.
For example,
librpa_thres_sigc C:1e-4
may provide a useful starting point, but the effect of the threshold on the final results should always be checked.
Tag: output_librpa_process(control.in)
Usage: output_librpa_process bool
Purpose: Control whether LibRPA writes per-process output files.
Options: bool, with default .true.
Additional notes
The GW band structures from LibRPA calculations are obtained by Fourier interpolation. Therefore, increasing the number of k-points along the band path, or adding more path segments, entails only negligible additional cost. This is different from the current periodic GW band-structure implementation in FHI-aims, where quasi-particle energies are evaluated explicitly at each band k-point and the cost therefore grows with the number of sampled points.