In this article, we provide a priori error estimates for the spectral andpseudospectral Fourier (also called planewave) discretizations of theperiodic Thomas-Fermi-von Weizsäcker (TFW) model and for the spectraldiscretization of the periodic Kohn-Shammodel, within the local density approximation (LDA). These modelsallow to compute approximations of the electronic ground state energy and densityof molecular systems in the condensed phase. The TFW model is strictlyconvex with respect to the electronic density, and allows for acomprehensive analysis. This is not the case for the Kohn-Sham LDAmodel, for which the uniqueness of the ground state electronic densityis not guaranteed. We prove that, for any local minimizer $\Phi^0$ of the Kohn-Sham LDA model, and under a coercivity assumption ensuring the local uniqueness of this minimizer up to unitary transform, the discretized Kohn-Sham LDA problem has a minimizer in the vicinity of $\Phi^0$ for large enough energy cut-offs, and that this minimizer is unique up to unitary transform. We then derive optimal a priori error estimates for the spectral discretization method.