  We present a new power spectrum emulator named EuclidEmulator that estimates
the nonlinear correction to the linear dark matter power spectrum. It is based
on a spectral decomposition method called polynomial chaos expansion. All steps
in the construction of the emulator have been tested and optimized: the large
high-resolution N-body simulations carried out with PKDGRAV3 were validated
using a simulation from the Euclid Flagship campaign and demonstrated to have
converged up to wavenumbers $k\approx 5\,h\,{\rm Mpc}^{-1}$ for redshifts
$z\leq 5$. The emulator is constructed using the uncertainty quantification
software UQLab and it has been optimized first by creating mock emulators based
on Takahashi's HALOFIT. We show that it is possible to successfully predict the
performance of the final emulator in this way prior to performing any N-body
simulations. We provide a C-code to calculate the nonlinear correction at a
relative accuracy of $\sim0.3\%$ with respect to N-body simulations within 50
ms. The absolute accuracy of the final nonlinear power spectrum is comparable
to one obtained with N-body simulations, i.e. $\sim 1\%$ for $k\lesssim
1\,h\,{\rm Mpc}^{-1}$ and $z\lesssim 3.5$. This enables efficient forward
modeling in the nonlinear regime allowing for maximum likelihood estimation of
cosmological parameters. EuclidEmulator has been compared to HALOFIT and
CosmicEmu, an alternative emulator based on the Mira-Titan Universe, and shown
to be more accurate than these other approaches. This work paves a new way for
optimal construction of future emulators that also consider other cosmological
observables, use higher resolution input simulations and investigate higher
dimensional cosmological parameter spaces.
