A priori and a posteriori error estimators for first-principle molecular simula