LibRPA is a library for efficient and accurate first-principles calculations based on many-body perturbation theory with numerical atomic orbitals (NAOs). It currently supports random-phase approximation (RPA) correlation-energy calculations and one-shot GW quasiparticle calculations for periodic systems.
By leveraging the localized resolution-of-identity (LRI) technique, LibRPA achieves low-scaling algorithms suitable for large-scale systems. It is implemented in C++ with MPI/OpenMP parallelism, provides C and Fortran interfaces, and can be integrated with density functional theory (DFT) codes through both file-based and API-based workflows.
Note
LibRPA is under active development, and its input/output interfaces are prone to change.
- RPA correlation-energy calculations and one-shot GW quasiparticle calculations
- Low-scaling algorithms based on the localized resolution-of-identity (LRI) technique
- Hybrid MPI/OpenMP parallelism
- Driver-based and API-based interfaces for integration with external DFT codes
LibRPA requires:
- a C++ compiler with MPI support
- a Fortran compiler
- BLAS and LAPACK libraries
- a ScaLAPACK library
- CMake
LibRPA uses the bundled GreenX library by default for minimax time-frequency grids.
For GW calculations, the following libraries are additionally required:
These libraries are bundled with LibRPA by default, but external versions may also be provided.
CUDA and HIP builds additionally use LibDDLA for distributed GPU linear algebra. LibRPA bundles a compatible revision and also supports an external LibDDLA installation.
Clone the repository:
git clone https://github.com/AESM-Group/LibRPA
cd LibRPAA minimal out-of-source build can be done with:
cmake -B build
cmake --build build -j4More example build scripts are provided under examples/build.
LibRPA supports two main workflows:
- Driver-based workflow: LibRPA reads data generated by an external DFT code and performs post-processing calculations such as RPA or GW
- API-based workflow: LibRPA is called directly from within the host code through its C, C++, or Fortran interfaces
For the driver workflow, runtime parameters are read from librpa.in, for example:
task = g0w0_band
input_dir = dataset/
nfreq = 16
parallel_routing = libri
More details can be found in the documentation for driver usage and API usage
See the documentation for installation instructions, user guides, examples, and tutorials.
If you use LibRPA in your work, please consider citing the relevant papers that enable the relevant feature. Please consult the How to Cite page for more details.
LibRPA is licensed under the GNU Lesser General Public License v3.0 (LGPL-3.0).
The bundled or included third-party components are licensed as follows:
- greenX (
c90d131): Apache-2.0 - cereal (1.3.0): BSD-3-Clause
- LibRI (
75902f8): LGPL-3.0 - LibRI GPU variant (
2f5e23e): LGPL-3.0 - LibComm (
12457e7): LGPL-3.0 - LibDDLA (
f1f3295): LGPL-3.0 - ELPA (2026.02.001): LGPL-3.0