  Efficient implementations of electronic structure methods are essential for
first-principles modeling of molecules and solids. We here present a
particularly efficient common framework for methods beyond semilocal
density-functional theory, including Hartree-Fock (HF), hybrid density
functionals, random-phase approximation (RPA), second-order M{\o}ller-Plesset
perturbation theory (MP2), and the $GW$ method. This computational framework
allows us to use compact and accurate numeric atom-centered orbitals (popular
in many implementations of semilocal density-functional theory) as basis
functions. The essence of our framework is to employ the "resolution of
identity (RI)" technique to facilitate the treatment of both the two-electron
Coulomb repulsion integrals (required in all these approaches) as well as the
linear density-response function (required for RPA and $GW$). This is possible
because these quantities can be expressed in terms of products of
single-particle basis functions, which can in turn be expanded in a set of
auxiliary basis functions (ABFs). The construction of ABFs lies at the heart of
the RI technique, and here we propose a simple prescription for constructing
the ABFs which can be applied regardless of whether the underlying radial
functions have a specific analytical shape (e.g., Gaussian) or are numerically
tabulated. We demonstrate the accuracy of our RI implementation for Gaussian
and NAO basis functions, as well as the convergence behavior of our NAO basis
sets for the above-mentioned methods. Benchmark results are presented for the
ionization energies of 50 selected atoms and molecules from the G2 ion test set
as obtained with $GW$ and MP2 self-energy methods, and the G2-I atomization
energies as well as the S22 molecular interaction energies as obtained with the
RPA method.
