The efficient implementation of electronic structure methods is essential for first principles modeling of molecules and solids. We present here a particularly efficient common framework for methods beyond semilocal density-functional theory (DFT), including Hartree-Fock (HF), hybrid density functionals, random-phase approximation (RPA), second-order Møller-Plesset perturbation theory (MP2) and the GW method. This computational framework allows us to use compact and accurate numeric atom-centered orbitals (NAOs), popular in many implementations of semilocal DFT, 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) and the linear density-response function (required for RPA and GW ). This is possible because these quantities can be expressed in terms of the 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 we propose here a simple prescription for constructing ABFs which can be applied regardless of whether the underlying radial functions have a specific analytical shape 2 (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 obtained with the GW and MP2 selfenergy methods, and the G2-I atomization energies as well as the S22 molecular interaction energies obtained with the RPA method. 6.2. Benchmark MP2 and RPA results for the G2-I atomization energies . . . . . . 40 6.3. Benchmark MP2 and RPA binding energies for the S22 molecular set . . . . . 42 7. Conclusions and outlook 44 Acknowledgments 44 Appendix A. Matrix elements for numeric atom-centered orbitals 45 Appendix B. Ionization energies of a set of atoms and molecules 48 Appendix C. The modified Gauss-Legendre grid 48 References 50 New Journal of Physics 14 (2012) 053020 (http://www.njp.org/) 3 1. IntroductionAccurate quantum-mechanical predictions of the properties of molecules and materials (solids, surfaces, nano-structures, etc) from first principles play an important role in chemistry and condensed-matter research today. Of particular importance are computational approximations to the many-body Schrödinger or Dirac equations that are tractable and yet retain quantitatively reliable atomic-scale information about the system-if not for all possible materials and properties, then at least for a relevant subset. Density-functional theory (DFT) [1,2] is one such successful avenue. It maps the interacting many-body problem onto an effective single-particle one where the many-body complexity is hidden in the unknown exchange-correlation (XC) term, which has to be approx...